mirror of
https://github.com/fscotto/infra.git
synced 2026-07-30 00:30:00 +00:00
Add Hyprland Void desktop profile
This commit is contained in:
29
dotfiles/desktop/.config/hypr/scripts/powermenu.sh
Executable file
29
dotfiles/desktop/.config/hypr/scripts/powermenu.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
choice="$(printf "⏻ Shutdown\n Reboot\n Logout\n Lock\n⏾ Suspend" \
|
||||
| rofi -dmenu \
|
||||
-i \
|
||||
-p "Power" \
|
||||
-theme ~/.config/rofi/config.rasi \
|
||||
-theme-str 'window { width: 20%; location: center; anchor: center; } listview { columns: 1; spacing: 6px; }')"
|
||||
|
||||
[ -z "$choice" ] && exit 0
|
||||
|
||||
case "$choice" in
|
||||
*Lock)
|
||||
hyprlock
|
||||
;;
|
||||
*Logout)
|
||||
hyprctl dispatch exit
|
||||
;;
|
||||
*Suspend)
|
||||
hyprlock &
|
||||
loginctl suspend
|
||||
;;
|
||||
*Reboot)
|
||||
loginctl reboot
|
||||
;;
|
||||
*Shutdown)
|
||||
loginctl poweroff
|
||||
;;
|
||||
esac
|
||||
38
dotfiles/desktop/.config/hypr/scripts/screenshot
Executable file
38
dotfiles/desktop/.config/hypr/scripts/screenshot
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
# Quick screenshot helpers for Hyprland. Captures via grim, saves to disk and
|
||||
# also copies to the Wayland clipboard. Use the flameshot binding for
|
||||
# annotations / fancy capture.
|
||||
#
|
||||
# Usage: screenshot {full|region|output|window}
|
||||
|
||||
set -eu
|
||||
|
||||
mode="${1:-full}"
|
||||
dir="$HOME/Pictures/Screenshots"
|
||||
mkdir -p "$dir"
|
||||
file="$dir/$(date +%Y%m%d_%H%M%S).png"
|
||||
|
||||
case "$mode" in
|
||||
full)
|
||||
grim "$file"
|
||||
;;
|
||||
region)
|
||||
grim -g "$(slurp)" "$file"
|
||||
;;
|
||||
output)
|
||||
out=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name')
|
||||
grim -o "$out" "$file"
|
||||
;;
|
||||
window)
|
||||
geom=$(hyprctl activewindow -j \
|
||||
| jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')
|
||||
grim -g "$geom" "$file"
|
||||
;;
|
||||
*)
|
||||
printf 'Usage: %s {full|region|output|window}\n' "$0" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
wl-copy < "$file"
|
||||
notify-send "Screenshot saved" "$file" -i image-x-generic >/dev/null 2>&1 || true
|
||||
34
dotfiles/desktop/.config/hypr/scripts/workspace-cycle
Executable file
34
dotfiles/desktop/.config/hypr/scripts/workspace-cycle
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
# Cycle Hyprland workspaces within the fixed 1..10 desktop set.
|
||||
|
||||
set -eu
|
||||
|
||||
direction="${1:-next}"
|
||||
current="$(hyprctl activeworkspace -j | jq -r '.id')"
|
||||
|
||||
case "$current" in
|
||||
''|*[!0-9-]*) current=1 ;;
|
||||
esac
|
||||
|
||||
case "$direction" in
|
||||
next)
|
||||
if [ "$current" -ge 10 ] || [ "$current" -lt 1 ]; then
|
||||
target=1
|
||||
else
|
||||
target=$((current + 1))
|
||||
fi
|
||||
;;
|
||||
prev)
|
||||
if [ "$current" -le 1 ] || [ "$current" -gt 10 ]; then
|
||||
target=10
|
||||
else
|
||||
target=$((current - 1))
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
printf 'Usage: %s {next|prev}\n' "$0" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exec hyprctl dispatch workspace "$target"
|
||||
Reference in New Issue
Block a user