Running from source using a .desktop file
See original GitHub issueI’m running activitywatch directly from source (latest master) and it is working fine:
$ cd ~/.apps/activitywatch
$ . venv/bin/activate
$ aw-qt
But I obviously don’t want to manually do these steps every time I start my machine. So I created a .desktop file:
[Desktop Entry]
Name=ActivityWatch
Exec="/home/dufferzafar/.apps/activitywatch/venv/bin/aw-qt"
Icon=/home/dufferzafar/.apps/activitywatch/aw-qt/media/logo/logo.png
GenericName=Log what you do on your computer.
Type=Application
Terminal=false
Hidden=False
X-KDE-autostart-after=panel
X-KDE-StartupNotify=false
X-KDE-UniqueApplet=true
Categories=Utility;
X-GNOME-Autostart-enabled=true
But this .desktop file doesn’t work, I get the following error when trying to launch it:
$ kioclient exec ~/.local/share/applications/activity-watch.desktop
kioclient(13640) ClientApp::kde_open: KUrl("file:///home/dufferzafar/.local/share/applications/activity-watch.desktop")
2018-03-18 11:00:27 [INFO ]: Starting module aw-server (aw_qt.manager:46)
Traceback (most recent call last):
File "/home/dufferzafar/.apps/activitywatch/venv/bin/aw-qt", line 11, in <module>
sys.exit(main())
File "/home/dufferzafar/.apps/activitywatch/venv/lib/python3.5/site-packages/aw_qt/main.py", line 19, in main
_manager.autostart(args.autostart_modules)
File "/home/dufferzafar/.apps/activitywatch/venv/lib/python3.5/site-packages/aw_qt/manager.py", line 137, in autostart
self.start("aw-server")
File "/home/dufferzafar/.apps/activitywatch/venv/lib/python3.5/site-packages/aw_qt/manager.py", line 130, in start
self.modules[module_name].start()
File "/home/dufferzafar/.apps/activitywatch/venv/lib/python3.5/site-packages/aw_qt/manager.py", line 59, in start
self._process = subprocess.Popen(exec_cmd, universal_newlines=True)
File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'aw-server'
This is happening because it can’t find aw-server in my $PATH. How can I change the $PATH attribute just for the .desktop file? or maybe there’s some other way to get aw-qt to autostart?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Running a .desktop file in the terminal - Ask Ubuntu
If I open that folder in nautilus , I can run these applications just by double clicking its associated file, e.g. double-clicking firefox.desktop...
Read more >How to Create a .Desktop File for Your Application in Linux
Run Arronax by either running the command below or typing “arronax” while in the Application Menu. This will bring up a window where...
Read more >Deploy Google Drive for desktop
With Drive for desktop, you stream your Drive files directly from the cloud to your Mac or PC, freeing up disk space and...
Read more >DocFetcher - Fast Document Search
DocFetcher is an Open Source desktop search application: It allows you to search the contents of files on your computer. — You can...
Read more >File actions reference - Power Automate | Microsoft Learn
To access these resources using the file actions, run Power Automate with ... You can find an example desktop flow that handles CSV...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

We could also ship the AUR package with a .desktop file since we can in that case guarantee the path of the executable.
I consider this solved. The
.desktopfile shipped with the AUR package should be considered the canonical version.