dotfiles

configuration files
git clone https://pi.duncano.de/git/dotfiles.git
Log | Files | Refs | README

commit b61f03eac788cf9a58976cd3b5ff48c7ff3e97ac
parent a63bebd97e846177a2818ff42e369b0c48f4f278
Author: Duncaen <mail@duncano.de>
Date:   Sun, 24 May 2015 16:22:22 +0200

bin/dmenu_playerctl: add smarter player selection by play status

Diffstat:
bin/dmenu_playerctl | 13++++++++++++-
mkshrc | 14++++++++++----
2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/bin/dmenu_playerctl b/bin/dmenu_playerctl @@ -1,7 +1,17 @@ #!/bin/mksh select_player() { - echo $1 | tr ' ' '\n' | ${DMENU} + playing="" + for p in $1; do + if [ $(playerctl -p "$p" status) == "Playing" ]; then + [ -z "$playing" ] && playing="$p" || playing="$playing\n$p" + fi + done + case $(echo "$playing" | wc -l) in + 0) exit ;; + 1) echo "$playing" ;; + *) echo $(echo "$playing" | ${DMENU}) ;; + esac } prompt() { @@ -19,6 +29,7 @@ play_pause() { } player_menu() { + [ -z "$1" ] && exit CMDS="$(play_pause $1)\nStop\nNext\nPrevious\nVolume" ret=$(echo $CMDS | ${DMENU} -p "$(prompt $1)" -i | tr '[A-Z]' '[a-z]') case "$ret" in diff --git a/mkshrc b/mkshrc @@ -480,9 +480,6 @@ export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=0 export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=true export INFINALITY_FT_USE_VARIOUS_TWEAKS=true -# Keychain -[ -r /usr/bin/keychain ] && eval `keychain --eval --agents ssh id_rsa` - alias check-updates="sudo sh -c 'cd /var/cache/void-packages && chpst -u voidupdates:voidupdates void-updates -p 20 -r git://github.com/voidlinux/void-packages.git -s /var/cache/void-packages -o /srv/http/void-updates'" alias bt='echo 0 | gdb -batch-silent -ex "run" -ex "set logging overwrite on" -ex "set logging file gdb.bt" -ex "set logging on" -ex "set pagination off" -ex "handle SIG33 pass nostop noprint" -ex "echo backtrace:\n" -ex "backtrace full" -ex "echo \n\nregisters:\n" -ex "info registers" -ex "echo \n\ncurrent instructions:\n" -ex "x/16i \$pc" -ex "echo \n\nthreads backtrace:\n" -ex "thread apply all backtrace" -ex "set logging off" -ex "quit" --args' # alias keychain=eval_keychain @@ -498,10 +495,19 @@ unset p # fix del key printf '\033[?1h\033=' >/dev/tty - # PS1='$(slcp $COLUMNS $?)' +# z +if [ -r /home/duncan/repos/github.com/Duncaen/dotfiles/z/z.sh ]; then + . /home/duncan/repos/github.com/Duncaen/dotfiles/z/z.sh + + function _z_add { + _z --add "$PWD" + } + PS1+='$(_z_add)' +fi + # If this is an xterm set the title to user@host:dir case "$TERM" in dvtm*|xterm*|rxvt*)