diff --git a/backup.sh b/backup.sh index b95d473..96934f9 100755 --- a/backup.sh +++ b/backup.sh @@ -58,6 +58,10 @@ cp -r $HOME/.config/i3/ . # sway rm -rf $GIT_DIR/sway cp -r $HOME/.config/sway/ . +outputs=$(swaymsg -t get_outputs) +width=$(echo $outputs | jq -r .[0].modes.[0].width) +height=$(echo $outputs | jq -r .[0].modes.[0].height) +sed -i "s/set \$lockwall \"swaylock -i ~\/\.config\/sway\/backgrounds\/${width}x${height}\.png\"/set \$lockwall \"swaylock -i ~\/\.config\/sway\/backgrounds\/widthxheight\.png\"/g" $GIT_DIR/sway/config # greetd (for sway) if [ -d /etc/greetd ]; then diff --git a/restore.sh b/restore.sh index d5ebd54..20001d6 100755 --- a/restore.sh +++ b/restore.sh @@ -42,6 +42,10 @@ cp -r $GIT_DIR/i3 $HOME/.config/ # sway rm -rf $HOME/.config/sway cp -r $GIT_DIR/sway $HOME/.config/ +outputs=$(swaymsg -t get_outputs) +width=$(echo $outputs | jq -r .[0].modes.[0].width) +height=$(echo $outputs | jq -r .[0].modes.[0].height) +sed -i "s/set \$lockwall \"swaylock -i ~\/\.config\/sway\/backgrounds\/widthxheight\.png\"/set \$lockwall \"swaylock -i ~\/\.config\/sway\/backgrounds\/${width}x${height}\.png\"/g" $HOME/.config/sway/config # greetd (for sway) if [ -d /etc/greetd ]; then @@ -107,6 +111,9 @@ for dir in $(find . -mindepth 1 -maxdepth 1 -type d -name "*.*"); do done done +# WezTerm +wezterm shell-completion --shell fish > ~/.config/fish/completions/wezterm.fish + # VS code mkdir -p $HOME/.config/Code/User/ mkdir -p $HOME/.vscode/ diff --git a/sway/automation.sh b/sway/automation.sh new file mode 100644 index 0000000..a3a5916 --- /dev/null +++ b/sway/automation.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# config file still must be done by hand to take into account rotation and stuff, but this makes the backgrounds images themselves +# TODO: add config generation + +generate() { + magick background.png -resize ${1}x${2}! background-${1}x${2}.png + magick composite -gravity center logo.png background-${1}x${2}.png result-${1}x${2}.png + cp result-${1}x${2}.png ~/.config/sway/backgrounds/${1}x${2}.png + rm background-* + rm result-* +} + +outputs=$(swaymsg -t get_outputs) + +i=0 +while [ "$(echo $outputs | jq -r .[$i])" != "null" ]; do + width=$(echo $outputs | jq -r .[$i].modes.[0].width) + height=$(echo $outputs | jq -r .[$i].modes.[0].height) + generate $width $height + generate $height $width + ((i++)) +done + + + + + + + + + + + + diff --git a/sway/backgrounds/1080x1920.png b/sway/backgrounds/1080x1920.png new file mode 100755 index 0000000..5ab3c93 Binary files /dev/null and b/sway/backgrounds/1080x1920.png differ diff --git a/sway/backgrounds/1440x2560.png b/sway/backgrounds/1440x2560.png new file mode 100755 index 0000000..813a256 Binary files /dev/null and b/sway/backgrounds/1440x2560.png differ diff --git a/sway/backgrounds/1920x1080.png b/sway/backgrounds/1920x1080.png new file mode 100755 index 0000000..9b6b787 Binary files /dev/null and b/sway/backgrounds/1920x1080.png differ diff --git a/sway/backgrounds/2560x1440.png b/sway/backgrounds/2560x1440.png new file mode 100755 index 0000000..b14ca57 Binary files /dev/null and b/sway/backgrounds/2560x1440.png differ diff --git a/sway/config b/sway/config index 1501225..1856dc5 100644 --- a/sway/config +++ b/sway/config @@ -25,7 +25,7 @@ for_window [window_role="pop-up"] floating enable for_window [window_role="task_dialog"] floating enable # shutdown / restart / suspend... -set $lockwall "swaylock -i ~/.config/sway/backgrounds/2560x1440.png" +set $lockwall "swaylock -i ~/.config/sway/backgrounds/widthxheight.png" set $mode_system System (l) lock, (e) logout, (r) reboot, (s) shutdown mode "$mode_system" { diff --git a/sway/config.d/outputs b/sway/config.d/outputs index dd6e647..d2e9c48 100644 --- a/sway/config.d/outputs +++ b/sway/config.d/outputs @@ -1,7 +1,7 @@ output "Acer Technologies EK271U E 14160766B3W01" mode 2560x1440@100hz adaptive_sync on output "Hewlett Packard HP ZR22w CN41250H24" transform 270 +output "AU Optronics 0x463D" mode 1920x1080@60hz output "Acer Technologies EK271U E 14160766B3W01" bg ~/.config/sway/backgrounds/2560x1440.png fill output "Hewlett Packard HP ZR22w CN41250H24" bg ~/.config/sway/backgrounds/1080x1920.png fill - -bindsym Mod4+o output "Acer Technologies EK271U E 14160766B3W01" toggle +output "AU Optronics 0x463D" bg ~/.config/sway/backgrounds/1920x1080.png fill