From 552a8cbadf864854ee25826ba568349fa5d89dd1 Mon Sep 17 00:00:00 2001 From: hesam-init Date: Thu, 4 Apr 2024 04:24:23 +0330 Subject: [PATCH] feat: swayosd startup shell and new style --- configs/hyprland/hypr/configs/autostart.conf | 2 +- .../variants/rounding-all-blur.conf | 1 + .../hyprland/hypr/scripts/startup/swayosd.sh | 5 +++ .../hyprland/hypr/scripts/swayosd-launch.sh | 41 ------------------- .../hyprland/hypr/scripts/waybar-toggle.sh | 4 +- configs/hyprland/scripts/env.sh | 6 ++- .../hyprland/scripts/utils/watcher/main.sh | 2 - configs/hyprland/swayosd/style.css | 4 +- configs/hyprland/waybar/river/style.css | 2 +- .../hyprland/waybar/style/modules/taskbar.css | 4 ++ 10 files changed, 21 insertions(+), 50 deletions(-) create mode 100755 configs/hyprland/hypr/scripts/startup/swayosd.sh delete mode 100755 configs/hyprland/hypr/scripts/swayosd-launch.sh diff --git a/configs/hyprland/hypr/configs/autostart.conf b/configs/hyprland/hypr/configs/autostart.conf index 6a3bdd8..b423b2f 100644 --- a/configs/hyprland/hypr/configs/autostart.conf +++ b/configs/hyprland/hypr/configs/autostart.conf @@ -6,10 +6,10 @@ exec-once = dbus-update-activation-environment --all & exec-once = ~/.config/hypr/scripts/startup/pipewire.sh & exec-once = ~/.config/hypr/scripts/startup/keyring.sh & exec-once = wl-paste --watch cliphist store & -exec-once = swayosd-server & exec-once = ~/.config/hypr/scripts/startup/dunst.sh & exec-once = ~/.config/hypr/scripts/wallpaper/wallpaper-daemon.sh & +exec-once = ~/.config/hypr/scripts/startup/swayosd.sh & exec-once = ~/.config/hypr/scripts/startup/waybar.sh & # exec-once = avizo-service & diff --git a/configs/hyprland/hypr/configs/decoration/variants/rounding-all-blur.conf b/configs/hyprland/hypr/configs/decoration/variants/rounding-all-blur.conf index efc362a..7bd160c 100644 --- a/configs/hyprland/hypr/configs/decoration/variants/rounding-all-blur.conf +++ b/configs/hyprland/hypr/configs/decoration/variants/rounding-all-blur.conf @@ -13,6 +13,7 @@ decoration { new_optimizations = on ignore_opacity = true xray = false + # blurls = swayosd # blurls = waybar } diff --git a/configs/hyprland/hypr/scripts/startup/swayosd.sh b/configs/hyprland/hypr/scripts/startup/swayosd.sh new file mode 100755 index 0000000..b47359d --- /dev/null +++ b/configs/hyprland/hypr/scripts/startup/swayosd.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +source ~/.config/scripts/env.sh + +exec $WATCHER -a "$SWAYOSD_DAEMON" -d "$SWAYOSD_DIR" -p "swayosd-server" diff --git a/configs/hyprland/hypr/scripts/swayosd-launch.sh b/configs/hyprland/hypr/scripts/swayosd-launch.sh deleted file mode 100755 index 20b559a..0000000 --- a/configs/hyprland/hypr/scripts/swayosd-launch.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -source ~/.config/scripts/env.sh - -if [[ ! -d "$WAYBAR_DIR" ]]; then - echo "Error: Configuration directory or files missing!" - exit 1 -fi - -pkill waybar - -sleep 1 - -while true; do - logger -i "$0: Starting waybar in the background..." - exec $WAYBAR_LAUNCHER & - waybar_pid=$! - - logger -i "$0: Started waybar PID=$waybar_pid. Waiting for modifications..." - inotifywait $WAYBAR_INOTIFY_EVENTS "$WAYBAR_DIR" 2>&1 | logger -i - - if [[ $? -ne 0 ]]; then - echo "Error: inotifywait failed!" - exit 1 - fi - - logger -i "$0: inotifywait returned $?. Killing all waybar processes..." - pkill waybar 2>&1 | logger -i - - if [[ $? -ne 0 ]]; then - echo "Error: Killing waybar failed!" - exit 1 - fi - - wait $waybar_pid - if [[ $? -ne 0 ]]; then - echo "Warning: Waybar process exited unexpectedly!" - fi - - logger -i "$0: killall waybar returned $?. Wait a sec..." -done diff --git a/configs/hyprland/hypr/scripts/waybar-toggle.sh b/configs/hyprland/hypr/scripts/waybar-toggle.sh index 95b2d8f..6608b44 100755 --- a/configs/hyprland/hypr/scripts/waybar-toggle.sh +++ b/configs/hyprland/hypr/scripts/waybar-toggle.sh @@ -7,7 +7,7 @@ WAYBAR_PID=$(pgrep -x waybar) if [ -n "$WAYBAR_PID" ]; then pkill waybar elif [ $WAYBAR_DEV_MODE = true ]; then - GTK_DEBUG=interactive exec $WAYBAR_LAUNCHER + GTK_DEBUG=interactive exec $WATCHER -a "$WAYBAR_LAUNCHER" -d "$WAYBAR_DIR" -p "waybar" else - exec $WAYBAR_LAUNCHER + exec $WATCHER -a "$WAYBAR_LAUNCHER" -d "$WAYBAR_DIR" -p "waybar" fi diff --git a/configs/hyprland/scripts/env.sh b/configs/hyprland/scripts/env.sh index efa979c..c576ff4 100755 --- a/configs/hyprland/scripts/env.sh +++ b/configs/hyprland/scripts/env.sh @@ -6,7 +6,7 @@ export WATCHER="$HOME/.config/scripts/utils/watcher/main.sh" # waybar env : export WAYBAR_DEV_MODE=false export WAYBAR_THEME="river" -export WAYBAR_DIR="$HOME/.config/waybar/$WAYBAR_THEME" +export WAYBAR_DIR="$HOME/.config/waybar" export WAYBAR_LAUNCHER="waybar -c $WAYBAR_DIR/config.jsonc -s $WAYBAR_DIR/style.css" # wallpaper configs - swaybg, swww, mpvpaper : @@ -16,6 +16,10 @@ export LIVE_WALLPAPERS_DIR="$HOME/Wallpapers/Live" export SWWW_FPS=144 export SWWW_DURATION=2 +# swayosd configs : +export SWAYOSD_DAEMON="swayosd-server" +export SWAYOSD_DIR="$HOME/.config/swayosd" + # rofi launcher : export LAUNCHER_TYPE="2" export CLIPBOARD_TYPE="1" diff --git a/configs/hyprland/scripts/utils/watcher/main.sh b/configs/hyprland/scripts/utils/watcher/main.sh index 61e8ca6..f08bb63 100755 --- a/configs/hyprland/scripts/utils/watcher/main.sh +++ b/configs/hyprland/scripts/utils/watcher/main.sh @@ -26,7 +26,6 @@ fi start_application() { echo "Starting $process_name..." pkill $process_name - sleep 1 exec $app_name } @@ -34,7 +33,6 @@ restart_application() { if pgrep -x "$process_name" >/dev/null; then echo "Restarting $process_name..." pkill $process_name - sleep 1 $app_name & else echo "$app_name is not currently running." diff --git a/configs/hyprland/swayosd/style.css b/configs/hyprland/swayosd/style.css index 87093d3..1376e6f 100644 --- a/configs/hyprland/swayosd/style.css +++ b/configs/hyprland/swayosd/style.css @@ -1,8 +1,8 @@ window#osd { padding: 12px 20px; - border-radius: 120px; + border-radius: 12px; border: none; - background: alpha(@theme_bg_color, 0.8); + background: alpha(@theme_bg_color, 1); } window#osd #container { diff --git a/configs/hyprland/waybar/river/style.css b/configs/hyprland/waybar/river/style.css index b0c7f35..ab3b82c 100644 --- a/configs/hyprland/waybar/river/style.css +++ b/configs/hyprland/waybar/river/style.css @@ -6,7 +6,7 @@ window { } window>box { - min-height: 28px; + min-height: 30px; padding: 6px; padding-bottom: 2px; } \ No newline at end of file diff --git a/configs/hyprland/waybar/style/modules/taskbar.css b/configs/hyprland/waybar/style/modules/taskbar.css index 79db130..2a068ed 100644 --- a/configs/hyprland/waybar/style/modules/taskbar.css +++ b/configs/hyprland/waybar/style/modules/taskbar.css @@ -21,6 +21,10 @@ background-color: #f53c3c; } +#workspaces { + font-size: 10px; +} + #workspaces * { font-size: 10px; }