Move scripts in to dedicated folder

This commit is contained in:
Fabio Scotto di Santolo
2025-08-07 19:00:26 +02:00
parent 5ac0ff85e7
commit 151de63721
3 changed files with 44 additions and 1 deletions

View File

@@ -50,7 +50,7 @@ output * bg ~/.config/sway/wallpaper.jpg fill
# You can get the names of your outputs by running: swaymsg -t get_outputs # You can get the names of your outputs by running: swaymsg -t get_outputs
### Idle configuration ### Idle configuration
set $lockman exec bash ~/.config/sway/lockman.sh set $ exec bash ~/.config/sway/scripts/lockman.sh
exec swayidle -w \ exec swayidle -w \
timeout 300 'swaylock -f' \ timeout 300 'swaylock -f' \
timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \

View File

@@ -0,0 +1,43 @@
#!/bin/sh
CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/wlr-layouts"
LAYOUT_TOOL="wlr-randr"
mkdir -p "$CONFIG_DIR"
# Verifica che fzf sia installato
if ! command -v fzf > /dev/null 2>&1; then
echo "Errore: fzf non è installato." >&2
exit 1
fi
# Verifica che fyi sia installato
if ! command -v fyi > /dev/null 2>&1; then
echo "Errore: fyi non è installato." >&2
exit 1
fi
# Funzione: applica layout selezionato
apply_layout() {
local layout_file="$1"
if [ -f "$layout_file" ]; then
while IFS= read -r line; do
[ -n "$line" ] && eval "$line"
done < "$layout_file"
fyi "Applied layout: $(basename "$layout_file")"
else
echo "File layout non trovato: $layout_file" >&2
exit 2
fi
}
# Seleziona layout via fzf con preview
SELECTED_FILE=$(find "$CONFIG_DIR" -type f -name '*.layout' \
| fzf --prompt="Select layout > " \
--preview="cat {}" \
--preview-window=down:50%:wrap)
# Applica se selezionato
if [ -n "$SELECTED_FILE" ]; then
apply_layout "$SELECTED_FILE"
fi