summaryrefslogtreecommitdiff
path: root/dotfiles/hyprland/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/hyprland/.local/bin')
-rwxr-xr-xdotfiles/hyprland/.local/bin/power-menu45
-rwxr-xr-xdotfiles/hyprland/.local/bin/screenshot23
-rwxr-xr-xdotfiles/hyprland/.local/bin/waybar-disk7
-rwxr-xr-xdotfiles/hyprland/.local/bin/waybar-netspeed2
4 files changed, 31 insertions, 46 deletions
diff --git a/dotfiles/hyprland/.local/bin/power-menu b/dotfiles/hyprland/.local/bin/power-menu
deleted file mode 100755
index 878a17b..0000000
--- a/dotfiles/hyprland/.local/bin/power-menu
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/bash
-# Power menu using wofi
-# Dupre theme with Nerd Font icons
-
-options="󰌾\n󰍃\n󰒲\n󰖔\n󰜉\n󰐥"
-
-selected=$(echo -e "$options" | wofi --dmenu \
- --cache-file /dev/null \
- --prompt "" \
- --hide-scroll \
- --hide-search \
- --gtk-dark \
- --layer overlay \
- --width 700 \
- --height 700 \
- --columns 3 \
- --lines 2 \
- --style ~/.config/wofi/power-menu.css \
- --conf /dev/null)
-
-case "$selected" in
- "󰌾")
- hyprlock
- ;;
- "󰍃")
- notify-send "Power Menu" "Logout disabled for testing"
- # hyprctl dispatch exit
- ;;
- "󰒲")
- notify-send "Power Menu" "Suspend disabled for testing"
- # systemctl suspend
- ;;
- "󰖔")
- notify-send "Power Menu" "Hibernate disabled for testing"
- # systemctl hibernate
- ;;
- "󰜉")
- notify-send "Power Menu" "Reboot disabled for testing"
- # systemctl reboot
- ;;
- "󰐥")
- notify-send "Power Menu" "Shutdown disabled for testing"
- # systemctl poweroff
- ;;
-esac
diff --git a/dotfiles/hyprland/.local/bin/screenshot b/dotfiles/hyprland/.local/bin/screenshot
new file mode 100755
index 0000000..45925c6
--- /dev/null
+++ b/dotfiles/hyprland/.local/bin/screenshot
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Screenshot tool with fuzzel menu
+# Usage: screenshot [region|fullscreen]
+
+DIR="$HOME/pictures/screenshots"
+mkdir -p "$DIR"
+FILE="$DIR/$(date +%Y-%m-%d_%H%M%S).png"
+
+# Capture
+case "${1:-region}" in
+ region) grim -g "$(slurp)" "$FILE" || exit 1 ;;
+ fullscreen) grim "$FILE" || exit 1 ;;
+esac
+
+# Menu
+CHOICE=$(printf '󰅍 Copy Path\n󰋩 Copy Image\n󰏫 Annotate' | \
+ fuzzel --dmenu --prompt "Screenshot: " --width 20 --lines 3)
+
+case "$CHOICE" in
+ *"Copy Path"*) echo -n "$FILE" | wl-copy --type text/plain ;;
+ *"Copy Image"*) wl-copy --type image/png < "$FILE" ;;
+ *"Annotate"*) satty --filename "$FILE" --output-filename "$FILE" --copy-command wl-copy ;;
+esac
diff --git a/dotfiles/hyprland/.local/bin/waybar-disk b/dotfiles/hyprland/.local/bin/waybar-disk
new file mode 100755
index 0000000..6050653
--- /dev/null
+++ b/dotfiles/hyprland/.local/bin/waybar-disk
@@ -0,0 +1,7 @@
+#!/bin/sh
+# Waybar disk usage module with warning/critical states
+PCT=$(df --output=pcent / | tail -1 | tr -d ' %')
+CLASS=""
+[ "$PCT" -ge 80 ] && CLASS="warning"
+[ "$PCT" -ge 90 ] && CLASS="critical"
+printf '{"text": "%s%%", "class": "%s", "tooltip": "Root: %s%% used"}\n' "$PCT" "$CLASS" "$PCT"
diff --git a/dotfiles/hyprland/.local/bin/waybar-netspeed b/dotfiles/hyprland/.local/bin/waybar-netspeed
index 97e8e5e..a6296b0 100755
--- a/dotfiles/hyprland/.local/bin/waybar-netspeed
+++ b/dotfiles/hyprland/.local/bin/waybar-netspeed
@@ -6,7 +6,7 @@
INTERFACE=$(ip route | awk '/default/ {print $5; exit}')
if [ -z "$INTERFACE" ]; then
- echo '{"text": "󰤭 Disconnected", "tooltip": "No network connection", "class": "disconnected"}'
+ echo '{"text": "󰤭 Offline", "tooltip": "No network connection", "class": "disconnected"}'
exit 0
fi