awamper / draobpilc

GPaste GUI
GNU General Public License v3.0
52 stars 6 forks source link

Desktop File could not be installed #6

Closed meistadieb closed 8 years ago

meistadieb commented 8 years ago

In general draobpilc is no registered command after installation, therefor I'm running it from ~/user/.local/bin

If I start it from console, I also have to use 'python3 draobpilc' instead of just 'draobpilc'

After get it running, I tried to install the desktop file via 'python3 draobpilc --install-desktop-file'. Doing so, I get a traceback:

python3 draobpilc --install-desktop-file /home/user/.local/lib/python3.5/site-packages/draobpilc/lib/utils.py:25: PyGIWarning: Notify was imported without specifying a version first. Use gi.require_version('Notify', '0.7') before import to ensure that the right version gets loaded. from gi.repository import Notify /home/user/.local/lib/python3.5/site-packages/draobpilc/widgets/preferences.py:24: PyGIWarning: GPaste was imported without specifying a version first. Use gi.require_version('GPaste', '1.0') before import to ensure that the right version gets loaded. from gi.repository import GPaste Creating "/home/user/.local/share/applications/Draobpilc.desktop". Creating "/home/user/.local/share/applications/Draobpilc_prefs.desktop". Traceback (most recent call last): File "draobpilc", line 11, in sys.exit(run()) File "/home/user/.local/lib/python3.5/site-packages/draobpilc/main.py", line 201, in run install_desktop_file() File "/home/user/.local/lib/python3.5/site-packages/draobpilc/main.py", line 115, in install_desktop_file with open(prefs_tpl, encoding='utf-8') as tpl_file: FileNotFoundError: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/home/user/.local/lib/python3.5/site-packages/draobpilc/data/preferences_desktop_file.tpl'

awamper commented 8 years ago

Try to remove it completely and install with

sudo pip3 install git+https://github.com/awamper/draobpilc

meistadieb commented 8 years ago

I still have to start it from ~/user/.local/bin. There is only a little difference in the traceback, it is referencing line 9 instead of line 11:

python3 draobpilc --install-desktop-file /home/user/.local/lib/python3.5/site-packages/draobpilc/lib/utils.py:25: PyGIWarning: Notify was imported without specifying a version first. Use gi.require_version('Notify', '0.7') before import to ensure that the right version gets loaded. from gi.repository import Notify /home/user/.local/lib/python3.5/site-packages/draobpilc/widgets/preferences.py:24: PyGIWarning: GPaste was imported without specifying a version first. Use gi.require_version('GPaste', '1.0') before import to ensure that the right version gets loaded. from gi.repository import GPaste Creating "/home/user/.local/share/applications/Draobpilc.desktop". Creating "/home/user/.local/share/applications/Draobpilc_prefs.desktop". Traceback (most recent call last): File "draobpilc", line 9, in load_entry_point('Draobpilc==0.2', 'gui_scripts', 'draobpilc')() File "/home/user/.local/lib/python3.5/site-packages/draobpilc/main.py", line 201, in run install_desktop_file() File "/home/user/.local/lib/python3.5/site-packages/draobpilc/main.py", line 115, in install_desktop_file with open(prefs_tpl, encoding='utf-8') as tpl_file: FileNotFoundError: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/home/user/.local/lib/python3.5/site-packages/draobpilc/data/preferences_desktop_file.tpl'

awamper commented 8 years ago

I'm not sure why but it seems like "data/preferences_desktop_file.tpl" doesn't exist. Try to copy this file

https://github.com/awamper/draobpilc/blob/master/draobpilc/data/preferences_desktop_file.tpl

to

/home/user/.local/lib/python3.5/site-packages/draobpilc/data/

meistadieb commented 8 years ago

Yes, the file was missing in /data/

python3 draobpilc --install-desktop-file /home/user/.local/lib/python3.5/site-packages/draobpilc/lib/utils.py:25: PyGIWarning: Notify was imported without specifying a version first. Use gi.require_version('Notify', '0.7') before import to ensure that the right version gets loaded. from gi.repository import Notify /home/user/.local/lib/python3.5/site-packages/draobpilc/widgets/preferences.py:24: PyGIWarning: GPaste was imported without specifying a version first. Use gi.require_version('GPaste', '1.0') before import to ensure that the right version gets loaded. from gi.repository import GPaste File "/home/user/.local/share/applications/Draobpilc.desktop" already exists. Creating "/home/user/.local/share/applications/Draobpilc_prefs.desktop".

I did a 'python3 draobpilc --uninstall-desktop-file' and afterwards a 'python3 draobpilc --install-desktop-file'. Only the "unimportant" errors were shown.

The last remaining question is only wether there should be a tray icon or not.

awamper commented 8 years ago

No tray icon. You can add draopilc to GNOME Shell dash, only one instance allowed so it will be similar to tray icon.

meistadieb commented 8 years ago

AFAIK should draopilc be available in the GNOME Shell dash after the desktop file was created and the shell was reloaded. It is not available. I made the desktop file executable, but it is still not available.

desktop-file-validate ~/.local/share/applications/Draobpilc.desktop /home/user/.local/share/applications/Draobpilc.desktop: warning: key "Encoding" in group "Desktop Entry" is deprecated /home/user/.local/share/applications/Draobpilc.desktop: error: value "0.2" for key "Version" in group "Desktop Entry" is not a known version /home/user/.local/share/applications/Draobpilc.desktop: error: value "Tools;" for key "Categories" in group "Desktop Entry" contains an unregistered value "Tools"; values extending the format should start with "X-" /home/user/.local/share/applications/Draobpilc.desktop: hint: value "Tools;" for key "Categories" in group "Desktop Entry" does not contain a registered main category; application might only show up in a "catch-all" section of the application menu

I removed the above mentioned entries, reloaded the shell, but still not available.

awamper commented 8 years ago

Press and search for draobpilc -> right click -> add to favorites.

meistadieb commented 8 years ago

the "Super" key will not help, ~/.local/bin is not part of $PATH so it can not be searched via "Super". As mentioned, I only can start draobpilc directly from ~/.local/bin

awamper commented 8 years ago

It searches desktop files not execs. Also move draobpilc from ~/.local/bin to /usr/bin or add ~/.local/bin to $PATH. It looks like pip3 works very differently on Ubuntu.

meistadieb commented 8 years ago

I started fresh from sudo pip3 install git+https://github.com/awamper/draobpilc, downloaded the file https://github.com/awamper/draobpilc/blob/master/draobpilc/data/preferences_desktop_file.tpl to /home/user/.local/lib/python3.5/site-packages/draobpilc/data/ and then copied draobpilc from ~/user/.local/bin to /usr/local/bin. Installed the desktop file with draobpilc --install-desktop-file and copied them also to /usr/local/bin. Now I can find draobpilc via the "super" key.