This commit is contained in:
Benjamin Kyd
2023-04-30 22:55:37 +01:00
parent dda9cc4c65
commit 4eeebdaa15
9 changed files with 269 additions and 276 deletions

View File

@@ -1,9 +1,9 @@
[-] Fix keybindings
[ ] Vomume / play / pause
[x] Fix keybindings
[x] Vomume / play / pause
[x] Resize bindings
[x] hjkl in vim
[x] Printscreen
[?] Fix layouting
[ ] Fix the brightness popup
[ ] Use white icons in both popups
[x] Fix the brightness popup
[x] Use white icons in both popups
[x] Fix annoying fullscreen shit

View File

@@ -77,7 +77,7 @@ awesome.connect_signal("backlight_change",
function()
-- set new brightness value
awful.spawn.easy_async_with_shell(
"cat /sys/class/backlight/nv_backlight/actual_brightness",
"cat /sys/class/backlight/intel_backlight/brightness",
function(stdout)
local backlight_level = tonumber(stdout)
backlight_bar.value = backlight_level

View File

@@ -1,5 +1,6 @@
local gears = require("gears")
local awful = require("awful")
local bling = require("plugins.bling")
local keys = Ben.keys
local programs = Ben.programs
@@ -18,6 +19,10 @@ awful.keyboard.append_global_keybindings({
awesome.spawn(programs.launcher)
end),
awful.key({ keys.mod }, "t", function()
bling.module.tabbed.pick()
end),
awful.key({ keys.mod }, "b", function()
awesome.spawn(programs.browser)
end),
@@ -26,347 +31,332 @@ awful.keyboard.append_global_keybindings({
awesome.spawn(programs.filemanager)
end),
--[[awful.key({ keys.mod }, "m", function()]]
--[[local rofi_beats = os.getenv("HOME") .. "/.local/bin/scripts/rofi-beats.sh"]]
--[[awesome.spawn(rofi_beats)]]
--[[end),]]
--[[ window management ]] --
awful.key({ keys.mod }, "h", function()
awful.client.focus.global_bydirection("left")
end),
--[[ window management ]] --
awful.key({ keys.mod }, "h", function()
awful.client.focus.global_bydirection("left")
end),
awful.key({ keys.mod }, "j", function()
awful.client.focus.global_bydirection("down")
end),
awful.key({ keys.mod }, "j", function()
awful.client.focus.global_bydirection("down")
end),
awful.key({ keys.mod }, "k", function()
awful.client.focus.global_bydirection("up")
end),
awful.key({ keys.mod }, "k", function()
awful.client.focus.global_bydirection("up")
end),
awful.key({ keys.mod }, "l", function()
awful.client.focus.global_bydirection("right")
end),
awful.key({ keys.mod }, "l", function()
awful.client.focus.global_bydirection("right")
end),
awful.key({ keys.mod, keys.ctrl }, "h", function()
awful.client.swap.global_bydirection("left")
end),
awful.key({ keys.mod, keys.ctrl }, "h", function()
awful.client.swap.global_bydirection("left")
end),
awful.key({ keys.mod, keys.ctrl }, "j", function()
awful.client.swap.global_bydirection("down")
end),
awful.key({ keys.mod, keys.ctrl }, "j", function()
awful.client.swap.global_bydirection("down")
end),
awful.key({ keys.mod, keys.ctrl }, "k", function()
awful.client.swap.global_bydirection("up")
end),
awful.key({ keys.mod, keys.ctrl }, "k", function()
awful.client.swap.global_bydirection("up")
end),
awful.key({ keys.mod, keys.ctrl }, "l", function()
awful.client.swap.global_bydirection("right")
end),
awful.key({ keys.mod, keys.ctrl }, "l", function()
awful.client.swap.global_bydirection("right")
end),
awful.key({ keys.mod, keys.shift }, "h", function()
awful.tag.incmwfact(-0.05)
end),
awful.key({ keys.mod, keys.shift }, "h", function()
awful.tag.incmwfact(-0.05)
end),
awful.key({ keys.mod, keys.shift }, "l", function()
awful.tag.incmwfact(0.05)
end),
awful.key({ keys.mod, keys.shift }, "l", function()
awful.tag.incmwfact(0.05)
end),
awful.key({ keys.mod, keys.shift }, "j", function()
awful.client.incwfact(0.05)
end),
awful.key({ keys.mod, keys.shift }, "j", function()
awful.client.incwfact(0.05)
end),
awful.key({ keys.mod, keys.shift }, "k", function()
awful.client.incwfact(-0.05)
end),
awful.key({ keys.mod, keys.shift }, "k", function()
awful.client.incwfact(-0.05)
end),
awful.key({ keys.mod }, "u", function()
awful.client.urgent.jumpto()
end),
awful.key({ keys.mod }, "u", function()
awful.client.urgent.jumpto()
end),
--[[ Switching between tags ]] --
--[[ Switching between tags ]] --
awful.key({ keys.mod }, "#10", function()
local tag = awful.screen.focused().tags[1]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#10", function()
local tag = awful.screen.focused().tags[1]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#11", function()
local tag = awful.screen.focused().tags[2]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#11", function()
local tag = awful.screen.focused().tags[2]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#12", function()
local tag = awful.screen.focused().tags[3]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#12", function()
local tag = awful.screen.focused().tags[3]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#13", function()
local tag = awful.screen.focused().tags[4]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#13", function()
local tag = awful.screen.focused().tags[4]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#14", function()
local tag = awful.screen.focused().tags[5]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#14", function()
local tag = awful.screen.focused().tags[5]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#15", function()
local tag = awful.screen.focused().tags[6]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#15", function()
local tag = awful.screen.focused().tags[6]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#16", function()
local tag = awful.screen.focused().tags[7]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#16", function()
local tag = awful.screen.focused().tags[7]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#17", function()
local tag = awful.screen.focused().tags[8]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#17", function()
local tag = awful.screen.focused().tags[8]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#18", function()
local tag = awful.screen.focused().tags[9]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#18", function()
local tag = awful.screen.focused().tags[9]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#19", function()
local tag = awful.screen.focused().tags[10]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod }, "#19", function()
local tag = awful.screen.focused().tags[10]
if tag then
tag:view_only()
end
end),
awful.key({ keys.mod, keys.shift }, "#10", function()
if not client.focus then
return
end
awful.key({ keys.mod, keys.shift }, "#10", function()
if not client.focus then
return
end
local tag = client.focus.screen.tags[1]
if tag then
client.focus:move_to_tag(tag)
end
end),
local tag = client.focus.screen.tags[1]
if tag then
client.focus:move_to_tag(tag)
end
end),
awful.key({ keys.mod, keys.shift }, "#11", function()
if not client.focus then
return
end
awful.key({ keys.mod, keys.shift }, "#11", function()
if not client.focus then
return
end
local tag = client.focus.screen.tags[2]
if tag then
client.focus:move_to_tag(tag)
end
end),
local tag = client.focus.screen.tags[2]
if tag then
client.focus:move_to_tag(tag)
end
end),
awful.key({ keys.mod, keys.shift }, "#12", function()
if not client.focus then
return
end
awful.key({ keys.mod, keys.shift }, "#12", function()
if not client.focus then
return
end
local tag = client.focus.screen.tags[3]
if tag then
client.focus:move_to_tag(tag)
end
end),
local tag = client.focus.screen.tags[3]
if tag then
client.focus:move_to_tag(tag)
end
end),
awful.key({ keys.mod, keys.shift }, "#13", function()
if not client.focus then
return
end
awful.key({ keys.mod, keys.shift }, "#13", function()
if not client.focus then
return
end
local tag = client.focus.screen.tags[4]
if tag then
client.focus:move_to_tag(tag)
end
end),
local tag = client.focus.screen.tags[4]
if tag then
client.focus:move_to_tag(tag)
end
end),
awful.key({ keys.mod, keys.shift }, "#14", function()
if not client.focus then
return
end
awful.key({ keys.mod, keys.shift }, "#14", function()
if not client.focus then
return
end
local tag = client.focus.screen.tags[5]
if tag then
client.focus:move_to_tag(tag)
end
end),
local tag = client.focus.screen.tags[5]
if tag then
client.focus:move_to_tag(tag)
end
end),
awful.key({ keys.mod, keys.shift }, "#15", function()
if not client.focus then
return
end
awful.key({ keys.mod, keys.shift }, "#15", function()
if not client.focus then
return
end
local tag = client.focus.screen.tags[6]
if tag then
client.focus:move_to_tag(tag)
end
end),
local tag = client.focus.screen.tags[6]
if tag then
client.focus:move_to_tag(tag)
end
end),
awful.key({ keys.mod, keys.shift }, "#16", function()
if not client.focus then
return
end
awful.key({ keys.mod, keys.shift }, "#16", function()
if not client.focus then
return
end
local tag = client.focus.screen.tags[7]
if tag then
client.focus:move_to_tag(tag)
end
end),
local tag = client.focus.screen.tags[7]
if tag then
client.focus:move_to_tag(tag)
end
end),
awful.key({ keys.mod, keys.shift }, "#17", function()
if not client.focus then
return
end
awful.key({ keys.mod, keys.shift }, "#17", function()
if not client.focus then
return
end
local tag = client.focus.screen.tags[8]
if tag then
client.focus:move_to_tag(tag)
end
end),
local tag = client.focus.screen.tags[8]
if tag then
client.focus:move_to_tag(tag)
end
end),
awful.key({ keys.mod, keys.shift }, "#18", function()
if not client.focus then
return
end
awful.key({ keys.mod, keys.shift }, "#18", function()
if not client.focus then
return
end
local tag = client.focus.screen.tags[9]
if tag then
client.focus:move_to_tag(tag)
end
end),
local tag = client.focus.screen.tags[9]
if tag then
client.focus:move_to_tag(tag)
end
end),
awful.key({ keys.mod, keys.shift }, "#19", function()
if not client.focus then
return
end
awful.key({ keys.mod, keys.shift }, "#19", function()
if not client.focus then
return
end
local tag = client.focus.screen.tags[10]
if tag then
client.focus:move_to_tag(tag)
end
end),
awful.key({}, "XF86MonBrightnessUp",
local tag = client.focus.screen.tags[10]
if tag then
client.focus:move_to_tag(tag)
end
end),
awful.key({}, "XF86MonBrightnessUp",
function()
awful.spawn("xbacklight -inc 10", false)
awesome.emit_signal("backlight_change")
end
-- {description = "brightness up", group = "hotkeys"}
),
awful.key({}, "XF86MonBrightnessDown",
-- {description = "brightness up", group = "hotkeys"}
),
awful.key({}, "XF86MonBrightnessDown",
function()
awful.spawn("xbacklight -dec 10", false)
awesome.emit_signal("backlight_change")
end
--{description = "brightness down", group = "hotkeys"}
),
-- ALSA volume control
awful.key({}, "XF86AudioRaiseVolume",
--{description = "brightness down", group = "hotkeys"}
),
-- ALSA volume control
awful.key({}, "XF86AudioRaiseVolume",
function()
awful.spawn("amixer -D pulse sset Master 5%+", false)
awesome.emit_signal("volume_change")
end
--{description = "volume up", group = "hotkeys"}
),
awful.key({}, "XF86AudioLowerVolume",
--{description = "volume up", group = "hotkeys"}
),
awful.key({}, "XF86AudioLowerVolume",
function()
awful.spawn("amixer -D pulse sset Master 5%-", false)
awesome.emit_signal("volume_change")
end
--{description = "volume down", group = "hotkeys"}
),
awful.key({}, "XF86AudioMute",
--{description = "volume down", group = "hotkeys"}
),
awful.key({}, "XF86AudioMute",
function()
awful.spawn("amixer -D pulse set Master 1+ toggle", false)
awesome.emit_signal("volume_change")
end
--{description = "toggle mute", group = "hotkeys"}
),
awful.key({}, "XF86AudioNext",
function()
awful.spawn("mpc next", false)
end
--{description = "next music", group = "hotkeys"}
),
awful.key({}, "XF86AudioPrev",
function()
awful.spawn("mpc prev", false)
end
--{description = "previous music", group = "hotkeys"}
),
awful.key({}, "XF86AudioPlay",
function()
awful.spawn("mpc toggle", false)
end
--{description = "play/pause music", group = "hotkeys"}
),
awful.key({}, "Print",
--{description = "toggle mute", group = "hotkeys"}
),
awful.key({}, "XF86AudioPlay",
function() awful.spawn("playerctl play-pause") end,
{ description = "toggle playerctl", group = "awesome" }),
awful.key({}, "XF86AudioPrev",
function() awful.spawn("playerctl previous") end,
{ description = "playerctl previous", group = "awesome" }),
awful.key({}, "XF86AudioNext", function() awful.spawn("playerctl next") end,
{ description = "playerctl next", group = "awesome" }),
awful.key({}, "Print",
function()
awful.spawn("flameshot gui", false)
end
),
),
})
client.connect_signal("request::default_keybindings", function()
awful.keyboard.append_client_keybindings({
awful.key({ keys.mod, keys.shift }, "q", function(c)
c:kill()
end),
awful.key({ keys.mod }, keys.space, function(c)
c.floating = not c.floating
c:raise()
end),
awful.key({ keys.mod }, "f", function(c)
c.fullscreen = not c.fullscreen
c:raise()
end),
})
end)
client.connect_signal("request::default_mousebindings", function()
awful.mouse.append_client_mousebindings({
awful.button({}, 1, function(c)
c:activate({ context = "mouse_click" })
end),
client.connect_signal("request::default_keybindings", function()
awful.keyboard.append_client_keybindings({
awful.key({ keys.mod, keys.shift }, "q", function(c)
c:kill()
end),
awful.button({ keys.mod }, 1, function(c)
c:activate({
context = "mouse_click",
action = "mouse_move",
})
end),
awful.key({ keys.mod }, keys.space, function(c)
c.floating = not c.floating
c:raise()
end),
awful.button({ keys.mod }, 3, function(c)
c:activate({
context = "mouse_click",
action = "mouse_resize",
})
end),
})
end)
awful.key({ keys.mod }, "f", function(c)
c.fullscreen = not c.fullscreen
c:raise()
end),
})
end)
client.connect_signal("request::default_mousebindings", function()
awful.mouse.append_client_mousebindings({
awful.button({}, 1, function(c)
c:activate({ context = "mouse_click" })
end),
awful.button({ keys.mod }, 1, function(c)
c:activate({
context = "mouse_click",
action = "mouse_move",
})
end),
awful.button({ keys.mod }, 3, function(c)
c:activate({
context = "mouse_click",
action = "mouse_resize",
})
end),
})
end)
-- vim: filetype=lua:expandtab:shiftwidth=2:tabstop=2:softtabstop=2:textwidth=80
-- vim: filetype=lua:expandtab:shiftwidth=2:tabstop=2:softtabstop=2:textwidth=80

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -43,6 +43,9 @@ require("ben.autostart")
require("ben.volume")
require("ben.backlight")
-- bling
local bling = require("plugins.bling")
-- fancy titlebars
local nice = require("plugins.nice")
nice({