Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,21 @@ unidesk
```
src/unidesk/
main.py entry point
home.py main window and all navigation logic
text_data.py loads the text below from the bundled JSON
academic_config.py reads/writes the shared academic profile
helpers/
text_data.py loads the text below from the bundled JSON
academic_config.py reads/writes the shared academic profile
autostart.py manages launching UniDesk at login
ui/
main_window.py main window and all navigation logic
widgets.py shared widget helpers
pages/ builders for each page (text, links, credits, academic config)
styles/
loader.py loads the bundled .qss stylesheets and assets
check.svg checkmark icon for checkboxes
widgets/
controls.qss buttons, checkbox and combo box roles
labels.qss label text roles
layout.qss backgrounds for windows, bars, cards and dividers
assets/text_data/
pages.json body text for each informational page
faq.json FAQ entries as question/answer pairs
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
packages=find_packages(where="src"),
package_data={
"unidesk.assets.text_data": ["*.json"],
"unidesk.styles": ["*/*.qss", "*.svg"],
},
install_requires=["PyQt6"],
entry_points={
Expand Down
Empty file added src/unidesk/helpers/__init__.py
Empty file.
File renamed without changes.
29 changes: 29 additions & 0 deletions src/unidesk/helpers/autostart.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import os

# Disabling autostart drops a hidden override of the system-wide entry that
# the package installs in /etc/xdg/autostart.
AUTOSTART_PATH = os.path.expanduser("~/.config/autostart/unidesk.desktop")

_DISABLED_ENTRY = (
"[Desktop Entry]\nType=Application\nName=UniDesk\n"
"Exec=unidesk\nIcon=unios\nTerminal=false\n"
"X-KDE-autostart-condition=false\nHidden=true\n"
)


def is_autostart_disabled():
if not os.path.exists(AUTOSTART_PATH):
return False
with open(AUTOSTART_PATH) as f:
return "Hidden=true" in f.read()


def set_autostart(enabled):
"""Enable autostart by removing the user override, or disable it by writing one."""
if enabled:
if os.path.exists(AUTOSTART_PATH):
os.remove(AUTOSTART_PATH)
else:
os.makedirs(os.path.dirname(AUTOSTART_PATH), exist_ok=True)
with open(AUTOSTART_PATH, "w") as f:
f.write(_DISABLED_ENTRY)
File renamed without changes.
Loading
Loading