-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reload-all-desklets@rcalixte (#42)
- Loading branch information
Showing
8 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
### 1.0 | ||
|
||
* Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
RELOAD ALL DESKLETS | ||
=================== | ||
|
||
Reload all enabled desklets in Cinnamon. | ||
|
||
DESCRIPTION | ||
----------- | ||
|
||
This action will reload all desklets that are enabled on the Cinnamon desktop. | ||
The need to do this can arise from situations that may cause desklets to | ||
freeze such as resuming from standby/hibernation, stuck desklets, or even the | ||
occasional disappearing desklet. | ||
|
||
COMPATIBILITY | ||
------------- | ||
|
||
Due to the nature of Actions, this will only be guaranteed to be compatible up | ||
to the latest versions of Cinnamon. Earlier versions of Cinnamon will be | ||
supported on a best efforts basis. | ||
|
||
As of now, this Action supports Cinnamon 5.4+. |
Binary file added
BIN
+257 KB
reload-all-desklets@rcalixte/files/reload-all-desklets@rcalixte/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions
7
reload-all-desklets@rcalixte/files/reload-all-desklets@rcalixte/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"description": "Reload all enabled desklets in Cinnamon", | ||
"uuid": "reload-all-desklets@rcalixte", | ||
"name": "Reload All Desklets", | ||
"author": "rcalixte", | ||
"version": "1.0" | ||
} |
30 changes: 30 additions & 0 deletions
30
...-desklets@rcalixte/files/reload-all-desklets@rcalixte/po/[email protected]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Reload All Desklets | ||
# Copyright (C) 2023 | ||
# Rick Calixte <[email protected]>, 2023. | ||
# | ||
#, fuzzy | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: 1.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2023-12-06 15:54-0500\n" | ||
"PO-Revision-Date: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: Poedit 3.4\n" | ||
|
||
#. metadata.json->description | ||
msgid "Reload all enabled desklets in Cinnamon" | ||
msgstr "" | ||
|
||
#. metadata.json->name | ||
#. Name | ||
msgid "Reload All Desklets" | ||
msgstr "" | ||
|
||
#. Comment | ||
msgid "Reload all enabled Desklets" | ||
msgstr "" |
40 changes: 40 additions & 0 deletions
40
...-all-desklets@rcalixte/files/reload-all-desklets@rcalixte/[email protected]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
import time | ||
|
||
from gi.repository import Gio, GLib | ||
|
||
BUS_TYPE: Gio.BusType = Gio.BusType.SESSION | ||
DBUS_PATH: str = 'org.Cinnamon' | ||
DESKLET: str = 'DESKLET' | ||
FLAG: Gio.DBusProxyFlags = Gio.DBusProxyFlags.NONE | ||
GSETTING: str = '/org/Cinnamon' | ||
KEY: str = 'enabled-desklets' | ||
SETTINGS: str = 'org.cinnamon' | ||
|
||
|
||
def main(): | ||
settings: Gio.Settings = Gio.Settings.new(SETTINGS) | ||
enabled_desklets: set = {x.split(':')[0] for x in settings.get_strv(KEY)} | ||
|
||
try: | ||
proxy: Gio.DBusProxy = Gio.DBusProxy.new_for_bus_sync(BUS_TYPE, FLAG, | ||
None, DBUS_PATH, | ||
GSETTING, | ||
DBUS_PATH, None) | ||
except GLib.Error: | ||
return | ||
|
||
if not proxy: | ||
sys.exit(1) | ||
|
||
for desklet in enabled_desklets: | ||
proxy.ReloadXlet('(ss)', desklet, DESKLET) | ||
time.sleep(0.05) | ||
proxy.ReloadXlet('(ss)', desklet, DESKLET) | ||
time.sleep(0.01) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"author": "rcalixte" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[Nemo Action] | ||
_Name=Reload All Desklets | ||
_Comment=Reload all enabled Desklets | ||
Exec=<reload-all-desklets@rcalixte/[email protected]> | ||
Icon-Name=mail-send-receive-symbolic | ||
Selection=None | ||
Extensions=any; | ||
Conditions=desktop; |