Fixes directory structure
This commit is contained in:
42
.config/hypr/scripts/color-picker.sh
Executable file
42
.config/hypr/scripts/color-picker.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Pick the color in HEX
|
||||
HEX="$(hyprpicker --no-fancy --format hex)"
|
||||
|
||||
# User cancelled
|
||||
[[ -z "$HEX" ]] && exit 0
|
||||
|
||||
# Remove leading '#'
|
||||
HEX="${HEX#\#}"
|
||||
|
||||
# Convert HEX -> RGB
|
||||
R=$((16#${HEX:0:2}))
|
||||
G=$((16#${HEX:2:2}))
|
||||
B=$((16#${HEX:4:2}))
|
||||
|
||||
HEX_OUT="#$HEX"
|
||||
RGB_OUT="$R, $G, $B"
|
||||
|
||||
# Copy HEX to clipboard
|
||||
printf "%s" "$HEX_OUT" | wl-copy
|
||||
|
||||
# Notify
|
||||
# notify-send \
|
||||
# --app-name="Hyprpicker" \
|
||||
# --icon="applications-graphics" \
|
||||
# "🎨 Color Picked" \
|
||||
# "HEX: $HEX_OUT\nRGB: $RGB_OUT\n\nHEX copied to clipboard"
|
||||
|
||||
ICON="/tmp/hyprpicker-color.png"
|
||||
|
||||
magick -size 64x64 "xc:$HEX_OUT" "$ICON"
|
||||
|
||||
notify-send \
|
||||
--app-name="Hyprpicker" \
|
||||
--icon="$ICON" \
|
||||
"🎨 Color Picked" \
|
||||
"\nHEX: $HEX_OUT\nRGB: $RGB_OUT\n\nHEX copied to clipboard"
|
||||
|
||||
rm -f "$ICON"
|
||||
41
.config/hypr/scripts/hyprlock-media.sh
Executable file
41
.config/hypr/scripts/hyprlock-media.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Outputs current media status for hyprlock's label widget.
|
||||
# Format: <icon> Artist - Title [progress bar] m:ss/m:ss
|
||||
|
||||
if ! command -v playerctl &>/dev/null; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
status=$(playerctl status 2>/dev/null)
|
||||
|
||||
case "$status" in
|
||||
Playing) icon="⏵" ;;
|
||||
Paused) icon="⏸" ;;
|
||||
*) exit 0 ;; # nothing playing / no player -> blank label
|
||||
esac
|
||||
|
||||
artist=$(playerctl metadata artist 2>/dev/null)
|
||||
title=$(playerctl metadata title 2>/dev/null)
|
||||
|
||||
position=$(playerctl position 2>/dev/null | cut -d. -f1)
|
||||
length_us=$(playerctl metadata mpris:length 2>/dev/null)
|
||||
length=$((length_us / 1000000))
|
||||
|
||||
format_time() {
|
||||
printf '%d:%02d' $(($1 / 60)) $(($1 % 60))
|
||||
}
|
||||
|
||||
bar_width=20
|
||||
if [[ -n "$length" && "$length" -gt 0 && -n "$position" ]]; then
|
||||
filled=$((position * bar_width / length))
|
||||
((filled > bar_width)) && filled=$bar_width
|
||||
empty=$((bar_width - filled))
|
||||
bar="$(printf '█%.0s' $(seq 1 $filled 2>/dev/null))$(printf '░%.0s' $(seq 1 $empty 2>/dev/null))"
|
||||
time_str="$(format_time "$position")/$(format_time "$length")"
|
||||
else
|
||||
bar=""
|
||||
time_str=""
|
||||
fi
|
||||
|
||||
echo "$icon $artist - $title $bar $time_str"
|
||||
12
.config/hypr/scripts/launch-waybar.sh
Executable file
12
.config/hypr/scripts/launch-waybar.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CONFIG="$HOME/.config/hypr/waybar/config"
|
||||
STYLE="$HOME/.config/hypr/waybar/style.css"
|
||||
|
||||
if [[ $(pgrep -x "waybar") = "waybar" ]]; then
|
||||
killall waybar
|
||||
else
|
||||
if [[ $(pgrep -x "waybar") = "" ]]; then
|
||||
waybar -c $CONFIG -s $STYLE >/dev/null 2>&1 &
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user