diff options
Diffstat (limited to 'config/hypr/scripts')
| -rwxr-xr-x | config/hypr/scripts/Dock.sh | 66 | ||||
| -rwxr-xr-x | config/hypr/scripts/KeyHints.sh | 1 | ||||
| -rwxr-xr-x | config/hypr/scripts/Refresh.sh | 5 |
3 files changed, 72 insertions, 0 deletions
diff --git a/config/hypr/scripts/Dock.sh b/config/hypr/scripts/Dock.sh new file mode 100755 index 00000000..c919d573 --- /dev/null +++ b/config/hypr/scripts/Dock.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== +# nwg-dock-hyprland launcher and toggle script + +DOCK_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/nwg-dock-hyprland" + +# Ensure dock configuration and wallust directory exist +mkdir -p "$DOCK_CONFIG_DIR/wallust" 2>/dev/null || true + +# Check if nwg-dock-hyprland is installed +if ! command -v nwg-dock-hyprland >/dev/null 2>&1; then + notify-send -u normal "Dock" "nwg-dock-hyprland is not installed" 2>/dev/null || true + exit 1 +fi + +is_dock_running() { + pgrep -x "nwg-dock-hyprla" >/dev/null 2>&1 || pgrep -x "nwg-dock-hyprland" >/dev/null 2>&1 || pgrep -f "nwg-dock-hyprland" >/dev/null 2>&1 +} + +kill_dock() { + pkill -x "nwg-dock-hyprla" 2>/dev/null || true + pkill -x "nwg-dock-hyprland" 2>/dev/null || true + pkill -f "nwg-dock-hyprland" 2>/dev/null || true +} + +start_dock() { + # Dock configuration: + # -p bottom : bottom dock position + # -x : exclusive zone (moves other windows aside) + # -i 32 : icon size 32 + # -g "kitty-dropterm" : ignores dropdown terminal class + # -c : launcher button command (rofi menu) + # (no -d : no auto-hide) + local launcher_cmd="pkill rofi || rofi -show drun -modi drun,filebrowser,run,window" + nwg-dock-hyprland -p bottom -x -i 32 -g "kitty-dropterm" -c "$launcher_cmd" >/dev/null 2>&1 & +} + +case "${1:-toggle}" in + --restart|restart) + kill_dock + sleep 0.2 + start_dock + ;; + --start|start|activate) + if ! is_dock_running; then + start_dock + fi + ;; + --stop|stop|deactivate) + kill_dock + ;; + --toggle|toggle|*) + if is_dock_running; then + kill_dock + else + start_dock + fi + ;; +esac + +exit 0 diff --git a/config/hypr/scripts/KeyHints.sh b/config/hypr/scripts/KeyHints.sh index 08415dab..cff74da1 100755 --- a/config/hypr/scripts/KeyHints.sh +++ b/config/hypr/scripts/KeyHints.sh @@ -58,6 +58,7 @@ GDK_BACKEND=$BACKEND yad \ " CTRL SHIFT Print" "screenshot timer 10 secs " "(grim)" \ "ALT Print" "Screenshot active window" "active window only" \ "CTRL ALT P" "power-menu" "(wlogout)" \ + "CTRL ALT D" "Toggle dock" "(nwg-dock-hyprland)" \ "CTRL ALT L" "screen lock" "(hyprlock)" \ "CTRL ALT Del" "Hyprland Exit" "(NOTE: Hyprland Will exit immediately)" \ " SHIFT F" "Fullscreen" "Toggles to full screen" \ diff --git a/config/hypr/scripts/Refresh.sh b/config/hypr/scripts/Refresh.sh index 79d9df8b..a9113c6b 100755 --- a/config/hypr/scripts/Refresh.sh +++ b/config/hypr/scripts/Refresh.sh @@ -123,6 +123,11 @@ fi # reload swaync (asynchronous to prevent DBus timeout delays) (swaync-client --reload-config >/dev/null 2>&1 &) +# reload / restart nwg-dock-hyprland if running +if pgrep -x "nwg-dock-hyprla" >/dev/null 2>&1 || pgrep -x "nwg-dock-hyprland" >/dev/null 2>&1 || pgrep -f "nwg-dock-hyprland" >/dev/null 2>&1; then + "${SCRIPTSDIR}/Dock.sh" --restart >/dev/null 2>&1 & +fi + # Relaunching rainbow borders based on selected mode sleep 1 rainbow_mode_file="${UserScripts}/rainbow-borders.mode" |
