From d5ee9f30c0d344e35c346fc3b4d3e215f6c15468 Mon Sep 17 00:00:00 2001 From: Daan Vanoverloop Date: Fri, 30 Aug 2019 11:46:28 +0200 Subject: [PATCH] Game mode --- .config/awesome/rc.lua | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 51c2938..b78b2c2 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -174,6 +174,10 @@ volumebox = wibox.widget.textbox() vicious.cache(vicious.widgets.volume) vicious.register(volumebox, vicious.widgets.volume, "  $1 ", 3, {"Master", "-D", "pulse"}) +backlightbox = wibox.widget.textbox() +vicious.cache(vicious.contrib.xbacklight) +vicious.register(backlightbox, vicious.contrib.xbacklight, "  $1 ", 3) + batwidget = wibox.widget.textbox() vicious.cache(vicious.widgets.bat) vicious.register(batwidget, vicious.widgets.bat, "  $2 ", 61, "BAT1") @@ -245,6 +249,7 @@ awful.screen.connect_for_each_screen(function(s) memwidget, cpuwidget, volumebox, + backlightbox, wifiwidget, batwidget, --wibox.widget.systray(), @@ -352,6 +357,29 @@ function rofi_kill () if rofi_pid then awful.spawn("kill "..rofi_pid) end end +local game_mode = false + +function game_mode_start () + if game_mode == true then return else game_mode = true end + awful.spawn("killall compton") + end_switcher() + for s in screen do + s.dock_trigger.visible = false + end +end + +function game_mode_stop () + if game_mode == false then return else game_mode = false end + awful.spawn.with_shell("~/.config/compton/launch.sh") + for s in screen do + s.dock_trigger.visible = true + end +end + +function game_mode_toggle () + if game_mode then game_mode_stop() else game_mode_start() end +end + globalbuttons = gears.table.join( awful.button({ }, 1, end_switcher) @@ -476,7 +504,7 @@ globalkeys = gears.table.join( end, {description = "lua execute prompt", group = "awesome"}), -- Menubar - awful.key({ modkey }, "p", function() menubar.show() end, + awful.key({ modkey }, "p", function() game_mode_toggle() end, {description = "show the menubar", group = "launcher"}), awful.key({ modkey }, "d", function() rofi_spawn("rofi -show run") end, {description = "launch rofi", group = "launcher"}),