Add Sway session with Waybar and split configs for Hyprland

This commit is contained in:
Fabio Scotto di Santolo
2026-03-31 17:04:05 +02:00
parent 8679bfadc8
commit e12b1b368b
19 changed files with 533 additions and 32 deletions

View File

@@ -3,6 +3,25 @@
set -eu
case "${XDG_CURRENT_DESKTOP:-}" in
*sway*|*Sway*)
exec swaylock -f \
--color 000000ff \
--inside-color 1f1f28ff \
--ring-color 2f4058ff \
--separator-color 3a3a46ff \
--line-color 00000000 \
--key-hl-color 6daeeaff \
--bs-hl-color c7162bff \
--inside-ver-color 1f1f28ff \
--inside-wrong-color 1f1f28ff \
--ring-ver-color 4a90d9ff \
--ring-wrong-color c7162bff \
--text-color d0d0d0ff \
--text-ver-color d0d0d0ff \
--text-wrong-color d0d0d0ff \
--indicator \
--clock
;;
*Hyprland*|*hyprland*)
exec hyprlock
;;
@@ -15,6 +34,10 @@ if command -v hyprlock >/dev/null 2>&1; then
exec hyprlock
fi
if command -v swaylock >/dev/null 2>&1; then
exec swaylock -f
fi
if [ -x "$HOME/.config/i3/scripts/lockscreen" ]; then
exec "$HOME/.config/i3/scripts/lockscreen"
fi

View File

@@ -17,6 +17,9 @@ case "$choice" in
;;
Logout)
case "${XDG_CURRENT_DESKTOP:-}" in
*sway*|*Sway*)
swaymsg exit
;;
*Hyprland*|*hyprland*)
hyprctl dispatch exit
;;

View File

@@ -0,0 +1,27 @@
#!/bin/sh
[ -r /etc/profile ] && . /etc/profile
[ -r "$HOME/.profile" ] && . "$HOME/.profile"
[ -r "$HOME/.config/sway/session-env" ] && . "$HOME/.config/sway/session-env"
set -eu
session_name=sway
export XDG_CURRENT_DESKTOP="$session_name"
export XDG_SESSION_DESKTOP="$session_name"
export XDG_SESSION_TYPE=wayland
if [ "${SWAY_UNSUPPORTED_GPU:-0}" = "1" ]; then
set -- sway --unsupported-gpu
else
set -- sway
fi
exec dbus-run-session sh -eu -c '
umask 077
printf "%s\n" "$DBUS_SESSION_BUS_ADDRESS" > "$HOME/.dbus-session-bus-address"
eval "$(ssh-agent -s)" >/dev/null
gpgconf --launch gpg-agent
exec "$@"
' sh "$@"