more cleanup

This commit is contained in:
xunuwu 2025-01-12 15:48:32 +01:00
parent 6cf86a3827
commit 88f9bd9dd7
Signed by: xun
SSH key fingerprint: SHA256:Uot/1WoAjWAeqLOHA5vYy4phhVydsH7jCPmBjaPZfgI
36 changed files with 59 additions and 627 deletions

View file

@ -10,7 +10,6 @@
../common/wob.nix
../common/wl-clipboard.nix
./waybar.nix
./headless-remote.nix
];
services.cliphist = {
@ -99,7 +98,6 @@
in
lib.mkOptionDefault (
{
"${mod}+m" = "exec ${pkgs.nwg-launchers}/bin/nwggrid";
"${mod}+n" = "exec ${pkgs.swaynotificationcenter}/bin/swaync-client -t";
"${mod}+Shift+v" = "exec ${lib.getExe pkgs.cliphist} list | ${lib.getExe pkgs.wofi} --dmenu | ${lib.getExe pkgs.cliphist} decode | ${pkgs.wl-clipboard}/bin/wl-copy";
"${mod}+Ctrl+${dir.left}" = "focus output left";

View file

@ -1,41 +0,0 @@
{pkgs, ...}: {
## TODO MAKE THIS REMOVE ALL PREV HEADLESS MONITORS
home.packages = [
(pkgs.writeShellApplication {
name = "xun-start-headless";
runtimeInputs = [pkgs.sway pkgs.wayvnc pkgs.jq];
text = ''
headless_numbers() {
swaymsg -t get_outputs | jq -r '.[].name | select (. | startswith("HEADLESS-")) | ltrimstr("HEADLESS-")'
}
new_lines() {
diff <(echo "$1") <(echo "$2") | grep -E "^>" | cut -c3- || true
}
create_output() {
outputs1=$(headless_numbers)
swaymsg create_output >/dev/null
outputs2=$(headless_numbers)
new_lines "$outputs1" "$outputs2"
}
remove_outputs() {
for n in $(headless_numbers); do
swaymsg output "HEADLESS-$n" unplug
done
}
remove_outputs
outputid=$(create_output)
swaymsg output "HEADLESS-$outputid" scale 2
swaymsg output "HEADLESS-$outputid" mode "2400x1080@30Hz"
swaymsg output "HEADLESS-$outputid" position "0 1080" # below primary monitor
wayvnc --gpu -o "HEADLESS-$outputid" 0.0.0.0
'';
})
];
}