diff --git a/awesome/crylia_bar/dock.lua b/awesome/crylia_bar/dock.lua index 87091c9..4011f33 100644 --- a/awesome/crylia_bar/dock.lua +++ b/awesome/crylia_bar/dock.lua @@ -181,33 +181,61 @@ return function(screen, programs) } local function check_for_dock_hide(s) - if #s:get_clients() < 1 then + local naughty = require("naughty") + if #s.selected_tag:clients() < 1 then dock.visible = true return end if s == mouse.screen then - if mouse.current_widget then + --[[ if mouse.current_widget then if tostring(mouse.current_widget):match("fake") then dock.visible = true return end - end - for j, c in ipairs(screen.selected_tag:clients()) do + end ]] + local visible = false + for j, c in ipairs(s.selected_tag:clients()) do + + --naughty.notify({ title = tostring(c.class) }) + if c.maximized or c.fullscreen then + dock.visible = false + return + end local y = c:geometry().y local h = c.height - if (y + h) >= screen.geometry.height - user_vars.dock_icon_size - 35 then + if (y + h) >= s.geometry.height - user_vars.dock_icon_size - 35 then dock.visible = false return else dock.visible = true - return end + --[[ if visible then + dock.visible = visible + return + end ]] end else dock.visible = false end end + local dock_intelligent_hide = gears.timer { + timeout = 1, + autostart = true, + call_now = true, + callback = function() + check_for_dock_hide(screen) + end + } + + fakedock:connect_signal( + "mouse::enter", + function() + dock_intelligent_hide:stop() + dock.visible = true + end + ) + client.connect_signal( "manage", function() @@ -244,15 +272,6 @@ return function(screen, programs) end ) - local dock_intelligent_hide = gears.timer { - timeout = 1, - autostart = true, - call_now = true, - callback = function() - check_for_dock_hide(screen) - end - } - dock:connect_signal( "mouse::enter", function() diff --git a/awesome/mappings/global_keys.lua b/awesome/mappings/global_keys.lua index aadb56a..f2493ba 100644 --- a/awesome/mappings/global_keys.lua +++ b/awesome/mappings/global_keys.lua @@ -2,6 +2,7 @@ local gears = require("gears") local awful = require("awful") local hotkeys_popup = require("awful.hotkeys_popup") +local ruled = require("ruled") local modkey = user_vars.modkey @@ -309,5 +310,75 @@ return gears.table.join( awesome.emit_signal("kblayout::toggle") end, { description = "Toggle keyboard layout", group = "System" } + ), + awful.key( + { modkey }, + "#22", + function() + awful.spawn.easy_async_with_shell( + [[xprop | grep WM_CLASS | awk '{gsub(/"/, "", $4); print $4}']], + function(stdout) + if stdout then + ruled.client.append_rule { + rule = { class = stdout:gsub("\n", "") }, + properties = { + floating = true + }, + } + awful.spawn.easy_async_with_shell( + "cat ~/.config/awesome/src/assets/rules.txt", + function(stdout2) + for class in stdout2:gmatch("%a+") do + if class:match(stdout:gsub("\n", "")) then + return + end + end + awful.spawn.with_shell("echo -n '" .. stdout:gsub("\n", "") .. ";' >> ~/.config/awesome/src/assets/rules.txt") + local c = mouse.screen.selected_tag:clients() + for j, client in ipairs(c) do + if client.class:match(stdout:gsub("\n", "")) then + client.floating = true + end + end + end + ) + end + end + ) + end + ), + awful.key( + { modkey, "Shift" }, + "#22", + function() + awful.spawn.easy_async_with_shell( + [[xprop | grep WM_CLASS | awk '{gsub(/"/, "", $4); print $4}']], + function(stdout) + if stdout then + ruled.client.append_rule { + rule = { class = stdout:gsub("\n", "") }, + properties = { + floating = false + }, + } + awful.spawn.easy_async_with_shell( + [[ + REMOVE="]] .. stdout:gsub("\n", "") .. [[;" + STR=$(cat ~/.config/awesome/src/assets/rules.txt) + echo -n ${STR//$REMOVE/} > ~/.config/awesome/src/assets/rules.txt + ]], + function(stdout2) + local c = mouse.screen.selected_tag:clients() + for j, client in ipairs(c) do + if client.class:match(stdout:gsub("\n", "")) then + client.floating = false + end + end + end + ) + end + end + ) + end ) ) diff --git a/awesome/src/assets/rules.txt b/awesome/src/assets/rules.txt new file mode 100644 index 0000000..e69de29 diff --git a/awesome/src/assets/userpfp/crylia.png b/awesome/src/assets/userpfp/crylia.png index 44f69c6..671fbe2 100644 Binary files a/awesome/src/assets/userpfp/crylia.png and b/awesome/src/assets/userpfp/crylia.png differ diff --git a/awesome/src/core/rules.lua b/awesome/src/core/rules.lua index e8946c8..70a7546 100644 --- a/awesome/src/core/rules.lua +++ b/awesome/src/core/rules.lua @@ -5,6 +5,7 @@ -- Awesome Libs local awful = require("awful") local beautiful = require("beautiful") +local ruled = require("ruled") awful.rules.rules = { { @@ -48,3 +49,17 @@ awful.rules.rules = { properties = { titlebars_enabled = true } } } + +awful.spawn.easy_async_with_shell( + "cat ~/.config/awesome/src/assets/rules.txt", + function(stdout) + for class in stdout:gmatch("%a+") do + ruled.client.append_rule { + rule = { class = class }, + properties = { + floating = true + }, + } + end + end +) diff --git a/awesome/src/modules/titlebar.lua b/awesome/src/modules/titlebar.lua index 866584f..6f306b9 100644 --- a/awesome/src/modules/titlebar.lua +++ b/awesome/src/modules/titlebar.lua @@ -236,15 +236,11 @@ client.connect_signal( client.connect_signal( 'property::floating', function(c) - if c.floating and not c.maximized then - if c.class == "Steam" then - awful.titlebar.hide(c, 'left') - awful.titlebar.hide(c, 'right') - awful.titlebar.hide(c, 'top') - awful.titlebar.hide(c, 'bottom') - else - awful.titlebar.show(c, 'left') - end + if c.floating or (c.floating and c.maximized) then + awful.titlebar.show(c, 'left') + awful.titlebar.hide(c, 'right') + awful.titlebar.hide(c, 'top') + awful.titlebar.hide(c, 'bottom') else awful.titlebar.hide(c, 'left') awful.titlebar.hide(c, 'right') diff --git a/awesome/src/theme/user_variables.lua b/awesome/src/theme/user_variables.lua index bde266f..8c8e998 100644 --- a/awesome/src/theme/user_variables.lua +++ b/awesome/src/theme/user_variables.lua @@ -83,8 +83,8 @@ user_vars = { { "Thunderbird", "thunderbird", "Thunderbird" }, { "Mattermost", "mattermost-desktop", "Mattermost" }, { "Blender", "blender", "Blender" }, - { "Steam", "steam", "Steams" }, - { "FreeCAD", "freecad", "Freecad" }, + { "Steam", "steam", "Steam" }, + { "FreeCAD", "freecad", "FreeCAD" }, { "Nemo", "nemo", "Dateien" }, { "Paradox Launcher", "394360", "Hearts of Iron 4", true } } diff --git a/picom.conf b/picom.conf index b9ae9c4..746c857 100644 --- a/picom.conf +++ b/picom.conf @@ -151,6 +151,6 @@ show-all-xerrors = true; wintypes: { tooltip = { fade = true; focus = false; }; normal = { shadow = true; blur-background = false; }; - dock = { shadow = false; blur-background = false;}; + dock = { shadow = true; blur-background = false;}; desktop = { shadow = true; blur-background = false; }; };