fixed client controls

This commit is contained in:
Yessiest 2023-02-03 16:12:22 +04:00
parent f83e5b8f1d
commit 7abb1cd7fa
3 changed files with 24 additions and 12 deletions

View File

@ -3,7 +3,7 @@
terminal = "$HOME/.local/bin/st" terminal = "$HOME/.local/bin/st"
browser = "prime-run librewolf" browser = "prime-run librewolf"
modkey = "Mod4" modkey = "Mod4"
theme = "unity" theme = "serenity"
shell = "zsh" shell = "zsh"
# Keybindings # Keybindings
@ -33,17 +33,19 @@ modkey+y = ":client.toggle_titlebars"
# Widget keys # Widget keys
modkey+r = ":dismal.run" modkey+r = ":dismal.run"
modkey+s = ":help.show" modkey+s = ":help.show"
modkey+q = ":client.menu"
Control+XF86AudioRaiseVolume = ":client.volume_up" Control+XF86AudioRaiseVolume = ":client.volume_up"
Control+XF86AudioLowerVolume = ":client.volume_down" Control+XF86AudioLowerVolume = ":client.volume_down"
Control+XF86AudioMute = ":client.volume_mute" Control+XF86AudioMute = ":client.volume_mute"
XF86AudioRaiseVolume = ":root.volume_up" XF86AudioRaiseVolume = ":root.volume_up"
XF86AudioLowerVolume = ":root.volume_down" XF86AudioLowerVolume = ":root.volume_down"
XF86AudioMute = ":root.volume_mute" XF86AudioMute = ":root.volume_mute"
XF86MonBrightnessUp = ":battery.brightness_up" XF86MonBrightnessUp = ":battery.brightness_up"
XF86MonBrightnessDown = ":battery.brightness_down" XF86MonBrightnessDown = ":battery.brightness_down"
XF86AudioPlay = ":mpc.play" XF86AudioPlay = ":mpc.play"
XF86AudioPrev = ":mpc.prev" XF86AudioPrev = ":mpc.prev"
XF86AudioNext = ":mpc.next" XF86AudioNext = ":mpc.next"
# Custom keys # Custom keys
Print = "flameshot gui" Print = "flameshot gui"

View File

@ -9,7 +9,9 @@
local awmtk2 = require("awmtk2") local awmtk2 = require("awmtk2")
local wibox = require("wibox") local wibox = require("wibox")
local awful = require("awful") local awful = require("awful")
local gears = require("gears")
local builder = require("builder") local builder = require("builder")
local ask = require("asckey")
local style = awmtk2.create_style("client_menu", local style = awmtk2.create_style("client_menu",
awmtk2.generic.composite_widget,{}) awmtk2.generic.composite_widget,{})
local templates = awmtk2.create_template_lib("client_menu",awmtk2.templates,{}) 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 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) return function(args)
local widget = wibox.widget({ local widget = wibox.widget({

View File

@ -7,10 +7,7 @@
-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see <https://www.gnu.org/licenses/>. -- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see <https://www.gnu.org/licenses/>.
-- Basic client control menu -- Basic client control menu
local awmtk2 = require("awmtk2") local awmtk2 = require("awmtk2")
local wibox = require("wibox")
local gears = require("gears")
local awful = require("awful") local awful = require("awful")
local beautiful = require("beautiful")
local menugen = require("context_menu") local menugen = require("context_menu")
return function(args) return function(args)
@ -61,9 +58,10 @@ return function(args)
end) end)
local widget = menugen({ local widget = menugen({
items = { items = {
{ "Kill client", function() client.focus:kill() end }, { "Terminate client", function() client.focus:kill() end },
{ "Raise client", function() client.focus:raise() end}, { "Kill client", function() awful.spawn("kill -KILL "..tostring(client.focus.pid)) end },
{ "Lower client", function() client.focus:lower() 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 }, { "Move to tag", move_to_tag },
{ "Switch on tag", add_to_tag } { "Switch on tag", add_to_tag }
}, },