Compare commits
12 Commits
e2efc2290c
...
ddf2db90e9
| Author | SHA1 | Date | |
|---|---|---|---|
| ddf2db90e9 | |||
| 8b2ec0c7d7 | |||
| 968ab1ec10 | |||
| b0177ed346 | |||
| a143b1a1f1 | |||
| b2d5ecdd0e | |||
| aa96d67e71 | |||
| 9257437dc8 | |||
| 8493ad4365 | |||
| 93f532b09b | |||
| 017cd2257f | |||
| 203ea1b91c |
@@ -1,69 +1,4 @@
|
|||||||
-- Set modifier keys
|
-- Get window position relative to monitor
|
||||||
local mainMod = "SUPER + "
|
|
||||||
local subMod = mainMod
|
|
||||||
local keyboardString = "qwertyuiop"
|
|
||||||
local keybindIndex = 1
|
|
||||||
|
|
||||||
-- Set different modifiers on laptop
|
|
||||||
if Hostname == "mobile02" then
|
|
||||||
mainMod = "ALT + "
|
|
||||||
subMod = "SUPER + "
|
|
||||||
keyboardString = "1234567890"
|
|
||||||
keybindIndex = 2
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Delete windows
|
|
||||||
hl.bind(mainMod .. "backspace", hl.dsp.window.close())
|
|
||||||
|
|
||||||
-- If otter is open, focus it, if not make a new window
|
|
||||||
hl.bind(mainMod .. "d", function()
|
|
||||||
if hl.get_windows({ class = "otter" })[1] ~= nil then
|
|
||||||
hl.dispatch(hl.dsp.focus({ window = "class:otter" }))
|
|
||||||
else
|
|
||||||
hl.exec_cmd("kitty --class otter --title otter-launcher -e sh -c 'sleep 0.05 && otter-launcher'")
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Open windows
|
|
||||||
local globalAppBinds = {
|
|
||||||
{ key = { "RETURN" }, dispatch = "kitty" },
|
|
||||||
{ key = { "f", "o" }, dispatch = "firefox" },
|
|
||||||
{ key = { "s" }, dispatch = "nemo" },
|
|
||||||
{ key = { "a", "e" }, dispatch = "wlogout -b 5" },
|
|
||||||
{ mod = subMod, key = { "SHIFT + s" }, dispatch = "grimblast copy area" },
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, bind in ipairs(globalAppBinds) do
|
|
||||||
local modBind = bind.mod or mainMod
|
|
||||||
if bind.key[keybindIndex] then
|
|
||||||
hl.bind(modBind .. bind.key[keybindIndex], hl.dsp.exec_cmd(bind.dispatch))
|
|
||||||
else
|
|
||||||
hl.bind(modBind .. bind.key[1], hl.dsp.exec_cmd(bind.dispatch))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Workspace functions
|
|
||||||
local keyboardSplit = {}
|
|
||||||
|
|
||||||
for char in keyboardString:gmatch(".") do
|
|
||||||
table.insert(keyboardSplit, char)
|
|
||||||
end
|
|
||||||
|
|
||||||
for index, bind in ipairs(keyboardSplit) do
|
|
||||||
hl.bind(mainMod .. bind, hl.dsp.focus({ workspace = index }))
|
|
||||||
hl.bind(mainMod .. "SHIFT + " .. bind, hl.dsp.window.move({ workspace = index, follow = false }))
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Music workspace
|
|
||||||
hl.bind(mainMod .. "m", hl.dsp.workspace.toggle_special("music"))
|
|
||||||
|
|
||||||
-- Move windows with hjkl
|
|
||||||
hl.bind(mainMod .. "SHIFT + h", hl.dsp.layout("swapcol l"))
|
|
||||||
hl.bind(mainMod .. "SHIFT + l", hl.dsp.layout("swapcol r"))
|
|
||||||
hl.bind(mainMod .. "k", hl.dsp.focus({ direction = "up" }))
|
|
||||||
hl.bind(mainMod .. "j", hl.dsp.focus({ direction = "down" }))
|
|
||||||
|
|
||||||
-- Function to get window position relative to monitor
|
|
||||||
local function normalise_current_window_pos()
|
local function normalise_current_window_pos()
|
||||||
local active = hl.get_active_window()
|
local active = hl.get_active_window()
|
||||||
if active then
|
if active then
|
||||||
@@ -82,42 +17,179 @@ local function normalise_current_window_pos()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Change scroll binds to be better
|
-- Notification helper function
|
||||||
hl.bind(mainMod .. "h", function()
|
local function notif(text, timeout, icon)
|
||||||
local pos = normalise_current_window_pos()
|
hl.notification.create({
|
||||||
if pos then
|
text = text or "notification",
|
||||||
-- 9 derived from 5 gap plus 3 border (8), so first pixel of window is 9
|
timeout = timeout or 2000,
|
||||||
if pos == 9 then
|
icon = icon or "ok",
|
||||||
-- If first window, then move to monitor to the left
|
})
|
||||||
hl.dispatch(hl.dsp.focus({ monitor = "+1" }))
|
end
|
||||||
else
|
|
||||||
-- If not the first window then go to the column to the left
|
|
||||||
hl.dispatch(hl.dsp.layout("move -col"))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
hl.bind(mainMod .. "l", function()
|
-- Set modifier keys
|
||||||
|
local mainMod = "SUPER + "
|
||||||
|
local subMod = mainMod
|
||||||
|
local keyboardString = "qwertyuiop"
|
||||||
|
local keybindIndex = 1
|
||||||
|
local recordingMode = 0
|
||||||
|
|
||||||
|
-- Set different modifiers on laptop
|
||||||
|
if Hostname == "mobile02" then
|
||||||
|
mainMod = "ALT + "
|
||||||
|
subMod = "SUPER + "
|
||||||
|
keyboardString = "1234567890"
|
||||||
|
keybindIndex = 2
|
||||||
|
end
|
||||||
|
|
||||||
|
local globalAppBinds = {
|
||||||
|
|
||||||
|
---- Window functions
|
||||||
|
{ key = { "BACKSPACE" }, dispatch = hl.dsp.window.close() },
|
||||||
|
{ key = { "b", "f" }, dispatch = hl.dsp.window.fullscreen({ action = "toggle" }) },
|
||||||
|
{ mod = subMod, key = { "space" }, dispatch = hl.dsp.window.float() },
|
||||||
|
|
||||||
|
---- Apps
|
||||||
|
-- Launcher
|
||||||
|
{
|
||||||
|
key = { "d" },
|
||||||
|
dispatch = function()
|
||||||
|
if hl.get_windows({ class = "otter" })[1] ~= nil then
|
||||||
|
hl.dispatch(hl.dsp.focus({ window = "class:otter" }))
|
||||||
|
else
|
||||||
|
hl.exec_cmd("kitty --class otter --title otter-launcher -e sh -c 'sleep 0.05 && otter-launcher'")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Terminal
|
||||||
|
{
|
||||||
|
key = { "RETURN" },
|
||||||
|
dispatch = function()
|
||||||
|
if recordingMode == 1 then
|
||||||
|
hl.exec_cmd("kitty -o font_size=24 -o window_margin_width=20")
|
||||||
|
else
|
||||||
|
hl.exec_cmd("kitty")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Firefox and file browser
|
||||||
|
{ key = { "f", "o" }, dispatch = "firefox" },
|
||||||
|
{ key = { "s" }, dispatch = "nemo" },
|
||||||
|
|
||||||
|
---- Move windows
|
||||||
|
{ key = { "k" }, dispatch = hl.dsp.focus({ direction = "up" }) },
|
||||||
|
{ key = { "j" }, dispatch = hl.dsp.focus({ direction = "down" }) },
|
||||||
|
{ key = { "SHIFT + h" }, dispatch = hl.dsp.layout("swapcol l") },
|
||||||
|
{ key = { "SHIFT + l" }, dispatch = hl.dsp.layout("swapcol r") },
|
||||||
|
{
|
||||||
|
key = { "l" },
|
||||||
|
dispatch = function()
|
||||||
-- Move before so you can detect if it is the last window
|
-- Move before so you can detect if it is the last window
|
||||||
hl.dispatch(hl.dsp.layout("move +col"))
|
hl.dispatch(hl.dsp.layout("move +col"))
|
||||||
if not normalise_current_window_pos() then
|
if not normalise_current_window_pos() then
|
||||||
-- Go back a window
|
-- Go back a window
|
||||||
hl.dispatch(hl.dsp.layout("move -col"))
|
hl.dispatch(hl.dsp.layout("move -col"))
|
||||||
-- Move to monitor to the right
|
-- Move to monitor to the right
|
||||||
hl.dispatch(hl.dsp.focus({ monitor = "-1" }))
|
hl.dispatch(hl.dsp.focus({ monitor = "right" }))
|
||||||
end
|
end
|
||||||
end)
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key = { "h" },
|
||||||
|
dispatch = function()
|
||||||
|
local pos = normalise_current_window_pos()
|
||||||
|
if pos then
|
||||||
|
-- 9 derived from 5 gap plus 3 border (8), so first pixel of window is 9
|
||||||
|
if pos == 9 then
|
||||||
|
-- If first window, then move to monitor to the left
|
||||||
|
hl.dispatch(hl.dsp.focus({ monitor = "left" }))
|
||||||
|
else
|
||||||
|
-- If not the first window then go to the column to the left
|
||||||
|
hl.dispatch(hl.dsp.layout("move -col"))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
-- Fullscreen with b
|
---- Special Workspaces
|
||||||
hl.bind(mainMod .. "b", hl.dsp.window.fullscreen({ action = "toggle" }))
|
{ key = { "m" }, dispatch = hl.dsp.workspace.toggle_special("music") },
|
||||||
|
{ key = { "minus" }, dispatch = hl.dsp.workspace.toggle_special("scratch") },
|
||||||
|
{ key = { "SHIFT + minus" }, dispatch = hl.dsp.window.move({ workspace = "special:scratch", follow = false }) },
|
||||||
|
|
||||||
-- Special workspace
|
-- Youtuber mode lol
|
||||||
hl.bind(mainMod .. "minus", hl.dsp.workspace.toggle_special("scratch"))
|
{
|
||||||
hl.bind(mainMod .. "SHIFT + minus", hl.dsp.window.move({ workspace = "special:scratch", follow = false }))
|
key = { "z" },
|
||||||
|
dispatch = function()
|
||||||
|
if recordingMode == 0 then
|
||||||
|
recordingMode = 1
|
||||||
|
hl.exec_cmd(
|
||||||
|
"wshowkeys -a right -F 'FiraMono Nerd Font 35' -s '#cba6f7ff' -f '#cdd6f4ff' -b '#45475a99' -m 70 -l 60 -t 1000 -a top"
|
||||||
|
)
|
||||||
|
notif("Recording Mode Enabled")
|
||||||
|
else
|
||||||
|
recordingMode = 0
|
||||||
|
hl.exec_cmd("pkill wshowkeys")
|
||||||
|
notif("Recording Mode Disabled")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
-- Float resize and move window with mouse
|
{
|
||||||
hl.bind(subMod .. "mouse:272", hl.dsp.window.drag(), { mouse = true })
|
key = { "x" },
|
||||||
hl.bind(subMod .. "mouse:272", hl.dsp.window.float(), { mouse = true, click = true })
|
dispatch = function()
|
||||||
hl.bind(subMod .. "mouse:272", hl.dsp.layout("promote"), { mouse = true, release = true })
|
if recordingMode == 1 then
|
||||||
|
hl.exec_cmd("woomer --output DP-1 --radius 2 --monitor DP-1 -S")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
hl.bind(subMod .. "SHIFT + mouse:272", hl.dsp.window.resize(), { mouse = true })
|
-- Logout menu
|
||||||
|
{ key = { "a", "e" }, dispatch = "wlogout -b 5" },
|
||||||
|
|
||||||
|
-- Screenshot
|
||||||
|
{ mod = subMod, key = { "SHIFT + s" }, dispatch = "grimblast copy area" },
|
||||||
|
|
||||||
|
-- Mouse for moving windows
|
||||||
|
{ mod = subMod, key = { "mouse:272" }, dispatch = hl.dsp.window.drag(), opts = { mouse = true } },
|
||||||
|
{ mod = subMod, key = { "mouse:272" }, dispatch = hl.dsp.window.float(), opts = { mouse = true, click = true } },
|
||||||
|
{
|
||||||
|
mod = subMod,
|
||||||
|
key = { "mouse:272" },
|
||||||
|
dispatch = hl.dsp.layout("promote"),
|
||||||
|
opts = { mouse = true, release = true },
|
||||||
|
},
|
||||||
|
{ mod = subMod, key = { "SHIFT + mouse:272" }, dispatch = hl.dsp.window.resize(), opts = { mouse = true } },
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Workspace switch keys
|
||||||
|
for _, bind in ipairs(globalAppBinds) do
|
||||||
|
local modBind = bind.mod or mainMod
|
||||||
|
local command
|
||||||
|
if type(bind.dispatch) ~= "string" then
|
||||||
|
command = bind.dispatch
|
||||||
|
else
|
||||||
|
command = hl.dsp.exec_cmd(bind.dispatch)
|
||||||
|
end
|
||||||
|
local opts = {}
|
||||||
|
if bind.opts then
|
||||||
|
opts = bind.opts
|
||||||
|
end
|
||||||
|
if bind.key[keybindIndex] then
|
||||||
|
hl.bind(modBind .. bind.key[keybindIndex], command, opts)
|
||||||
|
else
|
||||||
|
hl.bind(modBind .. bind.key[1], command)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Workspace functions
|
||||||
|
local keyboardSplit = {}
|
||||||
|
|
||||||
|
for char in keyboardString:gmatch(".") do
|
||||||
|
table.insert(keyboardSplit, char)
|
||||||
|
end
|
||||||
|
|
||||||
|
for index, bind in ipairs(keyboardSplit) do
|
||||||
|
hl.bind(mainMod .. bind, hl.dsp.focus({ workspace = index }))
|
||||||
|
hl.bind(mainMod .. "SHIFT + " .. bind, hl.dsp.window.move({ workspace = index, follow = false }))
|
||||||
|
end
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
local appList = {
|
local appList = {
|
||||||
"waybar",
|
|
||||||
"dunst",
|
|
||||||
"wpaperd -d",
|
"wpaperd -d",
|
||||||
"syncthing -home=/home/user01/.config/syncthing -no-browser",
|
"syncthing -home=/home/user01/.config/syncthing -no-browser",
|
||||||
"gotify-desktop",
|
"gotify-desktop",
|
||||||
'sleep 5 && curl -X POST -H "Content-Type: application/json" -d "{\\"ref\\":\\"$(git -C ~/.dotfiles rev-parse HEAD)\\", \\"status\\":\\"$(git -C ~/.dotfiles diff --quiet && echo "clean" || echo "dirty")\\"}" https://n8n.voidarc.co.uk/webhook/config-checker',
|
'sleep 5 && curl -X POST -H "Content-Type: application/json" -d "{\\"ref\\":\\"$(git -C ~/.dotfiles rev-parse HEAD)\\", \\"status\\":\\"$(git -C ~/.dotfiles diff --quiet && echo "clean" || echo "dirty")\\"}" http://192.168.1.180:5678/webhook/config-checker',
|
||||||
}
|
}
|
||||||
|
|
||||||
local localAppList
|
local localAppList
|
||||||
@@ -12,11 +10,14 @@ if Hostname == "HACKSTATION" then
|
|||||||
-- If on desktop do desktop things
|
-- If on desktop do desktop things
|
||||||
localAppList = {
|
localAppList = {
|
||||||
"wayvnc 0.0.0.0 --output=DP-1",
|
"wayvnc 0.0.0.0 --output=DP-1",
|
||||||
|
"quickshell",
|
||||||
}
|
}
|
||||||
elseif Hostname == "mobile02" then
|
elseif Hostname == "mobile02" then
|
||||||
-- If on laptop, do laptop things
|
-- If on laptop, do laptop things
|
||||||
localAppList = {
|
localAppList = {
|
||||||
"way-edges",
|
"way-edges",
|
||||||
|
"waybar",
|
||||||
|
"dunst",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,14 @@ hl.window_rule({
|
|||||||
animation = "slide top",
|
animation = "slide top",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
hl.window_rule({
|
||||||
|
name = "woomer no anim",
|
||||||
|
match = {
|
||||||
|
title = "woomer",
|
||||||
|
},
|
||||||
|
no_anim = true,
|
||||||
|
})
|
||||||
|
|
||||||
-- Define gaps for music workspace
|
-- Define gaps for music workspace
|
||||||
hl.workspace_rule({
|
hl.workspace_rule({
|
||||||
workspace = "special:music",
|
workspace = "special:music",
|
||||||
@@ -128,3 +136,21 @@ hl.layer_rule({
|
|||||||
blur = true,
|
blur = true,
|
||||||
ignore_alpha = 0,
|
ignore_alpha = 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
hl.layer_rule({
|
||||||
|
name = "astal",
|
||||||
|
match = {
|
||||||
|
namespace = "system-stats",
|
||||||
|
},
|
||||||
|
blur = false,
|
||||||
|
ignore_alpha = 0,
|
||||||
|
})
|
||||||
|
|
||||||
|
hl.layer_rule({
|
||||||
|
name = "showkeys",
|
||||||
|
match = {
|
||||||
|
namespace = "showkeys",
|
||||||
|
},
|
||||||
|
blur = false,
|
||||||
|
no_anim = true,
|
||||||
|
})
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ local beziers = {
|
|||||||
-- Springs
|
-- Springs
|
||||||
{ name = "hardSpring", kind = "spring" },
|
{ name = "hardSpring", kind = "spring" },
|
||||||
{ name = "mediumSpring", kind = "spring", stiffness = 50, dampening = 10 },
|
{ name = "mediumSpring", kind = "spring", stiffness = 50, dampening = 10 },
|
||||||
{ name = "heavierSpring", kind = "spring", mass = 1.2, stiffness = 50, dampening = 11 },
|
{ name = "heavierSpring", kind = "spring", mass = 1.3, stiffness = 50, dampening = 11 },
|
||||||
{ name = "looseSpring", kind = "spring", dampening = 5, stiffness = 50 },
|
{ name = "looseSpring", kind = "spring", dampening = 5, stiffness = 50 },
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,8 +29,8 @@ for _, bezier in ipairs(beziers) do
|
|||||||
type = "spring",
|
type = "spring",
|
||||||
-- If all the parameters are empty make a spring with the values from the wiki
|
-- If all the parameters are empty make a spring with the values from the wiki
|
||||||
mass = bezier.mass or 1,
|
mass = bezier.mass or 1,
|
||||||
stiffness = bezier.stiffness or 70,
|
stiffness = (bezier.stiffness or 70) + 430,
|
||||||
dampening = bezier.dampening or 10,
|
dampening = (bezier.dampening or 10) + 26,
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
-- You fucked something up
|
-- You fucked something up
|
||||||
|
|||||||
1
rewrite
1
rewrite
Submodule rewrite deleted from c93ddf3818
Reference in New Issue
Block a user