Compare commits
3 Commits
f7b59f9d81
...
c99b5a2117
| Author | SHA1 | Date | |
|---|---|---|---|
|
c99b5a2117
|
|||
|
939289f172
|
|||
|
35cdffa984
|
75
utils/.local/bin/audio
Executable file
75
utils/.local/bin/audio
Executable file
@@ -0,0 +1,75 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# available sinks listed here: pactl list sinks
|
||||||
|
|
||||||
|
CURRENT_SINK="$(pactl get-default-sink)"
|
||||||
|
CURRENT_PRESET="$(easyeffects --active-preset output)"
|
||||||
|
LOUD_SINK="alsa_output.pci-0000_00_1f.3.analog-stereo"
|
||||||
|
LOUD_PRESET="Defender"
|
||||||
|
HEAD_SINK="alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo"
|
||||||
|
HEAD_PRESET="Techno"
|
||||||
|
|
||||||
|
set_head() {
|
||||||
|
if [ "$CURRENT_SINK" != "$HEAD_SINK" ]; then
|
||||||
|
pactl set-default-sink "$HEAD_SINK" || exit 1
|
||||||
|
easyeffects --load-preset "$HEAD_PRESET" || exit 2
|
||||||
|
echo -e "Current sink\t: $HEAD_SINK"
|
||||||
|
echo -e "Current preset\t: $HEAD_PRESET"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
set_loud() {
|
||||||
|
if [ "$CURRENT_SINK" != "$LOUD_SINK" ]; then
|
||||||
|
pactl set-default-sink "$LOUD_SINK" || exit 1
|
||||||
|
easyeffects --load-preset "$LOUD_PRESET" || exit 2
|
||||||
|
echo -e "Current sink\t: $LOUD_SINK"
|
||||||
|
echo -e "Current preset\t: $LOUD_PRESET"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
show_help() {
|
||||||
|
echo "Usage: $(basename "$0") [-h|--help|--loud|--head|--switch]"
|
||||||
|
echo
|
||||||
|
echo "Switch audio output and apply appropriate easyffects preset."
|
||||||
|
echo
|
||||||
|
echo "Options:"
|
||||||
|
echo " -h, --help Show this help message"
|
||||||
|
echo " --loud Enable loud speakers"
|
||||||
|
echo " --head Enable headphones"
|
||||||
|
echo " --switch Switch between loud and headphones"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo -e "Loud sink\t: $LOUD_SINK"
|
||||||
|
echo -e "Loud preset\t: $LOUD_PRESET"
|
||||||
|
echo -e "Head sink\t: $HEAD_SINK"
|
||||||
|
echo -e "Head preset\t: $HEAD_PRESET"
|
||||||
|
echo
|
||||||
|
echo -e "Current sink\t: $CURRENT_SINK"
|
||||||
|
echo -e "Current preset\t: $CURRENT_PRESET"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
|
||||||
|
show_help
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" == "--loud" ]; then
|
||||||
|
set_loud
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" == "--head" ]; then
|
||||||
|
set_head
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" == "--switch" ]; then
|
||||||
|
case "$CURRENT_SINK" in
|
||||||
|
*$LOUD_SINK*) set_head ;;
|
||||||
|
*$HEAD_SINK*) set_loud ;;
|
||||||
|
*) show_help ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
-h|--help)
|
|
||||||
cat <<EOF
|
|
||||||
Usage: $(basename "$0") [-h]
|
|
||||||
|
|
||||||
Switch audio output and apply appropriate easyffects preset.
|
|
||||||
|
|
||||||
Options:
|
|
||||||
-h, --help Show this help message
|
|
||||||
--defender Enable loud speakers
|
|
||||||
--head Enable headphones
|
|
||||||
|
|
||||||
EOF
|
|
||||||
;;
|
|
||||||
--defender)
|
|
||||||
pactl set-default-sink alsa_output.pci-0000_00_1f.3.analog-stereo
|
|
||||||
easyeffects -l Defender
|
|
||||||
;;
|
|
||||||
--head)
|
|
||||||
pactl set-default-sink alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo
|
|
||||||
easyeffects -l Techno
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
@@ -32,10 +32,10 @@
|
|||||||
"chat.commandCenter.enabled": false,
|
"chat.commandCenter.enabled": false,
|
||||||
"window.enableMenuBarMnemonics": false,
|
"window.enableMenuBarMnemonics": false,
|
||||||
"window.restoreFullscreen": true,
|
"window.restoreFullscreen": true,
|
||||||
"window.newWindowProfile": "По умолчанию",
|
|
||||||
"window.customTitleBarVisibility": "auto",
|
"window.customTitleBarVisibility": "auto",
|
||||||
"window.commandCenter": false,
|
"window.commandCenter": false,
|
||||||
"window.menuBarVisibility": "compact",
|
"window.menuStyle": "custom",
|
||||||
|
"window.menuBarVisibility": "toggle",
|
||||||
|
|
||||||
"debug.toolBarLocation": "docked",
|
"debug.toolBarLocation": "docked",
|
||||||
"testing.coverageToolbarEnabled": true,
|
"testing.coverageToolbarEnabled": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user