mirror of https://github.com/tiyn/dotfiles
parent
b25a478cfa
commit
f662768a04
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
Device="Audio Adapter (Unitek Y-247A) Mono"
|
||||||
|
|
||||||
|
Name=$(wpctl status | grep "$Device")
|
||||||
|
Id=$( echo $Name | cut -d '.' -f 1 | cut -c 5-)
|
||||||
|
Node=$(wpctl inspect $Id | grep node.name | cut -d '=' -f 2)
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start) wpctl set-volume $Id 0.2
|
||||||
|
touch ~/.local/state/loopback.lock
|
||||||
|
pw-loopback -C $Node & ;;
|
||||||
|
stop) killall pw-loopback
|
||||||
|
rm ~/.local/state/loopback.lock ;;
|
||||||
|
toggle)
|
||||||
|
if [ -f ~/.local/state/loopback.lock ]; then
|
||||||
|
loopback stop
|
||||||
|
else
|
||||||
|
loopback start
|
||||||
|
fi ;;
|
||||||
|
*) cat << EOF
|
||||||
|
loopback: cli audio script for looping back pulse devices to the default output.
|
||||||
|
|
||||||
|
Allowed options:
|
||||||
|
start Start loopback for device
|
||||||
|
stop Stop all active loopbacks
|
||||||
|
toggle Start or stop loopback depending if it is already running
|
||||||
|
|
||||||
|
EOF
|
||||||
|
esac
|
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
layout=$(setxkbmap -query | grep "layout" | awk '{print $NF}') #| grep -q 'ru$' && $(setxkbmap de ; notify-send -u low 'SXHKD' 'Set keymap to german') || $(setxkbmap de ru ; notify-send -u low 'SXHKD' 'Set keymap to russian')
|
||||||
|
variant=$(setxkbmap -query | grep "variant" | awk '{print $NF}')
|
||||||
|
echo $variant
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
toggle) if [ "$layout" = "de" -a "$variant" = "nodeadkeys" ]
|
||||||
|
then
|
||||||
|
setxkbmap de && notify-send -u low 'SXHKD' 'Set keymap to german'
|
||||||
|
elif [ "$layout" = "de" -a "$variant" = "" ]
|
||||||
|
then
|
||||||
|
setxkbmap de ru && notify-send -u low 'SXHKD' 'Set keymap to russian (german)'
|
||||||
|
elif [ "$layout" = "de" -a "$variant" = "ru" ]
|
||||||
|
then
|
||||||
|
setxkbmap de nodeadkeys && notify-send -u low 'SXHKD' 'Set keymap to german (nodeadkeys)'
|
||||||
|
fi ;;
|
||||||
|
*) cat << EOF
|
||||||
|
keymap: cli script to change the keymap quickly.
|
||||||
|
|
||||||
|
Allowed options:
|
||||||
|
toggle Loop through the different keymaps
|
||||||
|
all else Print this message
|
||||||
|
|
||||||
|
EOF
|
||||||
|
esac
|
@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
layout=$(setxkbmap -query | grep "layout" | awk '{print $NF}') #| grep -q 'ru$' && $(setxkbmap de ; notify-send -u low 'SXHKD' 'Set keymap to german') || $(setxkbmap de ru ; notify-send -u low 'SXHKD' 'Set keymap to russian')
|
|
||||||
variant=$(setxkbmap -query | grep "variant" | awk '{print $NF}')
|
|
||||||
echo $variant
|
|
||||||
if [ "$layout" = "de" -a "$variant" = "nodeadkeys" ]
|
|
||||||
then
|
|
||||||
setxkbmap de && notify-send -u low 'SXHKD' 'Set keymap to german'
|
|
||||||
elif [ "$layout" = "de" -a "$variant" = "" ]
|
|
||||||
then
|
|
||||||
setxkbmap de ru && notify-send -u low 'SXHKD' 'Set keymap to russian (german)'
|
|
||||||
elif [ "$layout" = "de" -a "$variant" = "ru" ]
|
|
||||||
then
|
|
||||||
setxkbmap de nodeadkeys && notify-send -u low 'SXHKD' 'Set keymap to german (nodeadkeys)'
|
|
||||||
fi
|
|
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# toggle external monitor
|
||||||
|
# by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
|
||||||
|
|
||||||
|
intern=LVDS1
|
||||||
|
extern=HDMI2
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
toggle) (xrandr | grep "$extern disconnected")
|
||||||
|
(xrandr --listactivemonitors | grep $extern) || ((xrandr --output $extern --right-of $intern --auto && wallpaper) & exit)
|
||||||
|
(xrandr --listactivemonitors | grep $extern) && xrandr --output $extern --off
|
||||||
|
wallpaper
|
||||||
|
;;
|
||||||
|
*) cat << EOF
|
||||||
|
monitor: cli script to enable and disable monitors.
|
||||||
|
|
||||||
|
Allowed options:
|
||||||
|
toggle Toggle the set monitor on and off
|
||||||
|
all else Print this message
|
||||||
|
|
||||||
|
EOF
|
||||||
|
esac
|
@ -1,11 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# toggle external monitor
|
|
||||||
# by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
|
|
||||||
|
|
||||||
intern=LVDS1
|
|
||||||
extern=HDMI2
|
|
||||||
(xrandr | grep "$extern disconnected")
|
|
||||||
(xrandr --listactivemonitors | grep $extern) || ((xrandr --output $extern --right-of $intern --auto && setbg) & exit)
|
|
||||||
(xrandr --listactivemonitors | grep $extern) && xrandr --output $extern --off
|
|
||||||
background_set
|
|
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Toggle touchpad. Requires xf86-input-synaptics.
|
||||||
|
# by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
toggle) (synclient | grep "TouchpadOff.*1" && synclient TouchpadOff=0)>/dev/null && notify-send "TouchPad reactivated." && exit
|
||||||
|
synclient TouchpadOff=1 && notify-send "TouchPad deactivated." ;;
|
||||||
|
*) cat << EOF
|
||||||
|
touchpad: cli script to enable and disable the touchpad.
|
||||||
|
|
||||||
|
Allowed options:
|
||||||
|
toggle Toggle the touchpad on and off
|
||||||
|
all else Print this message
|
||||||
|
|
||||||
|
EOF
|
||||||
|
esac
|
@ -1,7 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Toggle touchpad. Requires xf86-input-synaptics.
|
|
||||||
# by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
|
|
||||||
|
|
||||||
(synclient | grep "TouchpadOff.*1" && synclient TouchpadOff=0)>/dev/null && notify-send "TouchPad reactivated." && exit
|
|
||||||
synclient TouchpadOff=1 && notify-send "TouchPad deactivated."
|
|
Loading…
Reference in new issue