Skip to content

Commit d2150af

Browse files
add invert mouse and touchpad
1 parent 4acaafd commit d2150af

File tree

5 files changed

+195
-18
lines changed

5 files changed

+195
-18
lines changed

usr/share/biglinux/biglinux-settings/appearance/dark-theme.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,30 @@
33
# Script para gerenciar tema escuro
44
# Funções: check_state e toggle_state
55

6+
# Função para verificar estado atual
67
check_state() {
7-
# Função para verificar estado atual
8-
local current_theme=$(gsettings get org.gnome.desktop.interface gtk-theme 2>/dev/null)
8+
if [[ "$XDG_CURRENT_DESKTOP" == *"KDE"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"Plasma"* ]];;then
99

10-
if [[ "$current_theme" == *"dark"* ]]; then
10+
elif [[ "$XDG_CURRENT_DESKTOP" == *"GNOME"* ]];then
11+
local current_theme=$(gsettings get org.gnome.desktop.interface gtk-theme 2>/dev/null)
12+
if [[ "$current_theme" == *"dark"* ]];then
1113
echo "true"
1214
return 0
1315
else
1416
echo "false"
1517
return 1
1618
fi
19+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"XFCE"* ]]; then
20+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"Cinnamon"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"X-Cinnamon"* ]]; then
21+
fi
1722
}
1823

24+
# Função para alterar o estado
1925
toggle_state() {
20-
# Função para alterar o estado
26+
if [[ "$XDG_CURRENT_DESKTOP" == *"KDE"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"Plasma"* ]];;then
27+
elif [[ "$XDG_CURRENT_DESKTOP" == *"GNOME"* ]];then
2128
local new_state="$1"
22-
23-
if [[ "$new_state" == "true" ]]; then
29+
if [[ "$new_state" == "true" ]];then
2430
echo "Ativando tema escuro..."
2531
gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark'
2632
return 0
@@ -29,6 +35,9 @@ toggle_state() {
2935
gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita'
3036
return 0
3137
fi
38+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"XFCE"* ]]; then
39+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"Cinnamon"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"X-Cinnamon"* ]]; then
40+
fi
3241
}
3342

3443
# Executa a função baseada no parâmetro

usr/share/biglinux/biglinux-settings/main.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
# Configuração do gettext (mantém igual)
1414
DOMAIN = 'biglinux-settings'
15-
LOCALE_DIR = os.path.join(os.path.dirname(__file__), 'locale')
15+
LOCALE_DIR = '/usr/share/locale'
1616

1717
locale.setlocale(locale.LC_ALL, '')
1818
locale.bindtextdomain(DOMAIN, LOCALE_DIR)
@@ -73,7 +73,7 @@ def setup_ui(self):
7373
scrolled.set_child(content_box)
7474

7575
# Grupos de configurações
76-
self.create_appearance_group(content_box)
76+
self.create_usability_group(content_box)
7777
self.create_system_group(content_box)
7878
self.create_notifications_group(content_box)
7979
self.create_security_group(content_box)
@@ -102,29 +102,29 @@ def create_switch_with_script(self, parent_group, title, subtitle, script_group,
102102

103103
return switch
104104

105-
def create_appearance_group(self, parent):
105+
def create_usability_group(self, parent):
106106
"""Grupo de configurações de aparência"""
107107
group = Adw.PreferencesGroup()
108-
group.set_title(_("Appearance"))
108+
group.set_title(_("Usability"))
109109
group.set_description(_("Visual system settings"))
110110
parent.append(group)
111111

112112
# Tema escuro
113113
self.dark_theme_switch = self.create_switch_with_script(
114114
group,
115-
_("Dark Theme"),
116-
_("Enable system dark mode"),
117-
"appearance",
118-
"dark-theme"
115+
_("Mouse Scroll"),
116+
_("Inverted mouse scroll"),
117+
"usability",
118+
"mouse-scroll"
119119
)
120120

121121
# Animações
122122
self.animations_switch = self.create_switch_with_script(
123123
group,
124-
_("Animations"),
125-
_("Enable interface animations"),
126-
"appearance",
127-
"animations"
124+
_("Touchpad Scroll"),
125+
_("Inverted touchpad scroll"),
126+
"usability",
127+
"touchpad-scroll"
128128
)
129129

130130
def create_system_group(self, parent):

usr/share/biglinux/biglinux-settings/system/ssh.sh

Whitespace-only changes.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/bin/bash
2+
3+
# check current status
4+
check_state() {
5+
if [[ "$XDG_CURRENT_DESKTOP" == *"KDE"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"Plasma"* ]];then
6+
if [[ "$(LANG=C kreadconfig6 --group "Mouse" --key "XLbInptNaturalScroll" --file "$HOME/.config/kcminputrc")" == "true" ]];then
7+
return 0
8+
else
9+
return 1
10+
fi
11+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"GNOME"* ]];then
12+
# if [[ "$someTest" == "true" ]];then
13+
# return 0
14+
# else
15+
# return 1
16+
# fi
17+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"XFCE"* ]];then
18+
# if [[ "$someTest" == "true" ]];then
19+
# return 0
20+
# else
21+
# return 1
22+
# fi
23+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"Cinnamon"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"X-Cinnamon"* ]];then
24+
# if [[ "$someTest" == "true" ]];then
25+
# return 0
26+
# else
27+
# return 1
28+
# fi
29+
fi
30+
}
31+
32+
# change the state
33+
toggle_state() {
34+
new_state="$1"
35+
if [[ "$XDG_CURRENT_DESKTOP" == *"KDE"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"Plasma"* ]];then
36+
if [[ "$new_state" == "true" ]];then
37+
kwriteconfig6 --group "Mouse" --key "XLbInptNaturalScroll" --file "$HOME/.config/kcminputrc" "true"
38+
return 0
39+
else
40+
kwriteconfig6 --group "Mouse" --key "XLbInptNaturalScroll" --file "$HOME/.config/kcminputrc" "false"
41+
return 0
42+
fi
43+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"GNOME"* ]];then
44+
# if [[ "$new_state" == "true" ]];then
45+
# some command
46+
# return 0
47+
# else
48+
# some command
49+
# return 0
50+
# fi
51+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"XFCE"* ]];then
52+
# if [[ "$new_state" == "true" ]];then
53+
# some command
54+
# return 0
55+
# else
56+
# some command
57+
# return 0
58+
# fi
59+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"Cinnamon"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"X-Cinnamon"* ]];then
60+
# if [[ "$new_state" == "true" ]];then
61+
# some command
62+
# return 0
63+
# else
64+
# some command
65+
# return 0
66+
# fi
67+
fi
68+
}
69+
70+
# Executes the function based on the parameter
71+
case "$1" in
72+
"check")
73+
check_state
74+
;;
75+
"toggle")
76+
toggle_state "$2"
77+
;;
78+
*)
79+
echo "Use: $0 {check|toggle} [true|false]"
80+
echo " check - Check current status"
81+
echo " toggle <state> - Changes to the specified state"
82+
exit 1
83+
;;
84+
esac
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/bin/bash
2+
3+
# check current status
4+
check_state() {
5+
if [[ "$XDG_CURRENT_DESKTOP" == *"KDE"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"Plasma"* ]];then
6+
if [[ "$(LANG=C kreadconfig6 --group "SynPS/2 Synaptics TouchPad" --key "naturalScroll" --file "$HOME/.config/touchpadxlibinputrc")" == "true" ]];then
7+
return 0
8+
else
9+
return 1
10+
fi
11+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"GNOME"* ]];then
12+
# if [[ "$someTest" == "true" ]];then
13+
# return 0
14+
# else
15+
# return 1
16+
# fi
17+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"XFCE"* ]];then
18+
# if [[ "$someTest" == "true" ]];then
19+
# return 0
20+
# else
21+
# return 1
22+
# fi
23+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"Cinnamon"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"X-Cinnamon"* ]];then
24+
# if [[ "$someTest" == "true" ]];then
25+
# return 0
26+
# else
27+
# return 1
28+
# fi
29+
fi
30+
}
31+
32+
# change the state
33+
toggle_state() {
34+
new_state="$1"
35+
if [[ "$XDG_CURRENT_DESKTOP" == *"KDE"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"Plasma"* ]];then
36+
if [[ "$new_state" == "true" ]];then
37+
kwriteconfig6 --group "SynPS/2 Synaptics TouchPad" --key "naturalScroll" --file "$HOME/.config/touchpadxlibinputrc" "true"
38+
return 0
39+
else
40+
kwriteconfig6 --group "SynPS/2 Synaptics TouchPad" --key "naturalScroll" --file "$HOME/.config/touchpadxlibinputrc" "false"
41+
return 0
42+
fi
43+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"GNOME"* ]];then
44+
# if [[ "$new_state" == "true" ]];then
45+
# some command
46+
# return 0
47+
# else
48+
# some command
49+
# return 0
50+
# fi
51+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"XFCE"* ]];then
52+
# if [[ "$new_state" == "true" ]];then
53+
# some command
54+
# return 0
55+
# else
56+
# some command
57+
# return 0
58+
# fi
59+
# elif [[ "$XDG_CURRENT_DESKTOP" == *"Cinnamon"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"X-Cinnamon"* ]];then
60+
# if [[ "$new_state" == "true" ]];then
61+
# some command
62+
# return 0
63+
# else
64+
# some command
65+
# return 0
66+
# fi
67+
fi
68+
}
69+
70+
# Executes the function based on the parameter
71+
case "$1" in
72+
"check")
73+
check_state
74+
;;
75+
"toggle")
76+
toggle_state "$2"
77+
;;
78+
*)
79+
echo "Use: $0 {check|toggle} [true|false]"
80+
echo " check - Check current status"
81+
echo " toggle <state> - Changes to the specified state"
82+
exit 1
83+
;;
84+
esac

0 commit comments

Comments
 (0)