Skip to content

Commit 87876ea

Browse files
committed
Improve icon detection, fix to show kcm_monitor and hide org.fcitx.Fcitx5.desktop
1 parent 518dda8 commit 87876ea

6 files changed

Lines changed: 64 additions & 7 deletions

File tree

bigcontrolcenter/usr/bin/bigcontrolcenter-menu-manager

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ MENU_FILES=("biglinux-config.desktop" "big-reset.desktop" "br.com.biglinux.netwo
2929
"bootsplash-manager.desktop" "gnome-alsamixer.desktop" "appimagelaunchersettings.desktop"
3030
"org.kde.ksystemlog.desktop" "org.kde.filelight.desktop" "klassy-settings.desktop"
3131
"firewall-config.desktop" "qefientrymanager.desktop" "biglinux-settings.desktop" "org.ffado.FfadoMixer.desktop"
32-
"stoken-gui-small.desktop" "stoken-gui.desktop")
32+
"stoken-gui-small.desktop" "stoken-gui.desktop" "org.fcitx.Fcitx5.desktop")
3333

3434
# Function to clean menu (hide desktop files)
3535
clean_menu() {

bigcontrolcenter/usr/local/bin/systemsettings

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
# Simplify when open Plasma configurations, without open all systemsettings
44

55
if [ -z "$1" ]; then
6-
/usr/bin/systemsettings
6+
/usr/bin/systemsettings $@
77
else
8-
kcmshell6 "$@"
8+
# Fix to open kcm_kscreen in plasma 6.5
9+
if [[ "$1" = "kcm_kscreen" ]] && [[ -z $2 ]]; then
10+
kcmshell6 kcm_nightlight kcm_kwinscreenedges kcm_kscreen
11+
else
12+
kcmshell6 $@
13+
fi
914
fi
Binary file not shown.
Binary file not shown.

bigcontrolcenter/usr/share/biglinux/bigcontrolcenter/utils/app_finder.py

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,37 @@ class AppFinder:
3535

3636
def __init__(self):
3737
"""Initialize the app finder"""
38+
self.session_type = os.environ.get("XDG_SESSION_TYPE", "wayland")
3839
self.replacements = self._get_replacements()
3940

41+
def _get_session_excluded_patterns(self):
42+
"""
43+
Get list of desktop file patterns to exclude based on session type.
44+
In Wayland: exclude _x11 variants
45+
In X11: exclude non-_x11 variants (for modules that have _x11 version)
46+
"""
47+
# Modules that have both normal and _x11 versions
48+
x11_modules = [
49+
"kcm_animations",
50+
"kcm_kwin_effects",
51+
"kcm_kwin_scripts",
52+
"kcm_kwin_virtualdesktops",
53+
"kcm_kwindecoration",
54+
"kcm_kwinoptions",
55+
"kcm_kwinrules",
56+
"kcm_kwinscreenedges",
57+
"kcm_kwintabbox",
58+
"kcm_kwintouchscreen",
59+
]
60+
61+
if self.session_type == "x11":
62+
# In X11, exclude the non-_x11 versions
63+
return [f"{m}.desktop" for m in x11_modules]
64+
else:
65+
# In Wayland, exclude all _x11 variants
66+
return [f"{m}_x11.desktop" for m in x11_modules]
67+
68+
4069
def get_programs(self):
4170
"""
4271
Get program information by scanning the system
@@ -220,6 +249,9 @@ def _find_kde_service_files(self):
220249
"klassystyleconfig.desktop",
221250
]
222251

252+
# Add session-based exclusions (exclude _x11 in Wayland, exclude non-_x11 in X11)
253+
excluded_patterns.extend(self._get_session_excluded_patterns())
254+
223255
result = []
224256

225257
try:
@@ -267,8 +299,12 @@ def _find_app_desktop_files(self):
267299
"kcm_nightlight.desktop",
268300
"kcm_pulseaudio.desktop",
269301
"kcm_kwin_virtualdesktops.desktop",
302+
"kcm_mobile_power.desktop",
270303
]
271304

305+
# Add session-based exclusions (exclude _x11 in Wayland, exclude non-_x11 in X11)
306+
excluded_patterns.extend(self._get_session_excluded_patterns())
307+
272308
result = []
273309

274310
# Find kcm_*.desktop files in /usr/share/applications/
@@ -300,6 +336,9 @@ def _find_bcc_desktop_files(self):
300336
"stoken-gui-small.desktop",
301337
]
302338

339+
# Add session-based exclusions (exclude _x11 in Wayland, exclude non-_x11 in X11)
340+
excluded_patterns.extend(self._get_session_excluded_patterns())
341+
303342
result = []
304343

305344
# Find files in /usr/share/applications/bigcontrolcenter/
@@ -464,13 +503,18 @@ def _get_replacements(self):
464503
{
465504
"app_id": "avahi-discover",
466505
"app_name": _("Search for Zeroconf servers"),
467-
"app_icon": "preferences-system-network-server",
468506
"app_categories": "Other",
507+
"app_icon": "network-wired-symbolic",
469508
},
470509
{
471510
"app_id": "br.com.biglinux.networkinfo",
472511
"app_categories": "Star Network",
473512
},
513+
{
514+
"app_id": "kcm_mobile_hotspot",
515+
"app_categories": "Network",
516+
"app_icon": "kcm_mobile_hotspot",
517+
},
474518
{
475519
"app_id": "big-driver-manager",
476520
"app_description": _("Expand device support"),
@@ -500,7 +544,7 @@ def _get_replacements(self):
500544
{
501545
"app_id": "bvnc",
502546
"app_name": _("Search for VNC servers"),
503-
"app_icon": "preferences-desktop-remote-desktop",
547+
"app_icon": "preferences-system-network-remote",
504548
"app_categories": "Other",
505549
},
506550
{
@@ -706,10 +750,18 @@ def _get_replacements(self):
706750
"app_categories": "Network",
707751
},
708752
{
709-
"app_id": "kcm_flatpak",
753+
"app_id": "kcm_app-permissions",
710754
"app_description": _("Manage permissions for Flatpak applications"),
711755
"app_categories": "System",
712756
},
757+
{
758+
"app_id": "kcm_animations",
759+
"app_categories": "Personalization",
760+
},
761+
{
762+
"app_id": "kcm_nighttime",
763+
"app_categories": "Personalization",
764+
},
713765
{
714766
"app_id": "kcm_fonts",
715767
"app_exec": "kcmshell6 kcm_fonts fontinst",
@@ -828,7 +880,7 @@ def _get_replacements(self):
828880
},
829881
{
830882
"app_id": "kcm_powerdevilprofilesconfig",
831-
"app_exec": "kcmshell6 kcm_powerdevilprofilesconfig kcm_energyinfo",
883+
"app_exec": "kcmshell6 kcm_powerdevilprofilesconfig kcm_energyinfo kcm_mobile_power",
832884
"app_description": _("Configure energy saving and battery settings"),
833885
"app_categories": "Hardware",
834886
},

0 commit comments

Comments
 (0)