-
Notifications
You must be signed in to change notification settings - Fork 2
/
default_app
executable file
·38 lines (33 loc) · 1.18 KB
/
default_app
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
export QT_QPA_PLATFORMTHEME="qt5ct"
##This script assigns a default application to each Tag (1-9), and opens the application assigned to the currently focused tag when run.
##Please copy misc/default_apps.sh to your root leftwm config folder ($HOME/.config/leftwm) and configure your preferred defaults there.
#Imports variables from default_apps.sh, or assigns default variables if default_apps.sh does not exist.
if test -e "$HOME"/.config/leftwm/default_apps.sh;
then
source $HOME/.config/leftwm/default_apps.sh;
else
export TERM=alacritty
export BROWSER=firefox
export DOC=libreoffice
export FILE=dolphin
export PLAYER=vlc
export GAME=steam
export PHOTO=gimp
export SANDBOX=
export DEV="alacritty -e vim";
fi
#Lookup Focused tag
TAG=$(sleep 0.1 && leftwm-state -q -w 0 -t "$HOME"/.config/leftwm/themes/current/liquid/name.liquid | xargs expr 1 +)
#Executes application based on number of focused tag
case "$TAG" in
1) $TERM &> /dev/null ;;
2) $BROWSER &> /dev/null ;;
3) $DOC &> /dev/null ;;
4) $FILE &> /dev/null ;;
5) $PLAYER &> /dev/null ;;
6) $GAME &> /dev/null ;;
7) $PHOTO &> /dev/null ;;
8) $SANDBOX &> /dev/null ;;
9) $DEV &> /dev/null ;;
esac