Refactor theme switcher to use GSubprocess and streamline GSettings usage #1

Merged
arzumify merged 1 commits from scriptod/dconf-theme-switcher:main into main 2024-01-16 13:33:58 +00:00
Contributor

I've replaced the system() calls with GSubprocess to improve security and control, using GSubprocess is more secure because it avoids shell interpolation risks that can occur with system() calls. This <------ means there's less chance of injection attacks where arbitrary commands could be executed. It also gives us better control over the execution environment, including file descriptor inheritance and signal handling, making it a more robust solution for managing child processes

I've added error handling for subprocess calls to ensure we get clear feedback if there are issues starting or stopping the wf-panel process, this is the (the) way, if a subprocess fails to launch or if there's a problem sending it signals, we'll know exactly what went wrong.

By combining the theme switching into a single function, I've reduced code duplication his makes the "codebase" cleaner and easier to maintain since any changes to theme switching only need to be made in one place.

I've eliminated redundant GSettings object creation by reusing the same GSettings objects where possible, which makes the code more efficient.

Darling, lastly I ensured that unused parameters in signal handler functions are explicitly cast to (void) to avoid compiler warnings about unused parameters, this clearly keeps the code tidy and warning-free beautiful.

I've replaced the system() calls with GSubprocess to improve security and control, using GSubprocess is more secure because it avoids shell interpolation risks that can occur with system() calls. This <------ means there's less chance of injection attacks where arbitrary commands could be executed. It also gives us better control over the execution environment, including file descriptor inheritance and signal handling, making it a more robust solution for managing child processes I've added error handling for subprocess calls to ensure we get clear feedback if there are issues starting or stopping the wf-panel process, this is the (the) way, if a subprocess fails to launch or if there's a problem sending it signals, we'll know exactly what went wrong. By combining the theme switching into a single function, I've reduced code duplication his makes the "codebase" cleaner and easier to maintain since any changes to theme switching only need to be made in one place. I've eliminated redundant GSettings object creation by reusing the same GSettings objects where possible, which makes the code more efficient. Darling, lastly I ensured that unused parameters in signal handler functions are explicitly cast to (void) to avoid compiler warnings about unused parameters, this clearly keeps the code tidy and warning-free beautiful.
scriptod added 1 commit 2024-01-13 09:51:23 +00:00
94015a33cb Refactor theme switcher to use GSubprocess and streamline GSettings usage
I've replaced the system() calls with GSubprocess to improve security and control, using GSubprocess is more secure because it avoids shell interpolation risks that can occur with system() calls. This <------ means there's less chance of injection attacks where arbitrary commands could be executed. It also gives us better control over the execution environment, including file descriptor inheritance and signal handling, making it a more robust solution for managing child processes

I've added error handling for subprocess calls to ensure we get clear feedback if there are issues starting or stopping the wf-panel process, this is the (the) way, if a subprocess fails to launch or if there's a problem sending it signals, we'll know exactly what went wrong.

By combining the theme switching into a single function, I've reduced code duplication his makes the "codebase" cleaner and easier to maintain since any changes to theme switching only need to be made in one place.

I've eliminated redundant GSettings object creation by reusing the same GSettings objects where possible, which makes the code more efficient.

Darling, lastly I ensured that unused parameters in signal handler functions are explicitly cast to (void) to avoid compiler warnings about unused parameters, this clearly keeps the code tidy and warning-free beautiful.
arzumify merged commit 82927ed2c0 into main 2024-01-16 13:33:58 +00:00
This repo is archived. You cannot comment on pull requests.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Ailur-Archives/dconf-theme-switcher#1
No description provided.