local/bin/start

   1 #!/bin/bash
   2 
   3 title=${1^}
   4 start(){ xfce4-terminal -T $title -x bash -ic "$@" & }
   5 dmenu(){ rofi -columns 3 -dmenu -i -l 6 -p "${1^}" "${@:1}"; }
   6 
   7 case ${1,,} in
   8     apps) rofi -show drun -columns 2 -show-icons -terminal $0;;
   9     windows) rofi -show window;;
  10     calendar) start calcurse;;
  11 
  12     files) start ranger;;
  13     browser) chromium --new-window lexa.by &;;
  14     editor) gvim;;
  15     terminal) xfce4-terminal;;
  16 
  17     mail) start mutt;;
  18     news) start newsboat;;
  19     torrents) start transmission-remote-cli;;
  20     bloge)
  21         { echo ' '; blo -l | tac; } | dmenu $1 |
  22         cut -d . -f 1 | xargs -r0 $0 blo
  23     ;;
  24 
  25     music) start mocp;;
  26     kino)
  27         tac ~/.config/mpv/history.log | rofi -dmenu -i -p $1 |
  28         awk -F '%) - ' '{ print $2 }' | sed "s|~|$HOME|" |
  29         xargs -I % mpv --profile pseudo-gui '%'
  30     ;;
  31 
  32     -l) grep -Po '^\s+[\w^)]+\)' $0 | tr -d ') ' | sort;;
  33     --list) $0 -l | while read i; do echo "$(status -i $i) ${i^}"; done;;
  34 
  35     weather) status -n weather;;
  36     redshift) killall redshift || redshift -r &;;
  37     symbols) gucharmap &;;
  38     theme)
  39         wal --theme | grep '^ -' | cut -b 4- | sort -u |
  40         dmenu $1 | cut -d ' ' -f 1 | xargs -r wall --theme
  41     ;;
  42 
  43     '') $0 --list | dmenu | awk '{ print $NF }' | xargs -r $0;;
  44     -*) shift; title=${1^} start "$*";;
  45      *) start "$*";;
  46 esac