mass update.
[my-dotfiles.git] / oldies / executors / caps
CommitLineData
fdd76fc5 1#! /bin/bash
2
3# Check caps lock and numlock status and display using icons
4
5
6CAPS=$(xset -q |grep Caps |awk -F ' ' '{ print $4 }')
7NUMS=$(xset -q |grep Caps |awk -F ' ' '{ print $8 }')
8
9function num_lock () {
10 if [[ $NUMS == "on" ]]; then
11 echo "/usr/share/icons/MB-Mango-Suru-GLOW/panel/16/num-lock-on.svg"
12 else
13 echo "/usr/share/icons/MB-Mango-Suru-GLOW/panel/16/num-lock-off.svg"
14 fi
15}
16
17function caps_lock () {
18 if [[ $CAPS == "on" ]]; then
19 echo "/usr/share/icons/MB-Mango-Suru-GLOW/panel/16/caps-lock-on.svg"
20 else
21 echo "/usr/share/icons/MB-Mango-Suru-GLOW/panel/16/caps-lock-off.svg"
22 fi
23}
24
25case $1 in
26 -n )
27 num_lock
28 ;;
29 -c )
30 caps_lock
31 ;;
32esac
33
34
35
36
37
38
39if [[ $CLOCK == "true" && $NLOCK == "true" ]]; then
40 echo "/usr/share/icons/MB-Mango-Suru-GLOW/panel/16/caps-lock-on.svg"
41 echo "/usr/share/icons/MB-Mango-Suru-GLOW/panel/16/num-lock-on.svg"
42fi