Skip to content

Commit 91b6b75

Browse files
Merge pull request #33 from wesleyjcr/feat-numlock
Added the functionality to activate and deactivate numlock in the cinnamon interface
2 parents bbe47f4 + 9a638e2 commit 91b6b75

1 file changed

Lines changed: 19 additions & 16 deletions

File tree

  • usr/share/biglinux/biglinux-settings/usability

usr/share/biglinux/biglinux-settings/usability/numLock.sh

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff 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
7073
fi

0 commit comments

Comments
 (0)