Skip to content

Commit

Permalink
bulk fixes too lazy to go through them
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintRyoh committed Nov 11, 2023
1 parent 10dcc3c commit 8380d9a
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 20 deletions.
34 changes: 17 additions & 17 deletions rabbithole/components/keys/global.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ return setmetatable({}, {
local modkey = settings.keys.modkey or "Mod4"
local altkey = settings.keys.altkey or "Mod1"
local mainmenu = rabbithole__components__menus__main
local terminal = settings.default_programs.terminal
local launcher = settings.default_programs.launcher_cmd
local window_switcher = settings.default_programs.window_switcher_cmd
local terminal = settings.drivers.terminal
local launcher = settings.drivers.launcher_cmd
local window_switcher = settings.drivers.window_switcher_cmd
local globalkeys = gears.table.join(

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Expand Down Expand Up @@ -106,10 +106,10 @@ return setmetatable({}, {
-- { description = "increase the number of columns", group = "layout" }),
--awful.key({ modkey, "Control" }, "l", function() awful.tag.incncol(-1, nil, true) end,
-- { description = "decrease the number of columns", group = "layout" }),
--awful.key({ modkey, }, "space", function() awful.layout.inc(1) end,
-- { description = "select next", group = "layout" }),
--awful.key({ modkey, "Shift" }, "space", function() awful.layout.inc(-1) end,
-- { description = "select previous", group = "layout" }),
awful.key({ modkey, }, "space", function() awful.layout.inc(1) end,
{ description = "select next", group = "layout" }),
awful.key({ modkey, "Shift" }, "space", function() awful.layout.inc(-1) end,
{ description = "select previous", group = "layout" }),

awful.key({ modkey, "Control" }, "n",
function()
Expand All @@ -126,7 +126,7 @@ return setmetatable({}, {
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- Applications
awful.key({ modkey }, "r",
function() os.execute(launcher) end,
function() awful.spawn(launcher) end,
{ description = "run rofi", group = "Applications" }),
-- press mod4 to open rofi window switcher
awful.key({ modkey }, "Tab",
Expand Down Expand Up @@ -177,35 +177,35 @@ return setmetatable({}, {

-- Brightness Keys
awful.key({ }, "XF86MonBrightnessUp",
function() awful.spawn(settings.default_programs.brightness_up) end,
function() awful.spawn(settings.drivers.brightness_up) end,
{ description = "increase brightness", group = "hotkeys" }),
awful.key({}, "XF86MonBrightnessDown",
function() awful.spawn(settings.default_programs.brightness_down) end,
function() awful.spawn(settings.drivers.brightness_down) end,
{ description = "decrease brightness", group = "hotkeys" }),
awful.key({}, "XF86Display",
function() awful.spawn(settings.default_programs.screen_config) end,
function() awful.spawn(settings.drivers.screen_config) end,
{ description = "Open Screen Configuration", group = "hotkeys" }),

-- Volume Keys
awful.key({ }, "XF86AudioRaiseVolume",
function() awful.spawn(settings.default_programs.volume_up) end,
function() awful.spawn(settings.drivers.volume_up) end,
{ description = "increase volume", group = "hotkeys" }),
awful.key({}, "XF86AudioLowerVolume",
function() awful.spawn(settings.default_programs.volume_down) end,
function() awful.spawn(settings.drivers.volume_down) end,
{ description = "decrease volume", group = "hotkeys" }),
awful.key({}, "XF86AudioMute",
function() awful.spawn(settings.default_programs.volume_mute_toggle) end,
function() awful.spawn(settings.drivers.volume_mute_toggle) end,
{ description = "volume toggle", group = "hotkeys" }),
awful.key({}, "XF86AudioMicMute",
function() awful.spawn(settings.default_programs.mic_mute_toggle) end,
function() awful.spawn(settings.drivers.mic_mute_toggle) end,
{ description = "mic toggle", group = "hotkeys" }),

-- Screenshot Tool
awful.key({ }, "Print", function() awful.spawn(settings.default_programs.screenshot_tool) end,
awful.key({ }, "Print", function() awful.spawn(settings.drivers.screenshot_tool) end,
{ description = "Screenshot Tool", group = "hotkeys" }),

-- Wifi antenna Toggle comment out if nm-applet is used
-- awful.key({ }, "XF86WLAN", function() awful.with_shell(settings.default_programs.wifi_radio_toggle) end,
-- awful.key({ }, "XF86WLAN", function() awful.with_shell(settings.drivers.wifi_radio_toggle) end,
-- { description = "Convert OCR image to text and copy to clipboard", group = "hotkeys" }),

-- Keybinding to toggle titlebar visibility
Expand Down
15 changes: 15 additions & 0 deletions rabbithole/services/drivers/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
local DriverStrategyFactory = {}
DriverStrategyFactory.__index = DriverStrategyFactory

function DriverStrategyFactory.new(settings)
local self = setmetatable({}, DriverStrategyFactory)
self.settings = settings.drivers

return self
end

function DriverStrategyFactory:volume_up()
return require("rabbithole.components.keys.drivers.volume_up." .. self.settings.volume_up.driver.name)(self.settings.volume_up.driver.opts)
end

return DriverStrategyFactory
5 changes: 5 additions & 0 deletions rabbithole/services/drivers/volume_up/amixer.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
local awful = require("awful")

return function(opts)
awful.spawn("amixer -D pulse sset Master 5%+")
end
5 changes: 5 additions & 0 deletions rabbithole/services/drivers/volume_up/pactl.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
local awful = require("awful")

return function(opts)
awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ +5%")
end
3 changes: 2 additions & 1 deletion rabbithole/services/theme-loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local naughty = require("naughty")
local nice = require("sub.nice")
local dpi = require("beautiful.xresources").apply_dpi
local config_dir = require("gears.filesystem").get_configuration_dir()
local awful = require("awful")

return setmetatable({}, {
__constructor = function (
Expand Down Expand Up @@ -57,7 +58,7 @@ return setmetatable({}, {
else
naughty.notify({title = "Error", text = "Failed to initialize theme. Reverting back to default."})
end

awful.spawn.with_shell("xsetroot -cursor_name left_ptr")
return beautiful.get()
end,
})
Expand Down
4 changes: 2 additions & 2 deletions rabbithole/ui/default/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function UserInterface.new(
rabbithole__ui__default__center(s)

-- create dropdown terminal box for each screen
s.dropdown = dropdown({app=settings.default_programs.terminal, argname="--title %s", extra="--class Dropdown -e tmux", visible=true, height=0.9, screen = s })
s.dropdown = dropdown({app=settings.drivers.terminal, argname="--title %s", extra="--class Dropdown -e tmux", visible=true, height=0.9, screen = s })

-- set scrreen dpi
beautiful.xresources.set_dpi(dpi, s)
Expand All @@ -45,4 +45,4 @@ function UserInterface.new(
end)
end

return UserInterface
return UserInterface

0 comments on commit 8380d9a

Please sign in to comment.