This commit is contained in:
ksyasuda 2022-01-27 23:29:01 -08:00
parent ceabeeca7b
commit 16e208eca4
2 changed files with 70 additions and 76 deletions

View File

@ -4,40 +4,40 @@ m() { rofi -theme -dmenu -config ~/SudacodeRice/rofi/dracula.rasi -l 24 -i "$@";
mb() { rofi -dmenu -config ~/SudacodeRice/rofi/dracula.rasi -l 24 -i -kb-custom-1 "Alt+q" "$@"; } mb() { rofi -dmenu -config ~/SudacodeRice/rofi/dracula.rasi -l 24 -i -kb-custom-1 "Alt+q" "$@"; }
artist() { artist() {
lines="$(mpc list artist | wc -l)" lines="$(mpc list artist | wc -l)"
[ "$lines" -gt 30 ] && lines=30 [ "$lines" -gt 30 ] && lines=30
mpc list artist | sort -f | m -p "Artists" -l $lines mpc list artist | sort -f | m -p "Artists" -l $lines
} }
a_album() { a_album() {
artist="$1" artist="$1"
lines="$(mpc list album artist "$artist" | wc -l)" lines="$(mpc list album artist "$artist" | wc -l)"
[ "$lines" -gt 30 ] && lines=30 [ "$lines" -gt 30 ] && lines=30
mpc list album artist "$artist" | sort -f | mb -p "Albums" -l $lines mpc list album artist "$artist" | sort -f | mb -p "Albums" -l $lines
} }
album() { album() {
lines="$(mpc list album | wc -l)" lines="$(mpc list album | wc -l)"
[ "$lines" -gt 30 ] && lines=30 [ "$lines" -gt 30 ] && lines=30
mpc list album | sort -f | mb -p "Album" -l $lines mpc list album | sort -f | mb -p "Album" -l $lines
} }
song() { song() {
lines="$(mpc list title | wc -l)" lines="$(mpc list title | wc -l)"
[ "$lines" -gt 30 ] && lines=30 [ "$lines" -gt 30 ] && lines=30
mpc list title | sort -f | mb -p "Song" -l 30 mpc list title | sort -f | mb -p "Song" -l 30
} }
case "$1" in case "$1" in
-l | --library) mode=Library ;; -l | --library) mode=Library ;;
-A | --album) mode=Album ;; -A | --album) mode=Album ;;
-s | --song) mode=Song ;; -s | --song) mode=Song ;;
-a | --ask) -a | --ask)
MODE=$(printf "Library\nAlbum\nSong" | m -p "Choose mode" -l 3) MODE=$(printf "Library\nAlbum\nSong" | m -p "Choose mode" -l 3)
mode=$MODE mode=$MODE
;; ;;
-h | --help) -h | --help)
echo " echo "
usage: rofi-mpd [-h] [-l] [-s] [-a] usage: rofi-mpd [-h] [-l] [-s] [-a]
arguments: arguments:
@ -51,35 +51,35 @@ case "$1" in
enter play song/album now enter play song/album now
Alt+q add song/album to queue Alt+q add song/album to queue
" "
exit exit
;; ;;
esac esac
case "$mode" in case "$mode" in
Library) Library)
artist=$(artist) artist=$(artist)
[ ! "$artist" ] && exit [ ! "$artist" ] && exit
album=$(a_album "$artist") album=$(a_album "$artist")
cod=$? cod=$?
[ ! "$album" ] && exit [ ! "$album" ] && exit
[ "$cod" -eq 10 ] || mpc clear [ "$cod" -eq 10 ] || mpc clear
mpc find artist "$artist" album "$album" | mpc add mpc find artist "$artist" album "$album" | mpc add
mpc play >/dev/null mpc play > /dev/null
;; ;;
Song) Song)
song=$(song) song=$(song)
cod=$? cod=$?
[ ! "$song" ] && exit [ ! "$song" ] && exit
[ "$cod" -eq 10 ] || mpc clear [ "$cod" -eq 10 ] || mpc clear
mpc search "(title==\"$song\")" | mpc add mpc search "(title==\"$song\")" | mpc add
mpc play >/dev/null mpc play > /dev/null
;; ;;
Album) Album)
album=$(album) album=$(album)
cod=$? cod=$?
[ ! "$album" ] && exit [ ! "$album" ] && exit
[ "$cod" -eq 10 ] || mpc clear [ "$cod" -eq 10 ] || mpc clear
mpc find album "$album" | mpc add mpc find album "$album" | mpc add
mpc play >/dev/null mpc play > /dev/null
;; ;;
esac esac

View File

@ -147,31 +147,25 @@ super + {Left,Down,Up,Right}
# Special hotkeys # Special hotkeys
# #
# Multimedia keys # Volume Control
XF86AudioRaiseVolume XF86AudioRaiseVolume
amixer -q set Master 5%+ unmute && ~/SudacodeRice/scripts/dunst_volume/dunst_volume.py increase amixer -q set Master 5%+ unmute && ~/SudacodeRice/scripts/dunst_volume/dunst_volume.py increase
XF86AudioLowerVolume XF86AudioLowerVolume
amixer -q set Master 5%- unmute && ~/SudacodeRice/scripts/dunst_volume/dunst_volume.py decrease amixer -q set Master 5%- unmute && ~/SudacodeRice/scripts/dunst_volume/dunst_volume.py decrease
XF86AudioMute XF86AudioMute
amixer -D pulse sset Master toggle-mute && ~/SudacodeRice/scripts/dunst_volume/dunst_volume.py mute amixer -D pulse sset Master toggle-mute && ~/SudacodeRice/scripts/dunst_volume/dunst_volume.py mute
# XF86AudioRaiseVolume @DEFAULT_SINK@ +10%; ~/SudacodeRice/scripts/dunst_volume/dunst_volume.py increase # Next/Toggle/Prev Song
XF86AudioPrev
~/SudacodeRice/scripts/music-controls.sh -p
XF86AudioPlay
~/SudacodeRice/scripts/music-controls.sh -t
XF86AudioNext
~/SudacodeRice/scripts/music-controls.sh -n
# XF86AudioLowerVolume pactl set-sink-volume @DEFAULT_SINK@ -10%; ~/SudacodeRice/scripts/dunst_volume/dunst_volume.py decrease # Brightness
# XF86AudioMute @DEFAULT_SINK@ toggle; ~/SudacodeRice/scripts/dunst_volume/dunst_volume.py mute
# amixer -q set Master toggle
# Simple amixer command seems to have problems unmuting device
# Brightness up
XF86MonBrightnessUp XF86MonBrightnessUp
xbacklight -inc 5 xbacklight -inc 5
# And brightness down
XF86MonBrightnessDown XF86MonBrightnessDown
xbacklight -dec 5 xbacklight -dec 5
@ -183,29 +177,29 @@ alt+Print
~/.config/bspwm/scripts/screenshot.sh ~/.config/bspwm/scripts/screenshot.sh
# Shortcuts # Shortcuts
super + w alt + p
firefox pavucontrol
alt + t
super + t
thunar thunar
alt + F1
super + F1
~/.config/bspwm/scripts/keybindings_rofi.sh ~/.config/bspwm/scripts/keybindings_rofi.sh
# ncmpcpp
alt + n alt + n
alacritty -e ncmpcpp alacritty -e ncmpcpp
# bpytop
alt + b alt + b
alacritty -e bpytop alacritty -e bpytop
# Rofi
alt + shift + p alt + shift + p
~/.config/rofi/scripts/rofi-picom.sh ~/.config/rofi/scripts/rofi-picom.sh
alt + shift + n alt + shift + n
~/.config/rofi/scripts/rofi-networks.sh ~/.config/rofi/scripts/rofi-networks.sh
alt + shift + m
~/SudacodeRice/scripts/rofi-mpd-desktop -s
alt + shift + g
~/SudacodeRice/scripts/rofi/rofi-search.sh
alt + shift + y
~/.bin/rofi-stream
# Rofi
control + shift + s control + shift + s
~/Work/rofi/rofi-ssh.sh "$HOME/SudacodeRice/rofi/flat-orange.rasi" ~/Work/rofi/rofi-ssh.sh "$HOME/SudacodeRice/rofi/flat-orange.rasi"
control + shift + r control + shift + r