sway: disable and modify config
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
a94d463cc4
commit
31ea9ec987
8 changed files with 178 additions and 249 deletions
|
@ -75,7 +75,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
### Sway
|
### Sway
|
||||||
#// sway = unstable.swayfx;
|
sway = unstable.swayfx;
|
||||||
|
|
||||||
### Development
|
### Development
|
||||||
#// ciscoPacketTracer8 = local.ciscoPacketTracer8;
|
#// ciscoPacketTracer8 = local.ciscoPacketTracer8;
|
||||||
|
|
|
@ -5,7 +5,9 @@
|
||||||
}:
|
}:
|
||||||
with lib; {
|
with lib; {
|
||||||
config.custom.desktops = mkIf config.custom.full {
|
config.custom.desktops = mkIf config.custom.full {
|
||||||
|
#// gnome.enable = true;
|
||||||
hyprland.enable = true;
|
hyprland.enable = true;
|
||||||
sway.enable = true;
|
#// kde.enable = true;
|
||||||
|
#// sway.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,9 +73,9 @@ in {
|
||||||
keybindings = let
|
keybindings = let
|
||||||
# Keyboard modifiers
|
# Keyboard modifiers
|
||||||
super = cfg.modifier;
|
super = cfg.modifier;
|
||||||
ctrl = "Control";
|
ctrl = "control";
|
||||||
shift = "Shift";
|
shift = "shift";
|
||||||
alt = "Mod1";
|
alt = "mod1";
|
||||||
|
|
||||||
# Mouse bindings
|
# Mouse bindings
|
||||||
left = "button1";
|
left = "button1";
|
||||||
|
@ -97,9 +97,8 @@ in {
|
||||||
})
|
})
|
||||||
keys;
|
keys;
|
||||||
in
|
in
|
||||||
# Repeat keybindings
|
# Repeat binds
|
||||||
{
|
{
|
||||||
### Media
|
|
||||||
# https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h
|
# https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h
|
||||||
XF86AudioMute = "exec ${swayosd-client} --output-volume mute-toggle";
|
XF86AudioMute = "exec ${swayosd-client} --output-volume mute-toggle";
|
||||||
XF86AudioLowerVolume = "exec ${swayosd-client} --output-volume lower";
|
XF86AudioLowerVolume = "exec ${swayosd-client} --output-volume lower";
|
||||||
|
@ -113,165 +112,126 @@ in {
|
||||||
# TODO: Unused media key
|
# TODO: Unused media key
|
||||||
#// XF86AudioMedia = "exec null";
|
#// XF86AudioMedia = "exec null";
|
||||||
}
|
}
|
||||||
# Press keybindings
|
# Press binds
|
||||||
// flags "--no-repeat"
|
// flags "--no-repeat"
|
||||||
{
|
{
|
||||||
# TODO: Toggle left handed trackball
|
"${middle}+${super}" = "move window to scratchpad";
|
||||||
### Scripts
|
"${middle}+${super}+${shift}" = "move container to scratchpad";
|
||||||
"${super}+delete" = "exec inhibit";
|
"1+${ctrl}+${alt}" = "exec lifx state --brightness 0.01";
|
||||||
"${super}+${shift}+delete" = "exec vrr";
|
"1+${super}" = "workspace 1";
|
||||||
"${super}+minus" = "exec audio Flat";
|
"1+${super}+${alt}" = "exec lifx state --kelvin 1500";
|
||||||
"${super}+equal" = "exec audio Normalizer";
|
"1+${super}+${shift}" = "move to workspace 1";
|
||||||
"${super}+${shift}+${ctrl}+q" = "exec close";
|
"2+${ctrl}+${alt}" = "exec lifx state --brightness 0.25";
|
||||||
|
"2+${super}" = "workspace 2";
|
||||||
### Messages
|
"2+${super}+${alt}" = "exec lifx state --kelvin 2500";
|
||||||
"${ctrl}+delete" = "reload";
|
"2+${super}+${shift}" = "move to workspace 2";
|
||||||
"${ctrl}+${alt}+delete" = "exec ${loginctl} terminate-user ''";
|
"3+${ctrl}+${alt}" = "exec lifx state --brightness 0.50";
|
||||||
|
"3+${super}" = "workspace 3";
|
||||||
# Windows
|
"3+${super}+${alt}" = "exec lifx state --kelvin 3000";
|
||||||
"${super}+q" = "kill";
|
"3+${super}+${shift}" = "move to workspace 3";
|
||||||
"${super}+${shift}+q" = "exec ${kill} -9 $(${swaymsg} -t get_tree | ${jq} '.. | select(.focused?==true).pid')";
|
"4+${ctrl}+${alt}" = "exec lifx state --brightness 0.75";
|
||||||
"${super}+grave" = "sticky toggle";
|
"4+${super}" = "workspace 4";
|
||||||
"${super}+return" = "fullscreen toggle";
|
"4+${super}+${alt}" = "exec lifx state --kelvin 4000";
|
||||||
"${super}+tab" = "focus next";
|
"4+${super}+${shift}" = "move to workspace 4";
|
||||||
"${super}+${shift}+tab" = "focus prev";
|
"5+${ctrl}+${alt}" = "exec lifx state --brightness 1.00";
|
||||||
|
"5+${super}" = "workspace 5";
|
||||||
# Containers
|
"5+${super}+${alt}" = "exec lifx state --kelvin 5000";
|
||||||
"${super}+up" = "move up";
|
"5+${super}+${shift}" = "move to workspace 5";
|
||||||
"${super}+down" = "move down";
|
"6+${super}" = "workspace 6";
|
||||||
"${super}+left" = "move left";
|
"6+${super}+${shift}" = "move to workspace 6";
|
||||||
"${super}+right" = "move right";
|
"7+${super}" = "workspace 7";
|
||||||
"${super}+backslash" = "split toggle";
|
"7+${super}+${shift}" = "move to workspace 7";
|
||||||
"${super}+${shift}+backslash" = "split none";
|
"8+${super}" = "workspace 8";
|
||||||
"${super}+backspace" = "focus mode_toggle";
|
"8+${super}+${shift}" = "move to workspace 8";
|
||||||
"${super}+${shift}+backspace" = "floating toggle";
|
"9+${super}" = "workspace 9";
|
||||||
"${super}+bracketleft" = "layout toggle tabbed stacking";
|
"9+${super}+${shift}" = "move to workspace 9";
|
||||||
"${super}+bracketright" = "layout toggle split";
|
"a+${super}" = "[con_mark=android] scratchpad show";
|
||||||
"${super}+escape" = "focus parent";
|
"a+${super}+${shift}" = "exec ${waydroid} session stop";
|
||||||
"${super}+${shift}+escape" = "focus child";
|
"b+${super}" = "exec ${firefox-esr}";
|
||||||
|
"backslash+${super}" = "split toggle";
|
||||||
# Workspaces
|
"backslash+${super}+${shift}" = "split none";
|
||||||
"${super}+1" = "workspace 1";
|
"backspace+${super}" = "focus mode_toggle";
|
||||||
"${super}+${shift}+1" = "move to workspace 1";
|
"backspace+${super}+${shift}" = "floating toggle";
|
||||||
"${super}+2" = "workspace 2";
|
"bracketleft+${super}" = "layout toggle tabbed stacking";
|
||||||
"${super}+${shift}+2" = "move to workspace 2";
|
"bracketright+${super}" = "layout toggle split";
|
||||||
"${super}+3" = "workspace 3";
|
"c+${super}" = "exec ${codium}";
|
||||||
"${super}+${shift}+3" = "move to workspace 3";
|
"delete+${super}" = "exec inhibit";
|
||||||
"${super}+4" = "workspace 4";
|
"delete+${super}+${shift}" = "exec vrr";
|
||||||
"${super}+${shift}+4" = "move to workspace 4";
|
"down+${super}" = "move down";
|
||||||
"${super}+5" = "workspace 5";
|
"e+${super}" = "exec ${gnome-text-editor}";
|
||||||
"${super}+${shift}+5" = "move to workspace 5";
|
"equal+${super}" = "exec audio Normalizer";
|
||||||
"${super}+6" = "workspace 6";
|
"escape+${super}" = "focus parent";
|
||||||
"${super}+${shift}+6" = "move to workspace 6";
|
"escape+${super}+${alt}" = "exec lifx state --color red";
|
||||||
"${super}+7" = "workspace 7";
|
"escape+${super}+${shift}" = "focus child";
|
||||||
"${super}+${shift}+7" = "move to workspace 7";
|
"f+${super}" = "exec ${nautilus}";
|
||||||
"${super}+8" = "workspace 8";
|
"g+${super}" = "workspace game";
|
||||||
"${super}+${shift}+8" = "move to workspace 8";
|
"g+${super}+${ctrl}" = "workspace gamescope";
|
||||||
"${super}+9" = "workspace 9";
|
"g+${super}+${ctrl}+${shift}" = "exec ${pkill} gamescope";
|
||||||
"${super}+${shift}+9" = "move to workspace 9";
|
"g+${super}+${shift}" = "move to workspace game";
|
||||||
"${super}+0" = "workspace 10";
|
"grave+${super}" = "sticky toggle";
|
||||||
"${super}+${shift}+0" = "move to workspace 0";
|
"k+${super}" = "exec ${obsidian}";
|
||||||
"${super}+g" = "workspace game";
|
"left+${super}" = "move left";
|
||||||
"${super}+${shift}+g" = "move to workspace game";
|
"minus+${super}" = "exec audio Flat";
|
||||||
"${super}+${ctrl}+g" = "workspace gamescope";
|
"p+${super}" = "exec ${hyprpicker} --autocopy";
|
||||||
"${super}+z" = "exec workspace prev";
|
"p+${super}+${shift}" = "exec ${hyprpicker} --autocopy --format rgb";
|
||||||
"${super}+${shift}+z" = "move to workspace prev";
|
"print+${shift}" = "exec {grimblast} --freeze copysave output \"$XDG_SCREENSHOTS_DIR/$(date +'%F %H.%M.%S')\"";
|
||||||
"${super}+x" = "exec workspace next";
|
"q+${super}" = "kill";
|
||||||
"${super}+${shift}+x" = "move to workspace next";
|
"q+${super}+${shift}" = "exec ${kill} -9 $(${swaymsg} -t get_tree | ${jq} '.. | select(.focused?==true).pid')";
|
||||||
|
"q+${super}+${shift}+${ctrl}" = "exec close";
|
||||||
# Scratchpads
|
"return+${super}" = "fullscreen toggle";
|
||||||
"${super}+a" = "[con_mark=android] scratchpad show";
|
"right+${super}" = "move right";
|
||||||
"${super}+s" = "[con_mark=steam] scratchpad show";
|
"s+${super}" = "[con_mark=steam] scratchpad show";
|
||||||
"${super}+w" = "[con_mark=vm] scratchpad show";
|
"s+${super}+${shift}" = "exec ${pkill} steam";
|
||||||
"${super}+space" = "scratchpad show";
|
"space+${ctrl}" = "exec scratchpad dropdown ${kitty} --app-id dropdown";
|
||||||
"${super}+${shift}+space" = "move to scratchpad";
|
"space+${ctrl}+${alt}" = "exec lifx toggle";
|
||||||
"${super}+${middle}" = "move window to scratchpad";
|
"space+${super}" = "scratchpad show";
|
||||||
"${super}+${shift}+${middle}" = "move container to scratchpad";
|
"space+${super}+${shift}" = "move to scratchpad";
|
||||||
"${ctrl}+space" = "exec scratchpad dropdown ${foot} --app-id dropdown";
|
"t+${super}" = "workspace terminal; exec ${kitty} --app-id terminal";
|
||||||
|
"t+${super}+${shift}" = "exec ${kitty}";
|
||||||
### Commands
|
"tab+${super}" = "focus next";
|
||||||
# Clipboard
|
"tab+${super}+${shift}" = "focus prev";
|
||||||
"${super}+v" = "exec clipboard";
|
"up+${super}" = "move up";
|
||||||
"${super}+${shift}+v" = "exec ${cliphist} wipe && ${notify-send} cliphist 'Clipboard cleared' --urgency low";
|
"v+${super}" = "exec clipboard";
|
||||||
|
"v+${super}+${shift}" = "exec ${cliphist} wipe && ${notify-send} cliphist 'Clipboard cleared' --urgency low";
|
||||||
# Color picker
|
"w+${super}" = "[con_mark=vm] scratchpad show";
|
||||||
"${super}+p" = "exec {hyprpicker} --autocopy";
|
"w+${super}+${ctrl}+${shift}" = "exec vm ${xfreerdp} /cert:ignore /u:Myned /p:password /app:explorer.exe /v:myndows +gfx-progressive -grab-keyboard";
|
||||||
"${super}+${shift}+p" = "exec {hyprpicker} --autocopy --format rgb";
|
"w+${super}+${shift}" = "exec vm ${wlfreerdp} /cert:ignore /u:Myned /p:password /v:myndows /dynamic-resolution +gfx-progressive -grab-keyboard";
|
||||||
|
"x+${super}" = "exec workspace next";
|
||||||
# Screenshot
|
"x+${super}+${shift}" = "move to workspace next";
|
||||||
print = "exec {grimblast} --freeze copysave area \"$XDG_SCREENSHOTS_DIR/$(date +'%F %H.%M.%S')\"";
|
"z+${super}" = "exec workspace prev";
|
||||||
"${super}+print" = "exec {grimblast} --freeze save area - | ${satty} --filename -";
|
"z+${super}+${shift}" = "move to workspace prev";
|
||||||
"${shift}+print" = "exec {grimblast} --freeze copysave output \"$XDG_SCREENSHOTS_DIR/$(date +'%F %H.%M.%S')\"";
|
|
||||||
"${super}+${shift}+print" = "exec {grimblast} --freeze save output - | ${satty} --filename -";
|
|
||||||
|
|
||||||
# Smart home
|
|
||||||
"${super}+${alt}+escape" = "exec lifx state --color red";
|
|
||||||
"${super}+${alt}+1" = "exec lifx state --kelvin 1500";
|
|
||||||
"${super}+${alt}+2" = "exec lifx state --kelvin 2500";
|
|
||||||
"${super}+${alt}+3" = "exec lifx state --kelvin 3000";
|
|
||||||
"${super}+${alt}+4" = "exec lifx state --kelvin 4000";
|
|
||||||
"${super}+${alt}+5" = "exec lifx state --kelvin 5000";
|
|
||||||
"${ctrl}+${alt}+space" = "exec lifx toggle";
|
|
||||||
"${ctrl}+${alt}+1" = "exec lifx state --brightness 0.01";
|
|
||||||
"${ctrl}+${alt}+2" = "exec lifx state --brightness 0.25";
|
|
||||||
"${ctrl}+${alt}+3" = "exec lifx state --brightness 0.50";
|
|
||||||
"${ctrl}+${alt}+4" = "exec lifx state --brightness 0.75";
|
|
||||||
"${ctrl}+${alt}+5" = "exec lifx state --brightness 1.00";
|
|
||||||
|
|
||||||
### Applications
|
|
||||||
"${super}+b" = "exec ${firefox-esr}";
|
|
||||||
"${super}+c" = "exec ${codium}";
|
|
||||||
"${super}+e" = "exec ${gnome-text-editor}";
|
|
||||||
"${super}+f" = "exec ${nautilus}";
|
|
||||||
"${super}+k" = "exec ${obsidian}";
|
|
||||||
# "${super}+t" = "workspace terminal; exec launch terminal ${foot} --app-id terminal";
|
|
||||||
"${super}+t" = "workspace terminal; exec ${kitty}";
|
|
||||||
"${super}+${shift}+t" = "exec ${foot}";
|
|
||||||
|
|
||||||
# Kill applications
|
|
||||||
"${super}+${shift}+a" = "exec ${waydroid} session stop";
|
|
||||||
"${super}+${shift}+s" = "exec ${pkill} steam";
|
|
||||||
"${super}+${ctrl}+${shift}+g" = "exec ${pkill} gamescope";
|
|
||||||
|
|
||||||
# Remote desktop
|
|
||||||
# https://forum.level1techs.com/t/how-to-seamlessly-run-windows-10-apps-in-a-vm-in-linux/170417
|
|
||||||
"${super}+${shift}+w" = "exec vm ${wlfreerdp} /cert:ignore /u:Myned /p:password /v:myndows /dynamic-resolution +gfx-progressive -grab-keyboard";
|
|
||||||
"${super}+${ctrl}+${shift}+w" = "exec vm ${xfreerdp} /cert:ignore /u:Myned /p:password /app:explorer.exe /v:myndows +gfx-progressive -grab-keyboard";
|
|
||||||
}
|
}
|
||||||
# Release keybindings
|
# Release binds
|
||||||
// flags "--no-repeat --release"
|
// flags "--no-repeat --release"
|
||||||
{
|
{
|
||||||
# Menus
|
"alt_l+${super}" = "workspace wallpaper";
|
||||||
super_l = "exec ${pkill} wofi || ${wofi} --show drun";
|
"control_l+${super}" = "workspace music";
|
||||||
"${ctrl}+super_l" = "exec ${pkill} wofi || calc";
|
"control_l+${super}+${shift}" = "exec hide Picture-in-Picture special:pip";
|
||||||
"${shift}+super_l" = "exec ${pkill} wofi || ${wofi} --show run";
|
"shift_l+${super}" = "workspace back_and_forth";
|
||||||
"${alt}+super_l" = "exec ${pkill} wofi || ${rofi-rbw}";
|
"super_l" = "exec ${pkill} wofi || ${wofi} --show drun";
|
||||||
"${ctrl}+${shift}+super_l" = "exec ${pkill} || ${networkmanager_dmenu}";
|
"super_l+${alt}" = "exec ${pkill} wofi || ${rofi-rbw}";
|
||||||
|
"super_l+${ctrl}" = "exec ${pkill} wofi || calc";
|
||||||
# Workspaces
|
"super_l+${ctrl}+${shift}" = "exec ${pkill} || ${networkmanager_dmenu}";
|
||||||
"${super}+control_l" = "workspace music";
|
"super_l+${shift}" = "exec ${pkill} wofi || ${wofi} --show run";
|
||||||
"${super}+shift_l" = "workspace back_and_forth";
|
|
||||||
"${super}+alt_l" = "workspace wallpaper";
|
|
||||||
|
|
||||||
# Scratchpad
|
|
||||||
"${super}+${shift}+control_l" = "exec hide Picture-in-Picture special:pip";
|
|
||||||
}
|
}
|
||||||
# Lockscreen keybindings
|
# Lockscreen binds
|
||||||
// flags "--no-repeat --release --locked"
|
// flags "--no-repeat --release --locked"
|
||||||
{
|
{
|
||||||
"${super}+l" = "exec ${loginctl} lock-session";
|
"delete+${ctrl}" = "reload";
|
||||||
|
"delete+${ctrl}+${alt}" = "exec ${loginctl} terminate-user ''";
|
||||||
|
"l+${super}" = "exec ${loginctl} lock-session";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#// modes = { };
|
#// modes = { };
|
||||||
|
|
||||||
# Keybindings that are not supported by options
|
# Binds not supported by options
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
# Gesture keybindings
|
# Gesture binds
|
||||||
bindgesture swipe:left workspace prev
|
bindgesture swipe:left workspace prev
|
||||||
bindgesture swipe:right workspace next
|
bindgesture swipe:right workspace next
|
||||||
|
|
||||||
# Switch keybindings
|
# Switch binds
|
||||||
bindswitch lid:on exec ${loginctl} lock-session
|
bindswitch lid:on exec ${loginctl} lock-session
|
||||||
#// bindswitch lid:on output '*' power off
|
#// bindswitch lid:on output '*' power off
|
||||||
#// bindswitch lid:off output '*' power on
|
#// bindswitch lid:off output '*' power on
|
||||||
|
|
|
@ -13,9 +13,9 @@ in {
|
||||||
binds.enable = true;
|
binds.enable = true;
|
||||||
input.enable = true;
|
input.enable = true;
|
||||||
output.enable = true;
|
output.enable = true;
|
||||||
# TODO: rules.enable = true;
|
rules.enable = true;
|
||||||
settings.enable = true;
|
settings.enable = true;
|
||||||
#// swayfx.enable = true;
|
swayfx.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://wiki.nixos.org/wiki/Sway
|
# https://wiki.nixos.org/wiki/Sway
|
||||||
|
|
|
@ -16,7 +16,7 @@ in {
|
||||||
wayland.windowManager.sway.config.output = {
|
wayland.windowManager.sway.config.output = {
|
||||||
# Default
|
# Default
|
||||||
"*" = {
|
"*" = {
|
||||||
adaptive_sync = "off"; # Explicitly use script/keybindings to toggle vrr
|
adaptive_sync = "off"; # Explicitly use script/binds to toggle vrr
|
||||||
background = "#073642 solid_color"; # Fallback color
|
background = "#073642 solid_color"; # Fallback color
|
||||||
resolution = "${toString config.custom.width}x${toString config.custom.height}@${toString config.custom.refresh}Hz";
|
resolution = "${toString config.custom.width}x${toString config.custom.height}@${toString config.custom.refresh}Hz";
|
||||||
scale = toString config.custom.scale;
|
scale = toString config.custom.scale;
|
||||||
|
|
63
options/custom/desktops/sway/rules.nix
Normal file
63
options/custom/desktops/sway/rules.nix
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.custom.desktops.sway.rules;
|
||||||
|
in {
|
||||||
|
options.custom.desktops.sway.rules.enable = mkOption {default = false;};
|
||||||
|
|
||||||
|
config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
|
||||||
|
# https://i3wm.org/docs/
|
||||||
|
wayland.windowManager.sway.config.window.commands = let
|
||||||
|
command = command: {inherit command;};
|
||||||
|
|
||||||
|
# Boilerplate criteria
|
||||||
|
#?? criteria = <"ATTR"|{ATTRS = "EXPR"}> <"EXPR"|null>
|
||||||
|
criteria = attr: expr: {
|
||||||
|
criteria = with builtins;
|
||||||
|
if isAttrs attr
|
||||||
|
then (mapAttrs (a: e: "^${e}$") attr)
|
||||||
|
else {
|
||||||
|
${attr} =
|
||||||
|
if isNull expr
|
||||||
|
then true
|
||||||
|
else "^${expr}$";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class = expr: criteria "app_id" expr;
|
||||||
|
floating = criteria "floating" null;
|
||||||
|
mark = expr: criteria "con_mark" expr;
|
||||||
|
title = expr: criteria "title" expr;
|
||||||
|
|
||||||
|
attrs = attrs: criteria attrs null;
|
||||||
|
in [
|
||||||
|
### Defaults
|
||||||
|
# HACK: Prefer default_floating_border when fixed upstream
|
||||||
|
# https://github.com/swaywm/sway/issues/7360
|
||||||
|
(floating // command "border normal 0")
|
||||||
|
|
||||||
|
### Marks
|
||||||
|
(mark "browser" // command "move to workspace 1")
|
||||||
|
(mark "dropdown" // command "move to scratchpad")
|
||||||
|
(mark "pip" // command "border none, floating enable, sticky enable")
|
||||||
|
(mark "terminal" // command "move to workspace terminal")
|
||||||
|
|
||||||
|
(title "Picture.in.[Pp]icture" // command "mark pip")
|
||||||
|
|
||||||
|
### Overrides
|
||||||
|
(attrs {
|
||||||
|
app_id = "firefox";
|
||||||
|
title = ".*Firefox.*";
|
||||||
|
}
|
||||||
|
// command "layout tabbed")
|
||||||
|
(attrs {
|
||||||
|
app_id = "firefox";
|
||||||
|
title = "Extension.*";
|
||||||
|
}
|
||||||
|
// command "floating enable")
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,52 +1,9 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
audio = "~/.local/bin/audio";
|
|
||||||
clipse = "${pkgs.clipse}/bin/clipse";
|
|
||||||
codium = "${config.home-manager.users.${config.custom.username}.programs.vscode.package}/bin/codium";
|
|
||||||
firefox-esr = "${config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage}/bin/firefox-esr";
|
|
||||||
gnome-text-editor = "${pkgs.gnome-text-editor}/bin/gnome-text-editor";
|
|
||||||
hyprctl = "${config.programs.hyprland.package}/bin/hyprctl";
|
|
||||||
hyprlock = "${config.home-manager.users.${config.custom.username}.programs.hyprlock.package}/bin/hyprlock";
|
|
||||||
hyprpicker = "${pkgs.hyprpicker}/bin/hyprpicker";
|
|
||||||
inhibit = config.home-manager.users.${config.custom.username}.home.file.".local/bin/inhibit".source;
|
|
||||||
jq = "${pkgs.jq}/bin/jq";
|
|
||||||
kill = "${pkgs.procps}/bin/kill";
|
|
||||||
kitty = "${config.home-manager.users.${config.custom.username}.programs.kitty.package}/bin/kitty";
|
|
||||||
left = config.home-manager.users.${config.custom.username}.home.file.".local/bin/left".source;
|
|
||||||
loginctl = "${pkgs.systemd}/bin/loginctl";
|
|
||||||
menu = config.home-manager.users.${config.custom.username}.home.file.".local/bin/menu".source;
|
|
||||||
nautilus = "${pkgs.nautilus}/bin/nautilus";
|
|
||||||
networkmanager_dmenu = "${pkgs.networkmanager_dmenu}/bin/networkmanager_dmenu";
|
|
||||||
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
|
||||||
obsidian = "${pkgs.obsidian}/bin/obsidian";
|
|
||||||
onlyoffice = "${pkgs.onlyoffice-bin}/bin/onlyoffice-desktopeditors --system-title-bar --xdg-desktop-portal";
|
|
||||||
pkill = "${pkgs.procps}/bin/pkill";
|
|
||||||
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
|
||||||
rofi-rbw = "${pkgs.rofi-rbw}/bin/rofi-rbw";
|
|
||||||
rm = "${pkgs.coreutils}/bin/rm";
|
|
||||||
screenshot = "~/.local/bin/screenshot";
|
|
||||||
sleep = "${pkgs.coreutils}/bin/sleep";
|
|
||||||
smile = "${pkgs.smile}/bin/smile";
|
|
||||||
steam = "${config.programs.steam.package}/bin/steam";
|
|
||||||
swayosd-client = "${pkgs.swayosd}/bin/swayosd-client";
|
|
||||||
systemctl = "${pkgs.systemd}/bin/systemctl";
|
|
||||||
toggle = "~/.local/bin/toggle";
|
|
||||||
virt-manager = "${config.programs.virt-manager.package}/bin/virt-manager";
|
|
||||||
vm = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vm".source;
|
|
||||||
vrr = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vrr".source;
|
|
||||||
walker = "${config.home-manager.users.${config.custom.username}.programs.walker.package}/bin/walker";
|
|
||||||
waydroid = "${pkgs.waydroid}/bin/waydroid";
|
|
||||||
window = config.home-manager.users.${config.custom.username}.home.file.".local/bin/window".source;
|
|
||||||
workspace = config.home-manager.users.${config.custom.username}.home.file.".local/bin/workspace".source;
|
|
||||||
zoom = config.home-manager.users.${config.custom.username}.home.file.".local/bin/zoom".source;
|
|
||||||
sway-audio-idle-inhibit = "${pkgs.sway-audio-idle-inhibit}/bin/sway-audio-idle-inhibit";
|
|
||||||
waybar = "${config.home-manager.users.${config.custom.username}.programs.waybar.package}/bin/waybar";
|
|
||||||
|
|
||||||
cfg = config.custom.desktops.sway.settings;
|
cfg = config.custom.desktops.sway.settings;
|
||||||
in {
|
in {
|
||||||
options.custom.desktops.sway.settings.enable = mkOption {default = false;};
|
options.custom.desktops.sway.settings.enable = mkOption {default = false;};
|
||||||
|
@ -144,59 +101,6 @@ in {
|
||||||
# (once "${rm} ~/.cache/cliphist/db") # Clear clipboard database
|
# (once "${rm} ~/.cache/cliphist/db") # Clear clipboard database
|
||||||
# (once firefox-esr)
|
# (once firefox-esr)
|
||||||
];
|
];
|
||||||
|
|
||||||
window.commands = let
|
|
||||||
command = command: {inherit command;};
|
|
||||||
|
|
||||||
# Boilerplate criteria
|
|
||||||
#?? criteria = <"ATTR"|{ATTRS = "EXPR"}> <"EXPR"|null>
|
|
||||||
criteria = attr: expr: {
|
|
||||||
criteria = with builtins;
|
|
||||||
if isAttrs attr
|
|
||||||
then (mapAttrs (a: e: "^${e}$") attr)
|
|
||||||
else {
|
|
||||||
${attr} =
|
|
||||||
if isNull expr
|
|
||||||
then true
|
|
||||||
else "^${expr}$";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
app = expr: criteria "app_id" expr;
|
|
||||||
floating = criteria "floating" null;
|
|
||||||
mark = expr: criteria "con_mark" expr;
|
|
||||||
title = expr: criteria "title" expr;
|
|
||||||
|
|
||||||
attrs = attrs: criteria attrs null;
|
|
||||||
in [
|
|
||||||
### Defaults
|
|
||||||
# HACK: Prefer default_floating_border when fixed upstream
|
|
||||||
# https://github.com/swaywm/sway/issues/7360
|
|
||||||
(floating // command "border normal 0")
|
|
||||||
|
|
||||||
### Workspaces
|
|
||||||
# 1
|
|
||||||
(attrs {
|
|
||||||
app_id = "firefox";
|
|
||||||
title = ".*Firefox.*";
|
|
||||||
}
|
|
||||||
// command "layout tabbed")
|
|
||||||
(attrs {
|
|
||||||
app_id = "firefox";
|
|
||||||
title = "Extension.*";
|
|
||||||
}
|
|
||||||
// command "floating enable")
|
|
||||||
(mark "browser" // command "move to workspace 1")
|
|
||||||
|
|
||||||
# terminal
|
|
||||||
(mark "terminal" // command "move to workspace terminal")
|
|
||||||
|
|
||||||
### Scratchpads
|
|
||||||
(mark "dropdown" // command "move to scratchpad")
|
|
||||||
|
|
||||||
### Sticky
|
|
||||||
(mark "pip" // command "border none, floating enable, sticky enable")
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#!! Applies to every move/workspace invocation
|
#!! Applies to every move/workspace invocation
|
||||||
|
|
|
@ -18,7 +18,7 @@ in {
|
||||||
|
|
||||||
# Polyfill home-manager wrappers
|
# Polyfill home-manager wrappers
|
||||||
# https://github.com/nix-community/home-manager/blob/master/modules/services/window-managers/i3-sway/sway.nix#L334
|
# https://github.com/nix-community/home-manager/blob/master/modules/services/window-managers/i3-sway/sway.nix#L334
|
||||||
package = with config.wayland.windowManager.sway;
|
package = with config.home-manager.users.${config.custom.username}.wayland.windowManager.sway;
|
||||||
pkgs.sway.override {
|
pkgs.sway.override {
|
||||||
extraSessionCommands = extraSessionCommands;
|
extraSessionCommands = extraSessionCommands;
|
||||||
extraOptions = extraOptions;
|
extraOptions = extraOptions;
|
||||||
|
|
Loading…
Reference in a new issue