mirror of
https://github.com/szymon-jozef/amazing-dotfiles.git
synced 2026-09-07 12:10:45 +02:00
move some scripts to .nix
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
disturbed=$(makoctl mode | grep -i do-not-disturb) > /dev/null
|
||||
mute_icon=""
|
||||
unmute_icon="🕭"
|
||||
|
||||
case $1 in
|
||||
"show")
|
||||
if [[ $disturbed == "" ]]; then
|
||||
echo "$unmute_icon"
|
||||
else
|
||||
echo "$mute_icon"
|
||||
fi
|
||||
;;
|
||||
"change")
|
||||
if [[ $disturbed == "" ]]; then
|
||||
makoctl mode -a do-not-disturb > /dev/null
|
||||
echo "$unmute_icon"
|
||||
else
|
||||
makoctl mode -r do-not-disturb > /dev/null
|
||||
echo "$mute_icon"
|
||||
fi
|
||||
pkill -SIGRTMIN+2 waybar
|
||||
;;
|
||||
*)
|
||||
echo "Arguments are: show, change"
|
||||
;;
|
||||
esac
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
MUTED=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep -iq muted; echo $?)
|
||||
|
||||
if [[ $MUTED -eq 0 ]]; then
|
||||
notify-send "Audio muted" -a 'wp-vol' -t 1000
|
||||
else
|
||||
notify-send "Audio unmuted" -a 'wp-vol' -t 1000
|
||||
fi
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
killall -q waybar
|
||||
|
||||
while pgrep -x waybar >/dev/null; do sleep 1; done
|
||||
|
||||
uwsm app waybar
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# variables
|
||||
## path vars
|
||||
date="$(date +'%d-%m-%Y_%H:%M:%S')"
|
||||
fname="$date.png"
|
||||
target_path="$HOME/Obrazy/zrzuty/$fname"
|
||||
## stdout
|
||||
error_wrong_type="The first argument needs to be \"fullscreen\", \"window\" or \"region\". Exiting..."
|
||||
notification_succes="$target_path saved and copied"
|
||||
|
||||
|
||||
# validate input
|
||||
case "$1" in
|
||||
"fullscreen" | "window" | "region")
|
||||
type=$1
|
||||
;;
|
||||
*)
|
||||
echo "$error_wrong_type"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
|
||||
notification() {
|
||||
notify-send -i "$target_path" -u low -a "Screenshot" "Screenshot $type" "$notification_succes"
|
||||
}
|
||||
|
||||
case $type in
|
||||
"fullscreen")
|
||||
grim -o $(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name') "$target_path"
|
||||
wl-copy < "$target_path"
|
||||
notification
|
||||
;;
|
||||
"window")
|
||||
active_window_position="$(hyprctl clients -j | jq -r '.[] | select(.focusHistoryID == 0) | .at')"
|
||||
active_window_size="$(hyprctl clients -j | jq -r '.[] | select(.focusHistoryID == 0) | .size')"
|
||||
|
||||
x=$(echo "$active_window_position" | jq '.[0]')
|
||||
y=$(echo "$active_window_position" | jq '.[1]')
|
||||
width=$(echo "$active_window_size" | jq '.[0]')
|
||||
height=$(echo "$active_window_size" | jq '.[1]')
|
||||
|
||||
grim -g "${x},${y} ${width}x${height}" "$target_path"
|
||||
wl-copy < "$target_path"
|
||||
notification
|
||||
;;
|
||||
"region")
|
||||
grim -o $(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name') - | satty -f -
|
||||
;;
|
||||
esac
|
||||
Binary file not shown.
Reference in New Issue
Block a user