hyprland scripts

This commit is contained in:
Hannes
2025-10-16 20:50:11 +02:00
parent 3add98f7bb
commit 178bff8856
41 changed files with 446 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
#!/bin/bash
# Toggle Discord "Deafen" (mutes mic and audio output)
# Dependencies: hyprctl, jq, wtype
# Check if Discord is running
if ! pgrep -x "Discord" > /dev/null; then
echo "Discord is not running."
exit 1
fi
# Get currently active window address
ACTIVE_WIN=$(hyprctl activewindow -j | jq -r '.address')
# Find Discord's window address
DISCORD_WIN=$(hyprctl clients -j | jq -r '.[] | select(.class == "discord") | .address')
if [ -z "$DISCORD_WIN" ]; then
echo "Discord window not found."
exit 1
fi
# Focus the Discord window
hyprctl dispatch focuswindow address:$DISCORD_WIN
# Give Discord time to focus
sleep 0.1
# Send Ctrl + Shift + D to toggle "Deafen"
wtype -M ctrl -M shift -k D -m shift -m ctrl
# Optional: Restore focus to the previous window
if [ -n "$ACTIVE_WIN" ]; then
sleep 0.1
hyprctl dispatch focuswindow address:$ACTIVE_WIN
fi
# Add shared script Functions
source "$HOME/.config/function_helper.sh"
send_notification "low" "Pressed Makropad Button" "Row 2, Colums 1" "$HOME/.icons/BeautyLine-Garuda/apps/scalable/keyboard.svg"