Files
dotfiles/.config/hypr/scratchpad.lua
T
2026-09-30 17:03:12 +01:00

61 lines
2.0 KiB
Lua

-- Scratchpad apps
hl.window_rule {
workspace = 'special:music',
match = {
class = 'Spotify|psysonic',
},
}
hl.window_rule {
workspace = 'special:comms',
match = {
class = '^(chrome-discord.com__channels_@me-Default|chrome-web.whatsapp.com__-Default|signal)$',
},
}
hl.window_rule {
workspace = 'special:prod',
match = {
class = '^(superproductivity|org.station.notes)$',
},
}
-- Control scratchpad
bind(
'SUPER + S',
hl.dsp.workspace.toggle_special 'scratchpad',
'Toggle scratchpad'
)
bind(
'SUPER + ALT + S',
hl.dsp.window.move { workspace = 'special:scratchpad' },
'Move window to scratchpad'
)
bind('SUPER + N', function()
hl.dispatch(hl.dsp.workspace.toggle_special 'prod')
local windows = hl.get_windows { workspace = 'special:prod' }
if #windows == 0 then
exec 'station-launch-or-focus ^superProductivity$ "uwsm-app -- super-productivity"'
exec 'uwsm-app -- xdg-terminal-exec --app-id=org.station.notes nvim ~/Notes'
end
end, 'Toggle productivity workspace')
bind('SUPER + M', function()
hl.dispatch(hl.dsp.workspace.toggle_special 'music')
local windows = hl.get_windows { workspace = 'special:music' }
if #windows == 0 then
exec 'station-launch-or-focus spotify'
exec 'station-launch-or-focus psysonic'
end
end, 'Toggle music workspace')
bind('SUPER + D', function()
hl.dispatch(hl.dsp.workspace.toggle_special 'comms')
local windows = hl.get_windows { workspace = 'special:comms' }
if #windows == 0 then
exec 'station-launch-or-focus ^signal$ "uwsm-app -- signal-desktop"'
exec 'station-launch-or-focus ^chrome-web.whatsapp.com__-Default$ "station-launch-webapp https://web.whatsapp.com"'
exec 'station-launch-or-focus ^chrome-discord.com__channels_@me-Default$ "station-launch-webapp https://discord.com/channels/@me"'
end
end, 'Toggle comms workspace')
bind('SUPER + X', function()
hl.dispatch(hl.dsp.workspace.toggle_special 'monitor')
end, 'Toggle monitor workspace')