Lot's of awesome changes and some added scripts
This commit is contained in:
parent
ed91c15381
commit
d36ce8b8b9
23 changed files with 303 additions and 374 deletions
23
awesome/globalkeys.fnl
Normal file
23
awesome/globalkeys.fnl
Normal file
|
@ -0,0 +1,23 @@
|
|||
(local awful (require "awful"))
|
||||
(local gears (require "gears"))
|
||||
(local beautiful (require "beautiful"))
|
||||
(local hotkeys_popup (require "awful.hotkeys_popup"))
|
||||
|
||||
(var mod "Mod4")
|
||||
(var shift "Shift")
|
||||
(var ctrl "Control")
|
||||
(var alt "Mod1'")
|
||||
|
||||
(global globalkeys (gears.table.join
|
||||
(awful.key [mod alt] "m" (awful.spawn "mpv --player-operation-mode=pseudo-gui")
|
||||
{ :description "launch mpv" :group "apps" })
|
||||
(awful.key [mod] "s" hotkeys_popup.show_help
|
||||
{ :description "show help" :group "awesome" })))
|
||||
|
||||
globalkeys
|
||||
|
||||
|
||||
|
||||
;; -- mpv
|
||||
;; awful.key({ modkey, altkey }, "m", function () awful.spawn("mpv --player-operation-mode=pseudo-gui") end,
|
||||
;; {description = "open mpv", group = "apps"}),
|
|
@ -4,13 +4,13 @@
|
|||
(local ruled (require "ruled"))
|
||||
(local rules (require "rules"))
|
||||
(local beautiful (require "beautiful"))
|
||||
(local keys (require "keys"))
|
||||
(local wibox (require "wibox"))
|
||||
(local xresources (require "beautiful.xresources"))
|
||||
;; (local naughty (require "naughty"))
|
||||
(local menubar (require "menubar"))
|
||||
(local hotkeys_popup (require "awful.hotkeys_popup"))
|
||||
(local dpi xresources.apply_dpi)
|
||||
(local globalkeys (require "globalkeys"))
|
||||
|
||||
;;; rules
|
||||
(set awful.rules.rules rules)
|
||||
|
@ -176,9 +176,7 @@
|
|||
;; })
|
||||
;; ))
|
||||
|
||||
|
||||
|
||||
|
||||
(root.keys globalkeys)
|
||||
|
||||
;;; autostart applications
|
||||
(awful.spawn.with_shell "picom --experimental-backend")
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
(local awful (require "awful"))
|
||||
(local gears (require "gears"))
|
||||
(local beautiful (require "beautiful"))
|
||||
(local hotkeys_popup (require "awful.hotkeys_popup"))
|
||||
|
||||
(var modkey "Mod4")
|
||||
(var alt "Mod1")
|
||||
(var shift "Shift")
|
||||
(var ctrl "Control")
|
||||
|
||||
(local globalkeys (awful.keyboard.append_global_keybindings [
|
||||
(awful.key [ modkey alt ] "m" (awful.spawn "mpv --player-operation-mode=pseudo-gui")
|
||||
{ :description "launch mpv" :group "apps" })
|
||||
(awful.key [ modkey ] "s" hotkeys_popup.show_help
|
||||
{ :description "show help" :group "awesome" })
|
||||
]))
|
||||
|
||||
globalkeys
|
||||
|
||||
|
||||
|
||||
;; -- mpv
|
||||
;; awful.key({ modkey, altkey }, "m", function () awful.spawn("mpv --player-operation-mode=pseudo-gui") end,
|
||||
;; {description = "open mpv", group = "apps"}),
|
256
awesome/keys.lua
256
awesome/keys.lua
|
@ -1,256 +0,0 @@
|
|||
local awful = require('awful')
|
||||
local gears = require('gears')
|
||||
|
||||
require('awful.autofocus')
|
||||
|
||||
local modkey = "Mod4"
|
||||
local altkey = "Mod1"
|
||||
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
|
||||
local clientKeys =
|
||||
awful.util.table.join(
|
||||
|
||||
-- toggle fullscreen
|
||||
awful.key(
|
||||
{modkey},
|
||||
'f',
|
||||
function(c)
|
||||
-- Toggle fullscreen
|
||||
c.fullscreen = not c.fullscreen
|
||||
c:raise()
|
||||
end,
|
||||
{description = 'toggle fullscreen', group = 'client'}
|
||||
),
|
||||
|
||||
-- close client
|
||||
awful.key(
|
||||
{modkey},
|
||||
'c',
|
||||
function(c)
|
||||
c:kill()
|
||||
end,
|
||||
{description = 'close', group = 'client'}
|
||||
),
|
||||
-- Default client focus
|
||||
awful.key(
|
||||
{modkey},
|
||||
'd',
|
||||
function()
|
||||
awful.client.focus.byidx(1)
|
||||
end,
|
||||
{description = 'focus next by index', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey},
|
||||
'a',
|
||||
function()
|
||||
awful.client.focus.byidx(-1)
|
||||
end,
|
||||
{description = 'focus previous by index', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"d",
|
||||
function ()
|
||||
awful.client.swap.byidx(1)
|
||||
end,
|
||||
{description = "swap with next client by index", group = "client"}
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"a",
|
||||
function ()
|
||||
awful.client.swap.byidx(-1)
|
||||
end,
|
||||
{description = "swap with next client by index", group = "client"}
|
||||
),
|
||||
|
||||
awful.key(
|
||||
{modkey},
|
||||
'u',
|
||||
awful.client.urgent.jumpto,
|
||||
{description = 'jump to urgent client', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey},
|
||||
'Tab',
|
||||
function()
|
||||
awful.client.focus.history.previous()
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end,
|
||||
{description = 'go back', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey},
|
||||
'n',
|
||||
function(c)
|
||||
c.minimized = true
|
||||
end,
|
||||
{description = "minimize client", group = 'client'}
|
||||
),
|
||||
-- move floating client to center
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"c",
|
||||
function(c)
|
||||
local focused = awful.screen.focused()
|
||||
|
||||
awful.placement.centered(c, {
|
||||
honor_workarea = true
|
||||
})
|
||||
end,
|
||||
{description = 'align a client to the center of the focused screen.', group = "client"}
|
||||
),
|
||||
|
||||
-- toggle client floating mode
|
||||
awful.key(
|
||||
{modkey},
|
||||
'c',
|
||||
function(c)
|
||||
c.fullscreen = false
|
||||
c.maximized = false
|
||||
c.floating = not c.floating
|
||||
c:raise()
|
||||
end,
|
||||
{description = 'toggle floating', group = 'client'}
|
||||
),
|
||||
|
||||
-- move client position
|
||||
awful.key(
|
||||
{modkey},
|
||||
'Up',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(0, dpi(-10), 0, 0)
|
||||
end
|
||||
end,
|
||||
{description = 'move floating client up by 10 px', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey},
|
||||
'Down',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(0, dpi(10), 0, 0)
|
||||
end
|
||||
end,
|
||||
{description = 'move floating client down by 10 px', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey},
|
||||
'Left',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(dpi(-10), 0, 0, 0)
|
||||
end
|
||||
end,
|
||||
{description = 'move floating client to the left by 10 px', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey},
|
||||
'Right',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(dpi(10), 0, 0, 0)
|
||||
end
|
||||
end,
|
||||
{description = 'move floating client to the right by 10 px', group = 'client'}
|
||||
),
|
||||
|
||||
-- Increasing floating client size
|
||||
awful.key(
|
||||
{modkey, 'Shift'},
|
||||
'Up',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(0, dpi(-10), 0, dpi(10))
|
||||
end
|
||||
end,
|
||||
{description = 'increase floating client size vertically by 10 px up', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey, 'Shift'},
|
||||
'Down',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(0, 0, 0, dpi(10))
|
||||
end
|
||||
end,
|
||||
{description = 'increase floating client size vertically by 10 px down', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey, 'Shift'},
|
||||
'Left',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(dpi(-10), 0, dpi(10), 0)
|
||||
end
|
||||
end,
|
||||
{description = 'increase floating client size horizontally by 10 px left', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey, 'Shift'},
|
||||
'Right',
|
||||
function(c)
|
||||
if c.floating then
|
||||
c:relative_move(0, 0, dpi(10), 0)
|
||||
end
|
||||
end,
|
||||
{description = 'increase floating client size horizontally by 10 px right', group = 'client'}
|
||||
),
|
||||
|
||||
-- Decreasing floating client size
|
||||
awful.key(
|
||||
{modkey, 'Control'},
|
||||
'Up',
|
||||
function(c)
|
||||
if c.floating and c.height > 10 then
|
||||
c:relative_move(0, 0, 0, dpi(-10))
|
||||
end
|
||||
end,
|
||||
{description = 'decrease floating client size vertically by 10 px up', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey, 'Control'},
|
||||
'Down',
|
||||
function(c)
|
||||
if c.floating then
|
||||
local c_height = c.height
|
||||
c:relative_move(0, 0, 0, dpi(-10))
|
||||
if c.height ~= c_height and c.height > 10 then
|
||||
c:relative_move(0, dpi(10), 0, 0)
|
||||
end
|
||||
end
|
||||
end,
|
||||
{description = 'decrease floating client size vertically by 10 px down', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey, 'Control'},
|
||||
'Left',
|
||||
function(c)
|
||||
if c.floating and c.width > 10 then
|
||||
c:relative_move(0, 0, dpi(-10), 0)
|
||||
end
|
||||
end,
|
||||
{description = 'decrease floating client size horizontally by 10 px left', group = 'client'}
|
||||
),
|
||||
awful.key(
|
||||
{modkey, 'Control'},
|
||||
'Right',
|
||||
function(c)
|
||||
if c.floating then
|
||||
local c_width = c.width
|
||||
c:relative_move(0, 0, dpi(-10), 0)
|
||||
if c.width ~= c_width and c.width > 10 then
|
||||
c:relative_move(dpi(10), 0 , 0, 0)
|
||||
end
|
||||
end
|
||||
end,
|
||||
{description = 'decrease floating client size horizontally by 10 px right', group = 'client'}
|
||||
)
|
||||
)
|
||||
|
||||
return clientKeys
|
|
@ -139,7 +139,7 @@ local function set_wallpaper(s)
|
|||
if type(wallpaper) == "function" then
|
||||
wallpaper = wallpaper(s)
|
||||
end
|
||||
gears.wallpaper.centered(wallpaper, s, "#282a36")
|
||||
gears.wallpaper.maximized(wallpaper, s)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -154,6 +154,9 @@ awful.screen.connect_for_each_screen(function(s)
|
|||
-- Each screen has its own tag table.
|
||||
awful.tag({ " ", " ", " ", " "}, s, awful.layout.layouts[1])
|
||||
|
||||
s.padding = {
|
||||
bottom = dpi(20)
|
||||
}
|
||||
|
||||
yoffset = dpi(45)
|
||||
xoffset = dpi(18)
|
||||
|
@ -448,7 +451,23 @@ awful.keyboard.append_global_keybindings({
|
|||
awful.key({}, "XF86AudioPrev", function()
|
||||
awful.util.spawn("playerctl previous", false)
|
||||
end),
|
||||
-- Mute Microphone
|
||||
awful.key({}, "XF86Launch8", function()
|
||||
awful.util.spawn("amixer -c 2 set Mic toggle", false)
|
||||
end),
|
||||
|
||||
awful.key({}, "XF86Launch7", function()
|
||||
awful.util.spawn("", false)
|
||||
end),
|
||||
awful.key({}, "XF86Launch6", function()
|
||||
awful.util.spawn("", false)
|
||||
end),
|
||||
awful.key({}, "XF86Launch5", function()
|
||||
awful.util.spawn("", false)
|
||||
end),
|
||||
awful.key({}, "XF86Tools", function()
|
||||
awful.util.spawn("", false)
|
||||
end),
|
||||
-- Brightness Keys
|
||||
awful.key({}, "XF86MonBrightnessUp", function()
|
||||
awful.util.spawn("brightnessctl set +10%", false)
|
||||
|
@ -614,6 +633,7 @@ root.keys(globalkeys)
|
|||
-- }}}
|
||||
|
||||
|
||||
|
||||
-- {{{ Signals
|
||||
-- Signal function to execute when a new client appears.
|
||||
client.connect_signal("manage", function (c)
|
||||
|
@ -631,27 +651,6 @@ client.connect_signal("manage", function (c)
|
|||
ruled.client.apply(c)
|
||||
end)
|
||||
|
||||
-- Enable sloppy focus, so that focus follows mouse.
|
||||
-- client.connect_signal("mouse::enter", function(c)
|
||||
-- c:emit_signal("request::activate", "mouse_enter", {raise = false})
|
||||
-- end)
|
||||
|
||||
-- Enable nice titlebars
|
||||
-- nice()
|
||||
|
||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Autostart Applications
|
||||
-- awful.spawn.with_shell("picom --experimental-backend")
|
||||
-- awful.spawn.with_shell("libinput-gestures-setup start")
|
||||
-- awful.spawn.with_shell("flameshot")
|
||||
-- awful.spawn.with_shell("xset r rate 220 90")
|
||||
-- awful.spawn.with_shell("feh --bg-fill ~/Pictures/wallpapers/RoyalKing.png")
|
||||
-- awful.spawn.with_shell("/usr/lib/polkit-kde-authentication-agent-1")
|
||||
-- awful.spawn.with_shell("emacs -daemon")
|
||||
-- awful.spawn.with_shell("nextcloud --background")
|
||||
-- awful.spawn.with_shell("caffeine")
|
||||
|
||||
-- }}}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
(local awful (require "awful"))
|
||||
(local beautiful (require "beautiful"))
|
||||
(local keybindings (require "keys"))
|
||||
|
||||
(local
|
||||
rules
|
||||
|
|
|
@ -31,7 +31,7 @@ theme.fg_minimize = "#e2e4e5"
|
|||
|
||||
theme.red = "#ff5c57"
|
||||
|
||||
theme.useless_gap = dpi(16)
|
||||
theme.useless_gap = dpi(6)
|
||||
theme.border_width = dpi(0)
|
||||
theme.transparent = "#00000000"
|
||||
theme.border_normal = "#00000000"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue