diff --git a/.config/awesome/awesome-wm-widgets/gamemode-widget/gamemode.lua b/.config/awesome/awesome-wm-widgets/gamemode-widget/gamemode.lua new file mode 100644 index 0000000..78b48cf --- /dev/null +++ b/.config/awesome/awesome-wm-widgets/gamemode-widget/gamemode.lua @@ -0,0 +1,72 @@ +------------------------------------------------- +-- game mode button for Awesome Window Manager +-- changes x resolution + +-- @author josiah ledbetter +-- @copyright do whatever the fuck you want +------------------------------------------------- + +local wibox = require("wibox") +local watch = require("awful.widget.watch") +local awful = require("awful") +local beautiful = require("beautiful") +local naughty = require("naughty") +local gears = require("gears") + + +local XRANDR_GAME_RESOLUTION_COMMAND = "xrandr --output HDMI-0 --mode 1920x1080 --pos 0x0 --rotate normal --primary --output DP-2 --mode 1920x1080 --right-of HDMI-0 --rotate left --output DP-4 --mode 1920x1080 --left-of HDMI-0 --rotate right --output DP-0 --off" + +local XRANDR_NORMAL_RESOLUTION_COMMAND = "xrandr --output HDMI-0 --mode 2560x1440 --pos 0x0 --rotate normal --primary --output DP-2 --mode 1920x1080 --right-of HDMI-0 --rotate left --output DP-4 --mode 1920x1080 --left-of HDMI-0 --rotate right --output DP-0 --off" + +local iconpath = "/home/josiah/.config/awesome/gamemode.png" + +local toggle = 0 + +local demoMode_widget = wibox.widget { + wibox.widget { + image = beautiful.gamemode_icon or iconpath, + resize = true, + widget = wibox.widget.imagebox + }, + widget = wibox.container.background +} + +watch(XSCREENSAVER_DEACTIVATE_COMMAND, XSCREENSAVER_TIMER, demoMode_widget) + +function activate_game_mode() + gears.timer { + timeout = XSCREENSAVER_TIMER, + autostart = true, + callback = function() + awful.util.spawn_with_shell(XRANDR_GAME_RESOLUTION_COMMAND) + --naughty.notify{ + --title= "Notification status", + --text = tostring(not naughty.is_suspended()), + --ignore_suspend = true, + --} + end, + single_shot = false, +} +end + +demoMode_widget:buttons(awful.util.table.join( + awful.button({ }, 1, function () + if toggle == 0 then + activate_game_mode() + toggle = 1 + demoMode_widget.bg = beautiful.fg_urgent + else + demoMode_widget.bg = beautiful.bg_normal + awesome.restart() + toggle = 0 + end + --naughty.notify{ + --title= "Notification status", + --text = tostring(not naughty.is_suspended()), + --ignore_suspend = true, + --} + end) + )) + + +return demoMode_widget diff --git a/.config/awesome/gamemode.png b/.config/awesome/gamemode.png new file mode 100644 index 0000000..84cc95f Binary files /dev/null and b/.config/awesome/gamemode.png differ diff --git a/.config/awesome/weeb-shit-2.jpg b/.config/awesome/weeb-shit-2.jpg new file mode 100644 index 0000000..424bfe5 Binary files /dev/null and b/.config/awesome/weeb-shit-2.jpg differ