From b9affc6c795a4ddfcddab8387380495735fb5a94 Mon Sep 17 00:00:00 2001 From: Raihan93-coder Date: Mon, 8 Jun 2026 12:58:36 +0530 Subject: [PATCH 1/6] Config option: Persitent Logging initialization in config.ini (default: False) --- src/packages/buskill/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/buskill/__init__.py b/src/packages/buskill/__init__.py index 830472b21..6728b6487 100644 --- a/src/packages/buskill/__init__.py +++ b/src/packages/buskill/__init__.py @@ -427,7 +427,7 @@ def __init__(self): # top to make UX *slightly* better for a user who wants to manually # edit the config file. if we don't do this, then kivy will put it # below its own settings, making the user scroll a lot to find them - contents = "[buskill]\n" + contents = "[buskill]\npersistent_log = False\n" # Updating the config option with open( self.CONF_FILE, 'w' ) as fd: fd.write( contents ) From 65788d2e3d4889af345d058872044cd8162441f3 Mon Sep 17 00:00:00 2001 From: Raihan93-coder Date: Wed, 10 Jun 2026 18:43:34 +0530 Subject: [PATCH 2/6] Config option: Added Persistent toggle option in GUI --- src/packages/buskill/settings_buskill.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/packages/buskill/settings_buskill.json b/src/packages/buskill/settings_buskill.json index 8ea93bd42..deb98ea6c 100644 --- a/src/packages/buskill/settings_buskill.json +++ b/src/packages/buskill/settings_buskill.json @@ -12,6 +12,23 @@ "confirmation": ["", "This selection may cause data loss! Are you sure you want to continue?\n\nThe 'soft-shutdown' trigger will immediately cause your computer to shutdown. This could cause you to lose work if, for example, you're writing an email or typing a text document.\n\nAre you sure you want to select the 'soft-shutdown' trigger, despite the risk of data loss?" ], "options_icons": ["\ue1bf","\ue62a"] }, + { + "type": "title", + "title": "Buskill Complex Settings Option" + }, + { + "icon": "", + "type": "complex-options", + "title": "Persistent Logging", + "desc": "DO you want to store the log ?", + "section": "buskill", + "key": "persistent_log", + "options": ["True","False"], + "options_human": ["True","False"], + "options_long": ["Log file will be not deleted after your system restarts","Log file will be deleted once you restart the computer"], + "confirmation": ["Please restart the app so the changes can be implimented","Please restart the app so the changes can be implimented"], + "options_icons": ["",""] + }, { "type": "title", "title": "Look & Feel" From 5451efd62891d067e1c5f17fe3f5ebafdb964116 Mon Sep 17 00:00:00 2001 From: Raihan93-coder Date: Mon, 15 Jun 2026 10:16:16 +0530 Subject: [PATCH 3/6] Add persistent logging settings UI and fix settings reset crash --- src/buskill_gui.py | 1 + src/packages/buskill/settings_buskill.json | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/buskill_gui.py b/src/buskill_gui.py index e8d3c7619..0eff1e684 100755 --- a/src/buskill_gui.py +++ b/src/buskill_gui.py @@ -1418,6 +1418,7 @@ def build_config(self, config): Config.read( self.bk.CONF_FILE ) Config.setdefaults('buskill', { 'buskill_trigger': 'lock-screen', + 'persistent_log': 'False' }) # TODO: don't hard-code this, pull it from kivy/config.py diff --git a/src/packages/buskill/settings_buskill.json b/src/packages/buskill/settings_buskill.json index deb98ea6c..d1eb60241 100644 --- a/src/packages/buskill/settings_buskill.json +++ b/src/packages/buskill/settings_buskill.json @@ -13,11 +13,7 @@ "options_icons": ["\ue1bf","\ue62a"] }, { - "type": "title", - "title": "Buskill Complex Settings Option" - }, - { - "icon": "", + "icon": "\ue873", "type": "complex-options", "title": "Persistent Logging", "desc": "DO you want to store the log ?", @@ -27,7 +23,7 @@ "options_human": ["True","False"], "options_long": ["Log file will be not deleted after your system restarts","Log file will be deleted once you restart the computer"], "confirmation": ["Please restart the app so the changes can be implimented","Please restart the app so the changes can be implimented"], - "options_icons": ["",""] + "options_icons": ["\ue161","\ue5cd"] }, { "type": "title", From de4a2bde0d418e84e022af44afe6fe73f3cb251e Mon Sep 17 00:00:00 2001 From: Raihan93-coder Date: Tue, 16 Jun 2026 07:40:41 +0530 Subject: [PATCH 4/6] Updated the description --- src/packages/buskill/settings_buskill.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/buskill/settings_buskill.json b/src/packages/buskill/settings_buskill.json index d1eb60241..26816a205 100644 --- a/src/packages/buskill/settings_buskill.json +++ b/src/packages/buskill/settings_buskill.json @@ -16,7 +16,7 @@ "icon": "\ue873", "type": "complex-options", "title": "Persistent Logging", - "desc": "DO you want to store the log ?", + "desc": "Do you want to store the log file persistently (keeping the data after your computer reboots)?", "section": "buskill", "key": "persistent_log", "options": ["True","False"], From 481fb55edad897817cee8c56af752d5d2c531685 Mon Sep 17 00:00:00 2001 From: Raihan93-coder Date: Wed, 17 Jun 2026 14:27:25 +0530 Subject: [PATCH 5/6] Setup Universal Default value for both GUI and CLI --- src/buskill_gui.py | 5 +---- src/packages/buskill/__init__.py | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/buskill_gui.py b/src/buskill_gui.py index 0eff1e684..cc16611fb 100755 --- a/src/buskill_gui.py +++ b/src/buskill_gui.py @@ -1416,10 +1416,7 @@ def build_config(self, config): importlib.reload( kivy.config ) Config.read( self.bk.CONF_FILE ) - Config.setdefaults('buskill', { - 'buskill_trigger': 'lock-screen', - 'persistent_log': 'False' - }) + Config.setdefaults('buskill', self.bk.DEFAULT_CONF) # For more future only have to update the DEFAULT_CONF value in __init__.py # TODO: don't hard-code this, pull it from kivy/config.py # * https://stackoverflow.com/questions/78216476/how-to-get-kivy-to-set-its-defaults-in-the-config-at-runtime diff --git a/src/packages/buskill/__init__.py b/src/packages/buskill/__init__.py index 6728b6487..f193ff4b1 100644 --- a/src/packages/buskill/__init__.py +++ b/src/packages/buskill/__init__.py @@ -419,6 +419,12 @@ def __init__(self): # path to buskill's config file self.CONF_FILE = os.path.join( self.DATA_DIR, "config.ini" ) + # Setting up universal default value for both GUI and CLI config options + self.DEFAULT_CONF = { + 'buskill_trigger': 'lock-screen', + 'persistent_log': self.PERSISTENT_LOG + } + # does the config file exist already? if not os.path.exists( self.CONF_FILE ): # the config file doesn't exist yet; create it @@ -427,10 +433,20 @@ def __init__(self): # top to make UX *slightly* better for a user who wants to manually # edit the config file. if we don't do this, then kivy will put it # below its own settings, making the user scroll a lot to find them - contents = "[buskill]\npersistent_log = False\n" # Updating the config option + contents = "[buskill]\n" with open( self.CONF_FILE, 'w' ) as fd: fd.write( contents ) + # For CLI and GUI config option Initialising it when the config.ini file is created + # So when ever any new config option is to be added only have to add it to self.DEFAULT_CONF dict + # This will only run once when user either runs CLI or GUI + # The users who run the CLI can change the file manually and still the user change persist + config = configparser.ConfigParser() + config.read( self.CONF_FILE ) + config['buskill'] = self.DEFAULT_CONF + with open(self.CONF_FILE, 'w') as fd: + config.write(fd) + msg = "DEBUG: CACHE_DIR:|" +str(self.CACHE_DIR)+ "|\n" msg = "DEBUG: CONF_FILE:|" +str(self.CONF_FILE)+ "|\n" print( msg ); logger.debug( msg ) From 986ebd784172c6d6491ba6c40d17f1d82bb2e193 Mon Sep 17 00:00:00 2001 From: Raihan93-coder Date: Wed, 17 Jun 2026 15:50:10 +0530 Subject: [PATCH 6/6] Typo error --- src/buskill_gui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buskill_gui.py b/src/buskill_gui.py index cc16611fb..6996fa6cb 100755 --- a/src/buskill_gui.py +++ b/src/buskill_gui.py @@ -1416,7 +1416,7 @@ def build_config(self, config): importlib.reload( kivy.config ) Config.read( self.bk.CONF_FILE ) - Config.setdefaults('buskill', self.bk.DEFAULT_CONF) # For more future only have to update the DEFAULT_CONF value in __init__.py + Config.setdefaults('buskill', self.bk.DEFAULT_CONF) # For more config option in future, only have to update the DEFAULT_CONF value in __init__.py # TODO: don't hard-code this, pull it from kivy/config.py # * https://stackoverflow.com/questions/78216476/how-to-get-kivy-to-set-its-defaults-in-the-config-at-runtime