mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-26 18:54:59 +08:00
feat: write dock-on-all-monitors script and install as a package
This commit is contained in:
parent
2060b91d54
commit
0d5ee75dba
2 changed files with 22 additions and 0 deletions
|
|
@ -12,6 +12,9 @@ let
|
|||
builtins.readFile ./scripts/toggle_oppacity.sh
|
||||
);
|
||||
ascii = pkgs.writeScriptBin "ascii" (builtins.readFile ./scripts/ascii.sh);
|
||||
dock-on-all-monitors = pkgs.writeScriptBin "dock-on-all-monitors" (
|
||||
builtins.readFile ./scripts/dock-on-all-monitors.sh
|
||||
);
|
||||
in
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
|
|
@ -25,5 +28,6 @@ in
|
|||
toggle_blur
|
||||
toggle_oppacity
|
||||
ascii
|
||||
dock-on-all-monitors
|
||||
];
|
||||
}
|
||||
|
|
|
|||
18
modules/home/scripts/scripts/dock-on-all-monitors.sh
Executable file
18
modules/home/scripts/scripts/dock-on-all-monitors.sh
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
last="$(hyprctl monitors | grep Monitor | sed 's/Monitor //g' | awk '{print $3}' | sed 's/)://g' | sed ':a;N;$!ba;s/\n/ /g' | awk '{print $NF}')"
|
||||
|
||||
hyprctl dispatch focusmonitor 0
|
||||
setsid nwg-dock-hyprland -m -l top &
|
||||
|
||||
sleep 0.5
|
||||
|
||||
((last = last + 1)) # make number be one higher so it also takes last window (this is required as we used `i < "$last"`)
|
||||
for ((i = 0; i < "$last"; i++)); do
|
||||
hyprctl dispatch focusmonitor "$i"
|
||||
setsid nwg-dock-hyprland -m -l top -c 'bemenu-run -l 5' &
|
||||
sleep 0.5
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue