1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-10-09 19:11:15 +02:00

tools: restructured

This commit is contained in:
2023-11-10 13:55:20 +01:00
parent 4cf03f336e
commit 1547250832
38 changed files with 0 additions and 0 deletions

30
.local/bin/etc/sxhkd/audio/lmc Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/sh
# A general audio interface for LARBS.
# Based on a script by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
[ -z "$2" ] && num="5" || num="$2"
case "$1" in
up) wpctl set-volume @DEFAULT_AUDIO_SINK@ "$num"%+ ;;
down) wpctl set-volume @DEFAULT_AUDIO_SINK@ "$num"%- ;;
deaf) wpctl set-mute @DEFAULT_SINK@ 1;;
undeaf) wpctl set-mute @DEFAULT_SINK@ 0;;
mute) wpctl set-mute @DEFAULT_AUDIO_SOURCE@ 1;;
unmute) wpctl set-mute @DEFAULT_AUDIO_SOURCE@ 0;;
*) cat << EOF
lmc: cli music interface for pulse for those with divine intellect too
grand to remember the pamixer commands.
Allowed options:
up NUM Increase volume (5% default)
down NUM Decrease volume (5% default)
mute mute microphone
unmute unmute microphone
deaf deaf sound
undeaf undeaf sound
all else Print this message
EOF
esac
pkill -RTMIN+4 $STATUSBAR

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,10 @@
#!/bin/sh
if amixer get Capture | tail -2 | grep -q '\[on\]'; then
paplay ~/.local/bin/tools/audio/mic_muted.wav
lmc mute
lmc undeaf
else
lmc unmute
lmc undeaf
paplay ~/.local/bin/tools/audio/mic_activated.wav
fi

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,10 @@
#!/bin/sh
if amixer get Master | tail -2 | grep -q '\[on\]'; then
notify-send -u low 'sxhkd' 'Sound muted\nMicrophone muted'
lmc mute
lmc deaf
else
lmc mute
lmc undeaf
paplay ~/.local/bin/tools/audio/sound_resumed.wav
fi

View File

@@ -0,0 +1,18 @@
#!/bin/sh
# Requires maim. It lets you choose the kind of screenshot to take,
# including copying the image or even highlighting an area to copy.
output="$HOME/downloads/screenshot-$(date '+%Y-%m-%d_%H-%M-%S').png"
xclip_img="xclip -sel clip -t image/png"
xclip_txt="xclip -sel clip -t text/plain"
case "$(printf "a selected area\\na selected area (copy)\\ncurrent window\\ncurrent window (copy)\\nfull screen\\nfull screen (copy)\\ncolor picker (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in
"a selected area") maim -s $output ;;
"a selected area (copy)") maim -s | ${xclip_img} ;;
"current window") maim -i "$(xdotool getactivewindow)" $output ;;
"current window (copy)") maim -i "$(xdotool getactivewindow)" | ${xclip_img} ;;
"full screen") maim $output ;;
"full screen (copy)") maim | ${xclip_img} ;;
"color picker (copy)") xcolor |tr -d '\n' | ${xclip_txt} ;;
esac