Skip to content

Commit 59e19a5

Browse files
update action and state
1 parent c074d1a commit 59e19a5

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

usr/share/biglinux/biglinux-settings/example/example.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
# check current status
4+
# action=$1
45
if [ "$1" == "check" ]; then
56
# for all DEs
67
if [[ "$(LANG=C some Command)" == "true" ]];then #or if some Command &>/dev/null;then # if command response exit 0
@@ -10,10 +11,11 @@ if [ "$1" == "check" ]; then
1011
fi
1112

1213
# change the state
14+
# action=$1
15+
# state=$2
1316
elif [ "$1" == "toggle" ]; then
14-
state="$2"
1517
# if the state is true
16-
if [ "$state" == "true" ]; then
18+
if [ "$2" == "true" ]; then
1719
# execute a command as a user
1820
any command as user
1921
# execute a command as root, prompting for a password only once.

usr/share/biglinux/biglinux-settings/example/exampleWithDE.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
# check current status
4+
# action=$1
45
if [ "$1" == "check" ]; then
56
# for KDE Plasma only
67
if [[ "$XDG_CURRENT_DESKTOP" == *"KDE"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"Plasma"* ]];then
@@ -33,12 +34,13 @@ if [ "$1" == "check" ]; then
3334
fi
3435

3536
# change the state
37+
# action=$1
38+
# state=$2
3639
elif [ "$1" == "toggle" ]; then
37-
state="$2"
3840
# for KDE Plasma only
3941
if [[ "$XDG_CURRENT_DESKTOP" == *"KDE"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"Plasma"* ]];then
4042
# if the state is true
41-
if [ "$state" == "true" ]; then
43+
if [ "$2" == "true" ]; then
4244
# execute a command as a user
4345
any command as user
4446
# execute a command as root, prompting for a password only once.
@@ -55,7 +57,7 @@ elif [ "$1" == "toggle" ]; then
5557
# for GNOME ONly
5658
elif [[ "$XDG_CURRENT_DESKTOP" == *"GNOME"* ]];then
5759
# if the state is true
58-
if [ "$state" == "true" ]; then
60+
if [ "$2" == "true" ]; then
5961
# execute a command as a user
6062
any command as user
6163
# execute a command as root, prompting for a password only once.
@@ -72,7 +74,7 @@ elif [ "$1" == "toggle" ]; then
7274
# for XFCE only
7375
elif [ -n "$(grep SHMC $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml)" ];then
7476
# if the state is true
75-
if [ "$state" == "true" ]; then
77+
if [ "$2" == "true" ]; then
7678
# execute a command as a user
7779
any command as user
7880
# execute a command as root, prompting for a password only once.
@@ -89,7 +91,7 @@ elif [ "$1" == "toggle" ]; then
8991
# for CINNAMON only
9092
elif [[ "$XDG_CURRENT_DESKTOP" == *"Cinnamon"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"X-Cinnamon"* ]];then
9193
# if the state is true
92-
if [ "$state" == "true" ]; then
94+
if [ "$2" == "true" ]; then
9395
# execute a command as a user
9496
any command as user
9597
# execute a command as root, prompting for a password only once.

usr/share/biglinux/biglinux-settings/preload/preload.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
# check current status
4+
# action=$1
45
if [ "$1" == "check" ]; then
56
if [[ -e "$verifyApp" ]];then
67
if [[ -e "/etc/big-preload/enable-$app" ]];then
@@ -13,9 +14,10 @@ if [ "$1" == "check" ]; then
1314
fi
1415

1516
# change the state
17+
# action=$1
18+
# state=$2
1619
elif [ "$1" == "toggle" ]; then
17-
state="$2"
18-
if [ "$state" == "true" ]; then
20+
if [ "$2" == "true" ]; then
1921
pkexec touch /etc/big-preload/enable-$app
2022
else
2123
pkexec rm -f /etc/big-preload/enable-$app

0 commit comments

Comments
 (0)