1
1
Fork 0

Compare commits

..

No commits in common. "3237b034b9a6d661b42ccaa071b52f2586e28ac8" and "ca4fb5f7ff097246a5f02176c666950a7aabc2b2" have entirely different histories.

8 changed files with 611 additions and 665 deletions

View file

@ -7,7 +7,6 @@
}: }:
with lib; let with lib; let
audio = "~/.local/bin/audio"; audio = "~/.local/bin/audio";
cat = "${pkgs.coreutils}/bin/cat";
clipse = "${pkgs.clipse}/bin/clipse"; clipse = "${pkgs.clipse}/bin/clipse";
codium = "${config.home-manager.users.${config.custom.username}.programs.vscode.package}/bin/codium"; 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"; firefox-esr = "${config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage}/bin/firefox-esr";
@ -29,7 +28,6 @@ with lib; let
onlyoffice = "${pkgs.onlyoffice-bin}/bin/onlyoffice-desktopeditors --system-title-bar --xdg-desktop-portal"; onlyoffice = "${pkgs.onlyoffice-bin}/bin/onlyoffice-desktopeditors --system-title-bar --xdg-desktop-portal";
pkill = "${pkgs.procps}/bin/pkill"; pkill = "${pkgs.procps}/bin/pkill";
playerctl = "${pkgs.playerctl}/bin/playerctl"; playerctl = "${pkgs.playerctl}/bin/playerctl";
remote = config.home-manager.users.${config.custom.username}.home.file.".local/bin/remote".source;
rofi-rbw = "${pkgs.rofi-rbw}/bin/rofi-rbw"; rofi-rbw = "${pkgs.rofi-rbw}/bin/rofi-rbw";
rm = "${pkgs.coreutils}/bin/rm"; rm = "${pkgs.coreutils}/bin/rm";
screenshot = "~/.local/bin/screenshot"; screenshot = "~/.local/bin/screenshot";
@ -40,6 +38,7 @@ with lib; let
systemctl = "${pkgs.systemd}/bin/systemctl"; systemctl = "${pkgs.systemd}/bin/systemctl";
toggle = "~/.local/bin/toggle"; toggle = "~/.local/bin/toggle";
virt-manager = "${config.programs.virt-manager.package}/bin/virt-manager"; 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; 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"; walker = "${config.home-manager.users.${config.custom.username}.programs.walker.package}/bin/walker";
waydroid = "${pkgs.waydroid}/bin/waydroid"; waydroid = "${pkgs.waydroid}/bin/waydroid";
@ -51,233 +50,222 @@ with lib; let
in { in {
options.custom.desktops.hyprland.binds.enable = mkOption {default = false;}; options.custom.desktops.hyprland.binds.enable = mkOption {default = false;};
config = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
age.secrets = let wayland.windowManager.hyprland.settings = let
secret = filename: { # Reverse mods and key for alphabetical sorting
file = "${inputs.self}/secrets/${filename}"; #?? key <"KEY"> <"MODS"|null> <"DISPATCHER"> <"PARAMS"|null>
owner = config.custom.username; key = key: mods: dispatcher: params: "${
group = "users"; if (isNull mods)
}; then ""
else mods
}, ${key}, ${dispatcher}${
if (isNull params)
then ""
else ", ${params}"
}";
in { in {
"desktop/vm/myndows.pass" = secret "desktop/vm/myndows.pass"; # https://wiki.hyprland.org/Configuring/Binds
}; #?? bind = MODS, KEY, DISPATCHER, [PARAMS]
#?? wev
home-manager.users.${config.custom.username} = { # Lockscreen binds
wayland.windowManager.hyprland.settings = let bindl = [
# Reverse mods and key for alphabetical sorting (key "Delete" "Ctrl" "exec" "${hyprctl} reload")
#?? key <"KEY"> <"MODS"|null> <"DISPATCHER"> <"PARAMS"|null> (key "Delete" "Ctrl+Alt" "exec" "${loginctl} terminate-user ''") # Current user sessions
key = key: mods: dispatcher: params: "${ (key "Delete" "Super" "exec" inhibit)
if (isNull mods)
then ""
else mods
}, ${key}, ${dispatcher}${
if (isNull params)
then ""
else ", ${params}"
}";
in {
# https://wiki.hyprland.org/Configuring/Binds
#?? bind = MODS, KEY, DISPATCHER, [PARAMS]
#?? wev
# Lockscreen binds (key "L" "Super" "exec" "${hyprlock} --immediate & ${sleep} 1 && ${hyprctl} dispatch dpms off")
bindl = [
(key "Delete" "Ctrl" "exec" "${hyprctl} reload")
(key "Delete" "Ctrl+Alt" "exec" "${loginctl} terminate-user ''") # Current user sessions
(key "Delete" "Super" "exec" inhibit)
(key "L" "Super" "exec" "${hyprlock} --immediate & ${sleep} 1 && ${hyprctl} dispatch dpms off") # Laptop lid switches
# https://wiki.hyprland.org/Configuring/Binds/#switches
#?? hyprctl devices
(key "switch:off:Lid Switch" null "dpms" "on") # Open
(key "switch:on:Lid Switch" null "dpms" "off") # Close
];
# Laptop lid switches # Mouse binds
# https://wiki.hyprland.org/Configuring/Binds/#switches bindm = [
#?? hyprctl devices (key "mouse:272" "Super" "movewindow" null) # LMB
(key "switch:off:Lid Switch" null "dpms" "on") # Open (key "mouse:273" "Super" "resizewindow" null) # RMB
(key "switch:on:Lid Switch" null "dpms" "off") # Close ];
];
# Mouse binds # Repeat binds
bindm = [ binde = [
(key "mouse:272" "Super" "movewindow" null) # LMB # Media keys
(key "mouse:273" "Super" "resizewindow" null) # RMB # https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h
]; (key "XF86AudioMute" null "exec" "${swayosd-client} --output-volume mute-toggle") # F1
(key "XF86AudioLowerVolume" null "exec" "${swayosd-client} --output-volume lower") # F2
(key "XF86AudioRaiseVolume" null "exec" "${swayosd-client} --output-volume raise") # F3
(key "XF86AudioPrev" null "exec" "${playerctl} previous") # F4
(key "XF86AudioPlay" null "exec" "${playerctl} play-pause") # F5
(key "XF86AudioNext" null "exec" "${playerctl} next") # F6
(key "XF86MonBrightnessDown" null "exec" "${swayosd-client} --brightness lower") # F7
(key "XF86MonBrightnessUp" null "exec" "${swayosd-client} --brightness raise") # F8
(key "XF86AudioMedia" null "exec" "${notify-send} test") # F12
];
# Repeat binds # Release binds
binde = [ bindr = [
# Media keys (key "Alt_L" "Super+Alt" "togglespecialworkspace" "wallpaper")
# https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h (key "Alt_L" "Super+Alt+Shift" "movetoworkspacesilent" "special:wallpaper")
(key "XF86AudioMute" null "exec" "${swayosd-client} --output-volume mute-toggle") # F1 (key "Control_L" "Super+Ctrl" "exec" workspace)
(key "XF86AudioLowerVolume" null "exec" "${swayosd-client} --output-volume lower") # F2 (key "Shift_L" "Super+Shift" "workspace" "previous")
(key "XF86AudioRaiseVolume" null "exec" "${swayosd-client} --output-volume raise") # F3 (key "Super_L" "Super" "exec" "${menu}")
(key "XF86AudioPrev" null "exec" "${playerctl} previous") # F4 #// (key "Super_L" "Super+Alt" "exec" "${menu} --passwords")
(key "XF86AudioPlay" null "exec" "${playerctl} play-pause") # F5 (key "Super_L" "Super+Ctrl" "exec" "${menu} --calculator")
(key "XF86AudioNext" null "exec" "${playerctl} next") # F6 (key "Super_L" "Super+Ctrl+Shift" "exec" "${menu} --networks")
(key "XF86MonBrightnessDown" null "exec" "${swayosd-client} --brightness lower") # F7 (key "Super_L" "Super+Shift" "exec" "${menu} --search")
(key "XF86MonBrightnessUp" null "exec" "${swayosd-client} --brightness raise") # F8 ];
(key "XF86AudioMedia" null "exec" "${notify-send} test") # F12
];
# Release binds # Regular binds
bindr = [ bind = [
(key "Alt_L" "Super+Alt" "togglespecialworkspace" "wallpaper") (key "mouse:274" "Super" "layoutmsg" "swapwithmaster auto")
(key "Alt_L" "Super+Alt+Shift" "movetoworkspacesilent" "special:wallpaper") (key "mouse:274" "Super+Shift" "layoutmsg" "addmaster")
(key "Control_L" "Super+Ctrl" "exec" workspace) (key "mouse:274" "Super+Ctrl+Shift" "layoutmsg" "removemaster")
(key "Shift_L" "Super+Shift" "workspace" "previous")
(key "Super_L" "Super" "exec" "${menu}")
#// (key "Super_L" "Super+Alt" "exec" "${menu} --passwords")
(key "Super_L" "Super+Ctrl" "exec" "${menu} --calculator")
(key "Super_L" "Super+Ctrl+Shift" "exec" "${menu} --networks")
(key "Super_L" "Super+Shift" "exec" "${menu} --search")
];
# Regular binds (key "Backslash" "Super" "layoutmsg" "orientationcycle center left")
bind = [ (key "Backslash" "Super+Shift" "splitratio" "exact 0.5") # Reset layout ratio
(key "mouse:274" "Super" "layoutmsg" "swapwithmaster auto") (key "Backspace" "Super" "changegroupactive" "f")
(key "mouse:274" "Super+Shift" "layoutmsg" "addmaster") (key "Backspace" "Super+Ctrl" "togglegroup" null)
(key "mouse:274" "Super+Ctrl+Shift" "layoutmsg" "removemaster") (key "Backspace" "Super+Ctrl+Shift" "lockactivegroup" "toggle")
(key "Backspace" "Super+Shift" "movegroupwindow" null)
(key "Backslash" "Super" "layoutmsg" "orientationcycle center left") (key "Bracketleft" "Super" "layoutmsg" "rollnext")
(key "Backslash" "Super+Shift" "splitratio" "exact 0.5") # Reset layout ratio (key "Bracketleft" "Super+Shift" "splitratio" "-0.1")
(key "Backspace" "Super" "changegroupactive" "f") (key "Bracketright" "Super" "layoutmsg" "rollprev")
(key "Backspace" "Super+Ctrl" "togglegroup" null) (key "Bracketright" "Super+Shift" "splitratio" "+0.1")
(key "Backspace" "Super+Ctrl+Shift" "lockactivegroup" "toggle") (key "Comma" "Super" "layoutmsg" "swapprev")
(key "Backspace" "Super+Shift" "movegroupwindow" null) (key "Down" "Super" "movewindoworgroup" "d")
(key "Bracketleft" "Super" "layoutmsg" "rollnext") (key "Down" "Super+Shift" "movewindow" "d")
(key "Bracketleft" "Super+Shift" "splitratio" "-0.1") (key "Equal" "Super" "exec" "${swayosd-client} --output-volume raise")
(key "Bracketright" "Super" "layoutmsg" "rollprev") (key "Equal" "Super+Shift" "exec" "${zoom} +0.1")
(key "Bracketright" "Super+Shift" "splitratio" "+0.1") (key "Escape" "Super" "togglefloating" null)
(key "Comma" "Super" "layoutmsg" "swapprev") (key "Escape" "Super+Alt" "exec" "lifx state --color red")
(key "Down" "Super" "movewindoworgroup" "d") (key "Escape" "Super+Shift" "centerwindow" null)
(key "Down" "Super+Shift" "movewindow" "d") (key "Grave" "Super" "exec" smile)
(key "Equal" "Super" "exec" "${swayosd-client} --output-volume raise") (key "Left" "Super" "movewindoworgroup" "l")
(key "Equal" "Super+Shift" "exec" "${zoom} +0.1") (key "Left" "Super+Alt" "exec" "${left} --scroll kensington-orbit-wireless-tb-mouse")
(key "Escape" "Super" "togglefloating" null) (key "Left" "Super+Shift" "movewindow" "l")
(key "Escape" "Super+Alt" "exec" "lifx state --color red") (key "Minus" "Super" "exec" "${swayosd-client} --output-volume lower")
(key "Escape" "Super+Shift" "centerwindow" null) (key "Minus" "Super+Shift" "exec" "${zoom} -0.1")
(key "Grave" "Super" "exec" smile) (key "Period" "Super" "layoutmsg" "swapnext")
(key "Left" "Super" "movewindoworgroup" "l") (key "Apostrophe" "Super" "exec" "${screenshot} selection")
(key "Left" "Super+Alt" "exec" "${left} --scroll kensington-orbit-wireless-tb-mouse") (key "Apostrophe" "Super+Shift" "exec" "${screenshot} display")
(key "Left" "Super+Shift" "movewindow" "l") (key "Apostrophe" "Super+Alt" "exec" "${screenshot} selection --edit")
(key "Minus" "Super" "exec" "${swayosd-client} --output-volume lower") (key "Apostrophe" "Super+Alt+Shift" "exec" "${screenshot} display --edit")
(key "Minus" "Super+Shift" "exec" "${zoom} -0.1") (key "Return" "Super" "fullscreen" "1") # Maximize
(key "Period" "Super" "layoutmsg" "swapnext") (key "Return" "Super+Shift" "fullscreen" "0") # Fullscreen
(key "Apostrophe" "Super" "exec" "${screenshot} selection") (key "Right" "Super" "movewindoworgroup" "r")
(key "Apostrophe" "Super+Shift" "exec" "${screenshot} display") (key "Right" "Super+Shift" "movewindow" "r")
(key "Apostrophe" "Super+Alt" "exec" "${screenshot} selection --edit") (key "Semicolon" "Super" "exec" "${hyprpicker} --autocopy")
(key "Apostrophe" "Super+Alt+Shift" "exec" "${screenshot} display --edit") (key "Semicolon" "Super+Shift" "exec" "${hyprpicker} --autocopy --format rgb")
(key "Return" "Super" "fullscreen" "1") # Maximize (key "Slash" "Super" "exec" vrr)
(key "Return" "Super+Shift" "fullscreen" "0") # Fullscreen (key "Space" "Ctrl" "exec" (concatStringsSep " " [
(key "Right" "Super" "movewindoworgroup" "r") "${toggle}"
(key "Right" "Super+Shift" "movewindow" "r") "--focus"
(key "Semicolon" "Super" "exec" "${hyprpicker} --autocopy") "--type class"
(key "Semicolon" "Super+Shift" "exec" "${hyprpicker} --autocopy --format rgb") "--expression '^dropdown$'"
(key "Slash" "Super" "exec" vrr) "--workspace special:dropdown"
(key "Space" "Ctrl" "exec" (concatStringsSep " " [ "--"
"${toggle}" "${kitty} --app-id dropdown --override font_size=12"
"--focus" ]))
"--type class" (key "Space" "Ctrl+Alt" "exec" "lifx toggle")
"--expression '^dropdown$'" (key "Space" "Ctrl+Shift" "exec" (concatStringsSep " " [
"--workspace special:dropdown" "${toggle}"
"--" "--type title"
"${kitty} --app-id dropdown --override font_size=12" "--expression '^Picture.in.[Pp]icture$'"
"--workspace special:pip"
]))
(key "Space" "Super" "togglespecialworkspace" "scratchpad")
(key "Space" "Super+Shift" "movetoworkspacesilent" "special:scratchpad")
(key "Space" "Super+Ctrl+Shift" "exec" (with config.custom;
concatStringsSep " " [
"${window} move"
"--current"
"--property title"
"'^Picture.in.[Pp]icture$'"
"${toString (gap + border)},${toString (gap + border)}"
])) ]))
(key "Space" "Ctrl+Alt" "exec" "lifx toggle") (key "Tab" "Super" "layoutmsg" "cyclenext")
(key "Space" "Ctrl+Shift" "exec" (concatStringsSep " " [ (key "Tab" "Super+Shift" "alterzorder" "top")
"${toggle}" (key "Tab" "Super+Shift" "cyclenext" "floating")
"--type title" (key "Up" "Super" "movewindoworgroup" "u")
"--expression '^Picture.in.[Pp]icture$'" (key "Up" "Super+Shift" "movewindow" "u")
"--workspace special:pip"
]))
(key "Space" "Super" "togglespecialworkspace" "scratchpad")
(key "Space" "Super+Shift" "movetoworkspacesilent" "special:scratchpad")
(key "Space" "Super+Ctrl+Shift" "exec" (with config.custom;
concatStringsSep " " [
"${window} move"
"--current"
"--property title"
"'^Picture.in.[Pp]icture$'"
"${toString (gap + border)},${toString (gap + border)}"
]))
(key "Tab" "Super" "layoutmsg" "cyclenext")
(key "Tab" "Super+Shift" "alterzorder" "top")
(key "Tab" "Super+Shift" "cyclenext" "floating")
(key "Up" "Super" "movewindoworgroup" "u")
(key "Up" "Super+Shift" "movewindow" "u")
(key "0" "Super" "exec" "${swayosd-client} --output-volume mute-toggle") (key "0" "Super" "exec" "${swayosd-client} --output-volume mute-toggle")
(key "0" "Super+Shift" "exec" "${zoom}") (key "0" "Super+Shift" "exec" "${zoom}")
(key "1" "Ctrl+Alt" "exec" "lifx state --brightness 0.01") (key "1" "Ctrl+Alt" "exec" "lifx state --brightness 0.01")
(key "1" "Super" "workspace" "1") (key "1" "Super" "workspace" "1")
(key "1" "Super+Alt" "exec" "lifx state --kelvin 1500") (key "1" "Super+Alt" "exec" "lifx state --kelvin 1500")
(key "1" "Super+Shift" "movetoworkspacesilent" "1") (key "1" "Super+Shift" "movetoworkspacesilent" "1")
(key "2" "Ctrl+Alt" "exec" "lifx state --brightness 0.25") (key "2" "Ctrl+Alt" "exec" "lifx state --brightness 0.25")
(key "2" "Super" "workspace" "2") (key "2" "Super" "workspace" "2")
(key "2" "Super+Alt" "exec" "lifx state --kelvin 2500") (key "2" "Super+Alt" "exec" "lifx state --kelvin 2500")
(key "2" "Super+Shift" "movetoworkspacesilent" "2") (key "2" "Super+Shift" "movetoworkspacesilent" "2")
(key "3" "Ctrl+Alt" "exec" "lifx state --brightness 0.50") (key "3" "Ctrl+Alt" "exec" "lifx state --brightness 0.50")
(key "3" "Super" "workspace" "3") (key "3" "Super" "workspace" "3")
(key "3" "Super+Alt" "exec" "lifx state --kelvin 3000") (key "3" "Super+Alt" "exec" "lifx state --kelvin 3000")
(key "3" "Super+Shift" "movetoworkspacesilent" "3") (key "3" "Super+Shift" "movetoworkspacesilent" "3")
(key "4" "Ctrl+Alt" "exec" "lifx state --brightness 0.75") (key "4" "Ctrl+Alt" "exec" "lifx state --brightness 0.75")
(key "4" "Super" "workspace" "4") (key "4" "Super" "workspace" "4")
(key "4" "Super+Alt" "exec" "lifx state --kelvin 4000") (key "4" "Super+Alt" "exec" "lifx state --kelvin 4000")
(key "4" "Super+Shift" "movetoworkspacesilent" "4") (key "4" "Super+Shift" "movetoworkspacesilent" "4")
(key "5" "Ctrl+Alt" "exec" "lifx state --brightness 1.00") (key "5" "Ctrl+Alt" "exec" "lifx state --brightness 1.00")
(key "5" "Super" "workspace" "5") (key "5" "Super" "workspace" "5")
(key "5" "Super+Alt" "exec" "lifx state --kelvin 5000") (key "5" "Super+Alt" "exec" "lifx state --kelvin 5000")
(key "5" "Super+Shift" "movetoworkspacesilent" "5") (key "5" "Super+Shift" "movetoworkspacesilent" "5")
(key "6" "Super" "workspace" "6") (key "6" "Super" "workspace" "6")
(key "6" "Super+Shift" "movetoworkspacesilent" "6") (key "6" "Super+Shift" "movetoworkspacesilent" "6")
(key "7" "Super" "workspace" "7") (key "7" "Super" "workspace" "7")
(key "7" "Super+Shift" "movetoworkspacesilent" "7") (key "7" "Super+Shift" "movetoworkspacesilent" "7")
(key "8" "Super" "workspace" "8") (key "8" "Super" "workspace" "8")
(key "8" "Super+Shift" "movetoworkspacesilent" "8") (key "8" "Super+Shift" "movetoworkspacesilent" "8")
(key "9" "Super" "exec" "${audio}") (key "9" "Super" "exec" "${audio}")
(key "A" "Ctrl+Alt" "exec" "${waydroid} session stop") (key "A" "Ctrl+Alt" "exec" "${waydroid} session stop")
(key "A" "Super" "togglespecialworkspace" "android") (key "A" "Super" "togglespecialworkspace" "android")
(key "A" "Super+Shift" "movetoworkspacesilent" "special:android") (key "A" "Super+Shift" "movetoworkspacesilent" "special:android")
(key "B" "Super" "exec" firefox-esr) (key "B" "Super" "exec" firefox-esr)
(key "C" "Super" "exec" codium) (key "C" "Super" "exec" codium)
(key "E" "Super" "exec" gnome-text-editor) (key "E" "Super" "exec" gnome-text-editor)
(key "F" "Super" "exec" "${nautilus} --new-window") (key "F" "Super" "exec" "${nautilus} --new-window")
(key "G" "Super" "workspace" "name:game") (key "G" "Super" "workspace" "name:game")
(key "G" "Super+Alt" "togglespecialworkspace" "gamescope") (key "G" "Super+Alt" "togglespecialworkspace" "gamescope")
(key "G" "Super+Ctrl+Alt" "exec" "${pkill} gamescope") (key "G" "Super+Ctrl+Alt" "exec" "${pkill} gamescope")
(key "G" "Super+Shift" "movetoworkspacesilent" "name:game") (key "G" "Super+Shift" "movetoworkspacesilent" "name:game")
(key "K" "Super" "exec" obsidian) (key "K" "Super" "exec" obsidian)
(key "M" "Super" "togglespecialworkspace" "music") (key "M" "Super" "togglespecialworkspace" "music")
(key "M" "Super+Shift" "movetoworkspacesilent" "special:music") (key "M" "Super+Shift" "movetoworkspacesilent" "special:music")
(key "O" "Super" "togglespecialworkspace" "office") (key "O" "Super" "togglespecialworkspace" "office")
(key "O" "Super+Ctrl" "exec" "${onlyoffice}") (key "O" "Super+Ctrl" "exec" "${onlyoffice}")
(key "O" "Super+Shift" "movetoworkspacesilent" "special:office") (key "O" "Super+Shift" "movetoworkspacesilent" "special:office")
(key "P" "Ctrl+Alt" "exec" "${pkill} 1password") (key "P" "Ctrl+Alt" "exec" "${pkill} 1password")
(key "P" "Super" "togglespecialworkspace" "password") (key "P" "Super" "togglespecialworkspace" "password")
(key "P" "Super+Shift" "movetoworkspacesilent" "special:password") (key "P" "Super+Shift" "movetoworkspacesilent" "special:password")
(key "Q" "Ctrl+Alt" "exec" "${kill} -9 $(${hyprctl} -j activewindow | ${jq} .pid)") (key "Q" "Ctrl+Alt" "exec" "${kill} -9 $(${hyprctl} -j activewindow | ${jq} .pid)")
#// (key "Q" "Ctrl+Alt+Shift" "exec" "close") # Quit all windows #// (key "Q" "Ctrl+Alt+Shift" "exec" "close") # Quit all windows
(key "Q" "Super" "killactive" null) (key "Q" "Super" "killactive" null)
(key "S" "Ctrl+Alt" "exec" "${pkill} steam") (key "S" "Ctrl+Alt" "exec" "${pkill} steam")
(key "S" "Super" "togglespecialworkspace" "steam") (key "S" "Super" "togglespecialworkspace" "steam")
(key "S" "Super+Shift" "movetoworkspacesilent" "special:steam") (key "S" "Super+Shift" "movetoworkspacesilent" "special:steam")
(key "S" "Super+Shift" "exec" steam) (key "S" "Super+Shift" "exec" steam)
(key "T" "Ctrl+Alt" "exec" "${pkill} kitty") (key "T" "Ctrl+Alt" "exec" "${pkill} kitty")
(key "T" "Super" "togglespecialworkspace" "terminal") (key "T" "Super" "togglespecialworkspace" "terminal")
(key "T" "Super+Ctrl" "exec" kitty) (key "T" "Super+Ctrl" "exec" kitty)
(key "T" "Super+Shift" "movetoworkspacesilent" "special:terminal") (key "T" "Super+Shift" "movetoworkspacesilent" "special:terminal")
(key "V" "Super" "exec" "${kitty} --app-id clipboard --override font_size=12 ${clipse}") (key "V" "Super" "exec" "${kitty} --app-id clipboard --override font_size=12 ${clipse}")
(key "V" "Super+Shift" "exec" "${clipse} --clear && ${notify-send} clipse 'Clipboard cleared' --urgency low") (key "V" "Super+Shift" "exec" "${clipse} --clear && ${notify-send} clipse 'Clipboard cleared' --urgency low")
(key "W" "Super" "togglespecialworkspace" "vm") (key "W" "Super" "togglespecialworkspace" "vm")
(key "W" "Super+Ctrl" "exec" ''${remote} --vm --username Myned --password "$(${cat} ${config.age.secrets."desktop/vm/myndows.pass".path})" ${ (key "W" "Super+Ctrl" "exec" "${vm} -x ${
if config.custom.hidpi if config.custom.hidpi
then "--scale 140" then "/scale:140 +f"
else "" else ""
} myndows'') }")
(key "W" "Super+Shift" "movetoworkspacesilent" "special:vm") (key "W" "Super+Ctrl+Shift" "exec" "${vm} ${virt-manager} --show-domain-console myndows")
(key "X" "Super" "workspace" "+1") (key "W" "Super+Shift" "movetoworkspacesilent" "special:vm")
(key "X" "Super+Shift" "movetoworkspacesilent" "+1") (key "X" "Super" "workspace" "+1")
(key "Z" "Super" "workspace" "-1") (key "X" "Super+Shift" "movetoworkspacesilent" "+1")
(key "Z" "Super+Shift" "movetoworkspacesilent" "-1") (key "Z" "Super" "workspace" "-1")
]; (key "Z" "Super+Shift" "movetoworkspacesilent" "-1")
}; ];
}; };
}; };
} }

View file

@ -117,7 +117,7 @@ in {
gaps_out = config.custom.gap; gaps_out = config.custom.gap;
layout = "master"; layout = "master";
#// no_border_on_floating = true; #// no_border_on_floating = true;
#// resize_corner = 3; # Bottom-right resize_corner = 3; # Bottom-right
resize_on_border = true; resize_on_border = true;
snap.enabled = true; snap.enabled = true;
}; };

View file

@ -1,6 +1,5 @@
{ {
config, config,
inputs,
lib, lib,
pkgs, pkgs,
... ...
@ -25,7 +24,6 @@ with lib; let
pkill = "${pkgs.procps}/bin/pkill"; pkill = "${pkgs.procps}/bin/pkill";
playerctl = "${pkgs.playerctl}/bin/playerctl"; playerctl = "${pkgs.playerctl}/bin/playerctl";
power = config.home-manager.users.${config.custom.username}.home.file.".local/bin/power".source; power = config.home-manager.users.${config.custom.username}.home.file.".local/bin/power".source;
remote = config.home-manager.users.${config.custom.username}.home.file.".local/bin/remote".source;
rfkill = "${pkgs.util-linux}/bin/rfkill"; rfkill = "${pkgs.util-linux}/bin/rfkill";
sleep = "${pkgs.coreutils}/bin/sleep"; sleep = "${pkgs.coreutils}/bin/sleep";
swaync-client = "${config.home-manager.users.${config.custom.username}.services.swaync.package}/bin/swaync-client"; swaync-client = "${config.home-manager.users.${config.custom.username}.services.swaync.package}/bin/swaync-client";
@ -34,6 +32,7 @@ with lib; let
systemd-inhibit = "${pkgs.systemd}/bin/systemd-inhibit"; systemd-inhibit = "${pkgs.systemd}/bin/systemd-inhibit";
tailscale = "${pkgs.tailscale}/bin/tailscale"; tailscale = "${pkgs.tailscale}/bin/tailscale";
tr = "${pkgs.coreutils}/bin/tr"; tr = "${pkgs.coreutils}/bin/tr";
vm = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vm".source;
vpn = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vpn".source; vpn = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vpn".source;
wttrbar = "${pkgs.wttrbar}/bin/wttrbar"; wttrbar = "${pkgs.wttrbar}/bin/wttrbar";
@ -41,385 +40,373 @@ with lib; let
in { in {
options.custom.programs.waybar.enable = mkOption {default = false;}; options.custom.programs.waybar.enable = mkOption {default = false;};
config = mkIf cfg.enable { config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
age.secrets = let # https://github.com/Alexays/Waybar
secret = filename: { # https://www.nerdfonts.com/cheat-sheet
file = "${inputs.self}/secrets/${filename}"; programs.waybar = {
owner = config.custom.username; enable = true;
group = "users"; systemd.enable = true; # Start on login
};
in {
"desktop/vm/myndows.pass" = secret "desktop/vm/myndows.pass";
};
home-manager.users.${config.custom.username} = { # ?? waybar --log-level debug
# https://github.com/Alexays/Waybar style = ''
# https://www.nerdfonts.com/cheat-sheet ${readFile ./style.css}
programs.waybar = {
enable = true;
systemd.enable = true; # Start on login
# ?? waybar --log-level debug .horizontal > box {
style = '' margin: 0 ${toString config.custom.gap}px ${toString config.custom.gap}px;
${readFile ./style.css} }
'';
.horizontal > box { ### SETTINGS ###
margin: 0 ${toString config.custom.gap}px ${toString config.custom.gap}px; # https://github.com/Alexays/Waybar/wiki/Configuration
} #?? pkill -SIGUSR2 -x waybar
''; settings = let
## INHERIT ##
#!! Module defaults are not accurate to documentation
# TODO: Submit pull request to fix in addition to inconsistent hyphen vs underscore
# https://github.com/Alexays/Waybar/wiki/Module:-Cava
cava-config = {
cava_config = null; # Default: null?
framerate = 30; # Default: 30?
autosens = 1; # Default: 1
# sensitivity = 0; # Default: 100?
bars = 16; # Default: 2
lower_cutoff_freq = 50; # Default: 50?
higher_cutoff_freq = 10000; # Default: 10000?
sleep_timer = 5; # Default: 0
hide_on_silence = true; # Default: false
method = "pipewire"; # Default: pulse
source = "auto"; # Default: auto?
sample_rate = 44100; # Default: 44100?
sample_bits = 16; # Default: 16?
stereo = false; # Default: true
reverse = false; # Default: false
bar_delimiter = 32; # ASCII code for space, default: 59 or ;
monstercat = true; # Default: false?
waves = true; # Default: false?
noise_reduction = 0.2; # Default: 0.77?
input_delay = 1; # Default: 4
format-icons = [
""
""
""
""
""
""
""
""
]; # !! Required
on-click = easyeffects;
on-scroll-up = "${swayosd-client} --output-volume raise";
on-scroll-down = "${swayosd-client} --output-volume lower";
rotate = 180;
};
in {
status = {
reload_style_on_change = true; # Reload CSS when modified
### SETTINGS ### ## GLOBAL ##
# https://github.com/Alexays/Waybar/wiki/Configuration layer = "top";
#?? pkill -SIGUSR2 -x waybar position = "bottom";
settings = let
## INHERIT ## ## POSITION ##
#!! Module defaults are not accurate to documentation modules-left = [
# TODO: Submit pull request to fix in addition to inconsistent hyphen vs underscore "custom/power"
# https://github.com/Alexays/Waybar/wiki/Module:-Cava "custom/inhibitor"
cava-config = { "custom/vpn"
cava_config = null; # Default: null? "custom/vm"
framerate = 30; # Default: 30? "hyprland/workspaces"
autosens = 1; # Default: 1 ];
# sensitivity = 0; # Default: 100? modules-center = [
bars = 16; # Default: 2 "clock"
lower_cutoff_freq = 50; # Default: 50? "custom/weather"
higher_cutoff_freq = 10000; # Default: 10000? ];
sleep_timer = 5; # Default: 0 modules-right = [
hide_on_silence = true; # Default: false "mpris"
method = "pipewire"; # Default: pulse "tray"
source = "auto"; # Default: auto? "custom/equalizer"
sample_rate = 44100; # Default: 44100? "wireplumber"
sample_bits = 16; # Default: 16? "bluetooth"
stereo = false; # Default: true "network"
reverse = false; # Default: false "battery"
bar_delimiter = 32; # ASCII code for space, default: 59 or ; ];
monstercat = true; # Default: false?
waves = true; # Default: false? ## MODULES ##
noise_reduction = 0.2; # Default: 0.77? # https://github.com/Alexays/Waybar/wiki/Module:-Custom
input_delay = 1; # Default: 4 "custom/power" = {
format-icons = [ format = "";
"" on-click = "${systemctl} poweroff";
"" on-click-right = "${systemctl} reboot";
"" on-click-middle = "${loginctl} terminate-session ''";
"" };
""
"" "custom/inhibitor" = {
"" interval = 5;
"" exec = "~/.config/waybar/scripts/inhibitor.sh";
]; # !! Required on-click = inhibit;
on-click = easyeffects; };
"custom/vm" = {
interval = 5;
exec = "~/.config/waybar/scripts/vm.sh";
on-click = "${vm} -x ${
if config.custom.hidpi
then "/scale:140"
else ""
}";
};
"custom/vpn" = {
interval = 5;
exec = "~/.config/waybar/scripts/vpn.sh";
on-click = "${vpn} mypi3";
};
# https://github.com/Alexays/Waybar/wiki/Module:-Idle-Inhibitor
# FIXME: Not currently usable
# https://github.com/Alexays/Waybar/issues/690
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = "󰅶";
deactivated = "󰾪";
};
};
# https://github.com/Alexays/Waybar/wiki/Module:-Hyprland
# https://www.nerdfonts.com/cheat-sheet
"hyprland/workspaces" = {
show-special = true;
format = "{icon}";
format-icons = {
android = "";
dropdown = "󰞷";
game = "󰊴";
hidden = "";
music = "󰝚";
office = "󰈙";
password = "󰌾";
pip = "󰹙";
scratchpad = "";
steam = "󰓓";
terminal = "";
vm = "󰢹";
wallpaper = "󰏩";
};
};
cava = cava-config;
# https://github.com/Alexays/Waybar/wiki/Module:-Clock
clock = {
# https://fmt.dev/latest/syntax.html#chrono-specs
format = "{:%a %b %d %I:%M %p}"; # Mon Jan 01 12:00 AM
tooltip-format = "{calendar}";
calendar.format = {
months = "<span color='#eee8d5'>{}</span>";
weeks = "<span color='#eee8d5'>{}</span>";
weekdays = "<span color='#93a1a1'>{}</span>";
days = "<span color='#586e75'>{}</span>";
today = "<span color='#eee8d5'>{}</span>";
};
# FIXME: Click release event sends to incorrect layer without sleeping
# https://github.com/hyprwm/Hyprland/issues/1348
on-click = "${swaync-client} --toggle-panel";
# on-click-right = easyeffects;
on-scroll-up = "${swayosd-client} --output-volume raise"; on-scroll-up = "${swayosd-client} --output-volume raise";
on-scroll-down = "${swayosd-client} --output-volume lower"; on-scroll-down = "${swayosd-client} --output-volume lower";
rotate = 180;
}; };
in {
status = {
reload_style_on_change = true; # Reload CSS when modified
## GLOBAL ## # https://github.com/bjesus/wttrbar
layer = "top"; "custom/weather" = {
position = "bottom"; format = "{}°";
interval = 60 * 60;
return-type = "json";
## POSITION ## exec = lib.strings.concatStringsSep " " [
modules-left = [ "${wttrbar}"
"custom/power" "--ampm"
"custom/inhibitor" "--fahrenheit"
"custom/vpn" "--hide-conditions"
"custom/vm" "--main-indicator temp_F"
"hyprland/workspaces"
]; ];
modules-center = [ };
"clock"
"custom/weather" "cava#reverse" =
cava-config
// {
reverse = true;
};
"custom/equalizer" = {
interval = 5;
on-click = audio;
exec = pkgs.writeShellScript "equalizer.sh" ''
${echo} 󰺢
${echo} "$(${cat} ~/.audio)"
${echo} "$(${cat} ~/.audio | ${tr} '[:upper:]' '[:lower:]')"
'';
};
# https://github.com/Alexays/Waybar/wiki/Module:-MPRIS
mpris = {
format = "{player_icon} {dynamic}";
format-paused = "{status_icon} {dynamic}";
dynamic-len = 50;
dynamic-order = [
"title"
"artist"
]; ];
modules-right = [ dynamic-separator = " 󰧟 ";
"mpris" player-icons.default = "󰎈";
"tray" status-icons.paused = "";
"custom/equalizer" on-click-middle = ""; # TODO: Close music player
"wireplumber" on-scroll-up = "${swayosd-client} --output-volume raise";
"bluetooth" on-scroll-down = "${swayosd-client} --output-volume lower";
"network" };
"battery"
# https://github.com/Alexays/Waybar/wiki/Module:-WirePlumber
wireplumber = {
format = "{icon} {volume}%";
format-muted = "󰸈";
format-icons = [
"󰕿"
"󰖀"
"󰕾"
]; ];
on-click = easyeffects;
on-click-right = "${swayosd-client} --output-volume mute-toggle";
on-scroll-up = "${swayosd-client} --output-volume raise";
on-scroll-down = "${swayosd-client} --output-volume lower";
};
## MODULES ## # https://github.com/Alexays/Waybar/wiki/Module:-Bluetooth
# https://github.com/Alexays/Waybar/wiki/Module:-Custom bluetooth = {
"custom/power" = { format-disabled = "󰂲";
format = ""; format-off = "󰂲";
on-click = "${systemctl} poweroff"; format-on = "󰂯";
on-click-right = "${systemctl} reboot"; format-connected = "󰂱";
on-click-middle = "${loginctl} terminate-session ''"; on-click = blueberry;
}; on-click-right = "${bluetoothctl} disconnect";
on-click-middle = "${rfkill} toggle bluetooth"; # Toggle bluetooth on/off
};
"custom/inhibitor" = { # https://github.com/Alexays/Waybar/wiki/Module:-Network
interval = 5; network = {
exec = "~/.config/waybar/scripts/inhibitor.sh"; format = "{icon}";
on-click = inhibit; format-icons = {
}; disabled = "";
disconnected = "";
"custom/vm" = { ethernet = "󰈀";
interval = 5; linked = "";
exec = "~/.config/waybar/scripts/vm.sh"; wifi = [
on-click = ''${remote} --vm --username Myned --password "$(${cat} ${config.age.secrets."desktop/vm/myndows.pass".path})" ${ "󰤯"
if config.custom.hidpi "󰤟"
then "--scale 140" "󰤢"
else "" "󰤥"
} myndows''; "󰤨"
};
"custom/vpn" = {
interval = 5;
exec = "~/.config/waybar/scripts/vpn.sh";
on-click = "${vpn} mypi3";
};
# https://github.com/Alexays/Waybar/wiki/Module:-Idle-Inhibitor
# FIXME: Not currently usable
# https://github.com/Alexays/Waybar/issues/690
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = "󰅶";
deactivated = "󰾪";
};
};
# https://github.com/Alexays/Waybar/wiki/Module:-Hyprland
# https://www.nerdfonts.com/cheat-sheet
"hyprland/workspaces" = {
show-special = true;
format = "{icon}";
format-icons = {
android = "";
dropdown = "󰞷";
game = "󰊴";
hidden = "";
music = "󰝚";
office = "󰈙";
password = "󰌾";
pip = "󰹙";
scratchpad = "";
steam = "󰓓";
terminal = "";
vm = "󰢹";
wallpaper = "󰏩";
};
};
cava = cava-config;
# https://github.com/Alexays/Waybar/wiki/Module:-Clock
clock = {
# https://fmt.dev/latest/syntax.html#chrono-specs
format = "{:%a %b %d %I:%M %p}"; # Mon Jan 01 12:00 AM
tooltip-format = "{calendar}";
calendar.format = {
months = "<span color='#eee8d5'>{}</span>";
weeks = "<span color='#eee8d5'>{}</span>";
weekdays = "<span color='#93a1a1'>{}</span>";
days = "<span color='#586e75'>{}</span>";
today = "<span color='#eee8d5'>{}</span>";
};
# FIXME: Click release event sends to incorrect layer without sleeping
# https://github.com/hyprwm/Hyprland/issues/1348
on-click = "${swaync-client} --toggle-panel";
# on-click-right = easyeffects;
on-scroll-up = "${swayosd-client} --output-volume raise";
on-scroll-down = "${swayosd-client} --output-volume lower";
};
# https://github.com/bjesus/wttrbar
"custom/weather" = {
format = "{}°";
interval = 60 * 60;
return-type = "json";
exec = lib.strings.concatStringsSep " " [
"${wttrbar}"
"--ampm"
"--fahrenheit"
"--hide-conditions"
"--main-indicator temp_F"
]; ];
}; };
"cava#reverse" = on-click = nm-connection-editor;
cava-config on-click-right = network; # Toggle networking on/off
// { };
reverse = true;
};
"custom/equalizer" = { # https://github.com/Alexays/Waybar/wiki/Module:-Battery
interval = 5; "battery" = {
on-click = audio; format = "{icon} {power:.0f}W";
exec = pkgs.writeShellScript "equalizer.sh" '' format-icons = [
${echo} 󰺢 "󰂃"
${echo} "$(${cat} ~/.audio)" "󰁺"
${echo} "$(${cat} ~/.audio | ${tr} '[:upper:]' '[:lower:]')" "󰁻"
''; "󰁼"
"󰁽"
"󰁾"
"󰁿"
"󰂀"
"󰂁"
"󰂂"
"󰁹"
];
interval = 5;
states = {
critical = 15;
warning = 30;
}; };
# https://github.com/Alexays/Waybar/wiki/Module:-MPRIS on-click = power; # Toggle power-saver mode
mpris = {
format = "{player_icon} {dynamic}";
format-paused = "{status_icon} {dynamic}";
dynamic-len = 50;
dynamic-order = [
"title"
"artist"
];
dynamic-separator = " 󰧟 ";
player-icons.default = "󰎈";
status-icons.paused = "";
on-click-middle = ""; # TODO: Close music player
on-scroll-up = "${swayosd-client} --output-volume raise";
on-scroll-down = "${swayosd-client} --output-volume lower";
};
# https://github.com/Alexays/Waybar/wiki/Module:-WirePlumber
wireplumber = {
format = "{icon} {volume}%";
format-muted = "󰸈";
format-icons = [
"󰕿"
"󰖀"
"󰕾"
];
on-click = easyeffects;
on-click-right = "${swayosd-client} --output-volume mute-toggle";
on-scroll-up = "${swayosd-client} --output-volume raise";
on-scroll-down = "${swayosd-client} --output-volume lower";
};
# https://github.com/Alexays/Waybar/wiki/Module:-Bluetooth
bluetooth = {
format-disabled = "󰂲";
format-off = "󰂲";
format-on = "󰂯";
format-connected = "󰂱";
on-click = blueberry;
on-click-right = "${bluetoothctl} disconnect";
on-click-middle = "${rfkill} toggle bluetooth"; # Toggle bluetooth on/off
};
# https://github.com/Alexays/Waybar/wiki/Module:-Network
network = {
format = "{icon}";
format-icons = {
disabled = "";
disconnected = "";
ethernet = "󰈀";
linked = "";
wifi = [
"󰤯"
"󰤟"
"󰤢"
"󰤥"
"󰤨"
];
};
on-click = nm-connection-editor;
on-click-right = network; # Toggle networking on/off
};
# https://github.com/Alexays/Waybar/wiki/Module:-Battery
"battery" = {
format = "{icon} {power:.0f}W";
format-icons = [
"󰂃"
"󰁺"
"󰁻"
"󰁼"
"󰁽"
"󰁾"
"󰁿"
"󰂀"
"󰂁"
"󰂂"
"󰁹"
];
interval = 5;
states = {
critical = 15;
warning = 30;
};
on-click = power; # Toggle power-saver mode
};
}; };
}; };
}; };
};
# TODO: Convert to writeShellApplication # TODO: Convert to writeShellApplication
### SCRIPTS ### ### SCRIPTS ###
#?? text #?? text
#?? tooltip #?? tooltip
#?? class #?? class
home.file = { home.file = {
# Return inhibit idle status # Return inhibit idle status
".config/waybar/scripts/inhibitor.sh" = { ".config/waybar/scripts/inhibitor.sh" = {
executable = true; executable = true;
text = '' text = ''
#! /usr/bin/env ${bash} #! /usr/bin/env ${bash}
if ${pgrep} systemd-inhibit &> /dev/null; then if ${pgrep} systemd-inhibit &> /dev/null; then
${echo} 󰅶 ${echo} 󰅶
${echo} Enabled ${echo} Enabled
${echo} enabled ${echo} enabled
else else
${echo} 󰾪 ${echo} 󰾪
${echo} Disabled ${echo} Disabled
${echo} disabled ${echo} disabled
fi fi
''; '';
}; };
# Return tailscale status # Return tailscale status
".config/waybar/scripts/vm.sh" = { ".config/waybar/scripts/vm.sh" = {
executable = true; executable = true;
text = '' text = ''
#! /usr/bin/env ${bash} #! /usr/bin/env ${bash}
case "$(virsh domstate myndows)" in case "$(virsh domstate myndows)" in
'running') 'running')
${echo} ${echo}
${echo} Online ${echo} Online
${echo} online;; ${echo} online;;
'paused') 'paused')
${echo} ${echo}
${echo} Paused ${echo} Paused
${echo} paused;; ${echo} paused;;
'shut off') 'shut off')
${echo} ${echo}
${echo} Offline ${echo} Offline
${echo} offline;; ${echo} offline;;
*) *)
${echo} ${echo}
${echo} Unknown ${echo} Unknown
${echo} unknown;; ${echo} unknown;;
esac esac
''; '';
}; };
# Return tailscale status # Return tailscale status
".config/waybar/scripts/vpn.sh" = { ".config/waybar/scripts/vpn.sh" = {
executable = true; executable = true;
text = '' text = ''
#! /usr/bin/env ${bash} #! /usr/bin/env ${bash}
if [[ $(${tailscale} status --json | ${jq} .ExitNodeStatus.Online) == 'true' ]]; then if [[ $(${tailscale} status --json | ${jq} .ExitNodeStatus.Online) == 'true' ]]; then
${echo} 󰖂 ${echo} 󰖂
${echo} Connected ${echo} Connected
${echo} connected ${echo} connected
else else
${echo} 󰖂 ${echo} 󰖂
${echo} Disconnected ${echo} Disconnected
${echo} disconnected ${echo} disconnected
fi fi
''; '';
};
}; };
}; };
}; };

View file

@ -143,15 +143,6 @@ in {
libnotify libnotify
power-profiles-daemon power-profiles-daemon
]) ])
(bash "remote" [
argc
coreutils
freerdp3
iputils
libnotify
libvirt
remmina
])
(bash "scratchpad" [ (bash "scratchpad" [
coreutils coreutils
libnotify libnotify
@ -175,6 +166,14 @@ in {
jq jq
libnotify libnotify
]) ])
(bash "vm" [
coreutils
freerdp3
iputils
libnotify
libvirt
remmina
])
(bash "vpn" [ (bash "vpn" [
gnused gnused
jq jq

View file

@ -1,73 +0,0 @@
#! /usr/bin/env bash
# @describe Wrapper for connecting to remote desktops
#
# https://github.com/sigoden/argc
# @meta combine-shorts
# @option -C --client=remmina Remote desktop client to connect with (remmina or <x|w|sdl>-freerdp)
# @option -P --password Password to connect with
# @option -S --scale=100 Set FreeRDP resolution scale
# @option -U --username! Username to connect with
# @flag -v --vm Handle libvirt VM domain state for connection
# @arg host! Remote host/VM to connect to
eval "$(argc --argc-eval "$0" "$@")"
# Handle VM state
#!! Requires libvirt networking with hostname resolution
if [[ "${argc_vm:-}" ]]; then
state="$(virsh domstate "${argc_host:-}")"
if [[ "$state" == "paused" ]]; then
virsh resume "${argc_host:-}"
notify-send "> remote" "${argc_host:-} resumed" --urgency low
elif [[ "$state" == "shut off" ]]; then
virsh start "${argc_host:-}"
notify-send "> remote" "${argc_host:-} starting..." --urgency low
# Wait for guest to become available
#!! Requires ICMP firewall access on guest
c=0
while ! ping -c 1 "${argc_host:-}"; do
if ((c > 60)); then
notify-send "> remote" "${argc_host:-} timed out" --urgency critical
exit 1
fi
((c += 1))
sleep 1
done
else
notify-send "> remote" "${argc_host:-} online" --urgency low
fi
fi
if [[ "${argc_client:-}" == "remmina" ]]; then
remmina --connect "rdp://${argc_username:-}:${argc_password:-}@${argc_host:-}"
elif [[ "${argc_client:-}" =~ ^.+freerdp$ ]]; then
export SDL_VIDEODRIVER=wayland
flags=(
"/cert:ignore"
"/v:${argc_host:-}"
"/u:${argc_username:-}"
"/p:${argc_password:-}"
"/kbd:remap:015b=0154" # VK_LWIN=<00> #?? xfreerdp /list:kbd-scancode
"/scale:${argc_scale:-}"
"/dynamic-resolution"
"/sound"
"+auto-reconnect"
"+clipboard"
"+menu-anims"
"-grab-keyboard"
"-grab-mouse"
)
"${argc_client:-}" "${flags[@]}"
fi
# Suspend VM after connection ends
if [[ "${argc_vm:-}" ]]; then
virsh suspend "${argc_host:-}"
notify-send "> remote" "${argc_host:-} paused" --urgency low
fi

View file

@ -0,0 +1,57 @@
#! /usr/bin/env bash
# Start/resume VM if needed and launch viewer
#?? man xfreerdp
state="$(virsh domstate myndows)"
if [[ "$state" == 'paused' ]]; then
virsh resume myndows
notify-send '> vm' 'Resumed' --urgency low
elif [[ "$state" == 'shut off' ]]; then
virsh start myndows
notify-send '> vm' 'Starting...' --urgency low
# Wait for guest to become available
#!! Requires ICMP firewall access on guest
while ! ping -c 1 myndows; do
sleep 1
done
else
notify-send '> vm' 'Online' --urgency low
fi
flags=(
'/cert:ignore'
'/v:myndows'
'/u:Myned'
'/p:'
'/kbd:remap:015b=0154' # VK_LWIN=<00> #?? xfreerdp /list:kbd-scancode
'/dynamic-resolution'
'/sound'
'+auto-reconnect'
'+clipboard'
'+menu-anims'
'-grab-keyboard'
'-grab-mouse'
)
if [[ "${1-}" == '-s' ]]; then
SDL_VIDEODRIVER=wayland sdl-freerdp "${flags[@]}" "${@:2}"
virsh suspend myndows
notify-send '> vm' 'Paused' --urgency low
elif [[ "${1-}" == '-w' ]]; then
wlfreerdp "${flags[@]}" "${@:2}"
virsh suspend myndows
notify-send '> vm' 'Paused' --urgency low
elif [[ "${1-}" == '-x' ]]; then
xfreerdp "${flags[@]}" "${@:2}"
virsh suspend myndows
notify-send '> vm' 'Paused' --urgency low
elif [[ "${1-}" == '-e' ]]; then
"$@"
virsh suspend myndows
notify-send '> vm' 'Paused' --urgency low
else
"$@"
fi

View file

@ -1,11 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 8E6j8Q 8osU9NmgeeyA6MiQv1gNNDFvAheWZINmFoxTPgsr1Dw
OjviEydBFd1u9doZYGDdqQkMYe4pq7Q9U2qqBTqEcwY
-> ssh-ed25519 sfxzoQ 4ve1W5A9VYReikSUNX2J5hRSvQXvteVl5AXL+rH5tHw
cA1A8vrUXexDu4Z67TmUoHyRqKbC4PIrKRlb5PZyWbg
-> ssh-ed25519 g5GcDQ zhhW9p+0Bgs24yLBZgl51mKyYuZwm9sbj7UWPt5/ZTw
pYYHhUX7VVVkoB1EewK27cacZf4eNZJg73zogfQbTVg
-> ssh-ed25519 T/dATA nhTYHjuLQxq9Kn2xHLpPNOYiAnEsut+6pxY35ooMAik
Dgr+wBPVI9lD2+SLsvkom+0WJ3XlRZsysMQoMjVeCZA
--- 234YbLb3XbZts393OGxe2Gmxrup7cbcQGXAb5gQLrhQ
Ëú0gÿŸ(­]/u&*EǵijeæðtAP¦áŽ—Üîö¸ˆéäÈ ™åýZ8Ÿ*

View file

@ -55,7 +55,6 @@ in {
"desktop/bitwarden/client_secret".publicKeys = desktop; "desktop/bitwarden/client_secret".publicKeys = desktop;
"desktop/users/myned.pass".publicKeys = desktop; "desktop/users/myned.pass".publicKeys = desktop;
"desktop/users/root.pass".publicKeys = desktop; "desktop/users/root.pass".publicKeys = desktop;
"desktop/vm/myndows.pass".publicKeys = desktop;
### SBC ### SBC
"sbc/borgmatic/borgbase.mypi3".publicKeys = sbc; "sbc/borgmatic/borgbase.mypi3".publicKeys = sbc;