home/hyprland: reload waybar with clamshell script
Some checks failed
nix-build / default-build (push) Has been cancelled
nix-build / fallarbor-build (push) Has been cancelled
nix-build / lavaridge-build (push) Has been cancelled
nix-build / mauville-build (push) Has been cancelled
nix-build / petalburg-build (push) Has been cancelled
nix-build / rustboro-build (push) Has been cancelled
nix-check / fmt-check (push) Has been cancelled
nix-check / eval-check (push) Has been cancelled

This commit is contained in:
Aly Raffauf 2024-07-21 12:04:52 -04:00
parent 56427dd1aa
commit 147a653e6b

View file

@ -6,6 +6,7 @@
}: let }: let
cfg = config.ar.home; cfg = config.ar.home;
hyprctl = lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl"; hyprctl = lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl";
pkill = lib.getExe' pkgs.procps "pkill";
virtKeyboard = lib.getExe' pkgs.squeekboard "squeekboard"; virtKeyboard = lib.getExe' pkgs.squeekboard "squeekboard";
in { in {
clamshell = pkgs.writeShellScript "hyprland-clamshell" '' clamshell = pkgs.writeShellScript "hyprland-clamshell" ''
@ -13,6 +14,7 @@ in {
if [ "$1" == "on" ]; then if [ "$1" == "on" ]; then
if [ $NUM_MONITORS -gt 1 ]; then if [ $NUM_MONITORS -gt 1 ]; then
${hyprctl} keyword monitor "eDP-1, disable" ${hyprctl} keyword monitor "eDP-1, disable"
${pkill} -SIGUSR2 waybar
fi fi
elif [ "$1" == "off" ]; then elif [ "$1" == "off" ]; then
${ ${
@ -20,6 +22,7 @@ in {
(monitor: ''${hyprctl} keyword monitor "${monitor}"'') (monitor: ''${hyprctl} keyword monitor "${monitor}"'')
cfg.desktop.hyprland.laptopMonitors cfg.desktop.hyprland.laptopMonitors
} }
${pkill} -SIGUSR2 waybar
fi fi
''; '';