File tree Expand file tree Collapse file tree
usr/share/biglinux/biglinux-settings/usability Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,12 +20,13 @@ if [ "$1" == "check" ]; then
2020# else
2121# echo "false"
2222# fi
23- # elif [[ "$XDG_CURRENT_DESKTOP" == *"Cinnamon"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"X-Cinnamon"* ]];then
24- # if [[ "$someTest" == "true" ]];then
25- # echo "true"
26- # else
27- # echo "false"
28- # fi
23+ elif [[ " $XDG_CURRENT_DESKTOP " == * " Cinnamon" * ]] || [[ " $XDG_CURRENT_DESKTOP " == * " X-Cinnamon" * ]]; then
24+ recent_status=$( gsettings get org.cinnamon.desktop.peripherals.keyboard numlock-state)
25+ if [[ " $recent_status " == " true" ]]; then
26+ echo " true"
27+ else
28+ echo " false"
29+ fi
2930 fi
3031
3132# change the state
@@ -42,29 +43,31 @@ elif [ "$1" == "toggle" ]; then
4243 return $?
4344 fi
4445# elif [[ "$XDG_CURRENT_DESKTOP" == *"GNOME"* ]];then
45- # if [[ "$new_state " == "true" ]];then
46+ # if [[ "$state " == "true" ]];then
4647# some command
4748# exitCode=$?
4849# else
4950# some command
5051# exitCode=$?
5152# fi
5253# elif [[ "$XDG_CURRENT_DESKTOP" == *"XFCE"* ]];then
53- # if [[ "$new_state" == "true" ]];then
54- # some command
55- # exitCode=$?
56- # else
57- # some command
58- # exitCode=$?
59- # fi
60- # elif [[ "$XDG_CURRENT_DESKTOP" == *"Cinnamon"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"X-Cinnamon"* ]];then
61- # if [[ "$new_state" == "true" ]];then
54+ # if [[ "$state" == "true" ]];then
6255# some command
6356# exitCode=$?
6457# else
6558# some command
6659# exitCode=$?
6760# fi
61+ elif [[ " $XDG_CURRENT_DESKTOP " == * " Cinnamon" * ]] || [[ " $XDG_CURRENT_DESKTOP " == * " X-Cinnamon" * ]]; then
62+ if [[ " $state " == " true" ]]; then
63+ gsettings set org.cinnamon.desktop.peripherals.keyboard numlock-state true
64+ numlockx on
65+ exitCode=$?
66+ else
67+ gsettings set org.cinnamon.desktop.peripherals.keyboard numlock-state false
68+ numlockx off
69+ exitCode=$?
70+ fi
6871 fi
6972 exit $exitCode
7073fi
You can’t perform that action at this time.
0 commit comments