From 7abb1cd7fa6e30d2b2fd847319536293f5ae5997 Mon Sep 17 00:00:00 2001 From: Yessiest Date: Fri, 3 Feb 2023 16:12:22 +0400 Subject: [PATCH] fixed client controls --- desktop.conf | 14 ++++++++------ widgets/clientmenu.lua | 12 ++++++++++++ widgets/clientmenu/controls.lua | 10 ++++------ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/desktop.conf b/desktop.conf index ae92575..97ab178 100644 --- a/desktop.conf +++ b/desktop.conf @@ -3,7 +3,7 @@ terminal = "$HOME/.local/bin/st" browser = "prime-run librewolf" modkey = "Mod4" -theme = "unity" +theme = "serenity" shell = "zsh" # Keybindings @@ -33,17 +33,19 @@ modkey+y = ":client.toggle_titlebars" # Widget keys modkey+r = ":dismal.run" modkey+s = ":help.show" +modkey+q = ":client.menu" Control+XF86AudioRaiseVolume = ":client.volume_up" Control+XF86AudioLowerVolume = ":client.volume_down" Control+XF86AudioMute = ":client.volume_mute" XF86AudioRaiseVolume = ":root.volume_up" XF86AudioLowerVolume = ":root.volume_down" XF86AudioMute = ":root.volume_mute" -XF86MonBrightnessUp = ":battery.brightness_up" -XF86MonBrightnessDown = ":battery.brightness_down" -XF86AudioPlay = ":mpc.play" -XF86AudioPrev = ":mpc.prev" -XF86AudioNext = ":mpc.next" +XF86MonBrightnessUp = ":battery.brightness_up" +XF86MonBrightnessDown = ":battery.brightness_down" +XF86AudioPlay = ":mpc.play" +XF86AudioPrev = ":mpc.prev" +XF86AudioNext = ":mpc.next" + # Custom keys Print = "flameshot gui" diff --git a/widgets/clientmenu.lua b/widgets/clientmenu.lua index e5c54da..2e53cd7 100644 --- a/widgets/clientmenu.lua +++ b/widgets/clientmenu.lua @@ -9,7 +9,9 @@ local awmtk2 = require("awmtk2") local wibox = require("wibox") local awful = require("awful") +local gears = require("gears") local builder = require("builder") +local ask = require("asckey") local style = awmtk2.create_style("client_menu", awmtk2.generic.composite_widget,{}) local templates = awmtk2.create_template_lib("client_menu",awmtk2.templates,{}) @@ -58,6 +60,16 @@ for _,layout in pairs(context_menu.widget:get_children_by_id("menu_root")) do end end end +root.keys(gears.table.join( + root.keys(), + ask.k(":client.menu",function() + context_menu.visible = (not context_menu.visible) + if context_menu.visible then + context_menu.x = client.focus.x + 10 + context_menu.y = client.focus.y + 10 + end + end,{description = "Open client menu", group = "client"}) +)) return function(args) local widget = wibox.widget({ diff --git a/widgets/clientmenu/controls.lua b/widgets/clientmenu/controls.lua index e58a133..9789dfa 100644 --- a/widgets/clientmenu/controls.lua +++ b/widgets/clientmenu/controls.lua @@ -7,10 +7,7 @@ -- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . -- Basic client control menu local awmtk2 = require("awmtk2") -local wibox = require("wibox") -local gears = require("gears") local awful = require("awful") -local beautiful = require("beautiful") local menugen = require("context_menu") return function(args) @@ -61,9 +58,10 @@ return function(args) end) local widget = menugen({ items = { - { "Kill client", function() client.focus:kill() end }, - { "Raise client", function() client.focus:raise() end}, - { "Lower client", function() client.focus:lower() end}, + { "Terminate client", function() client.focus:kill() end }, + { "Kill client", function() awful.spawn("kill -KILL "..tostring(client.focus.pid)) end }, + { "Toggle above", function() client.focus.above = (not client.focus.above) end}, + { "Toggle below", function() client.focus.below = (not client.focus.below) end}, { "Move to tag", move_to_tag }, { "Switch on tag", add_to_tag } },