Author Topic: Ubuntu Desktop Shortcut To Launch Knossos (Supports HiDPi too)  (Read 179 times)

0 Members and 1 Guest are viewing this topic.

Offline MachManX

  • 26
  • The Fight Never Ends...This Is A Fact Of Life!
Ubuntu Desktop Shortcut To Launch Knossos (Supports HiDPi too)
This is a quick guide on how to setup a desktop shortcut on the Ubuntu desktop to launch Knossos rather than having to type in the command in terminal.  I'm using 20.04 but this will probably work on older versions as well.  This can be modified to suit your own distro and/or location of Knossos source files.

First create two files using a text editor:
- x.desktop
- y.py

where x and y are names of your choosing.  It will be safer just to use a continuous word, unless you're a linux expert and can deal with those spaced names.  For example, I named my files 'Knossos.desktop' and 'RunKnossos.py'.  I will be referring to those files as x.desktop and y.py throughout this guide.  So please make the appropriate name changes for the rest of the guide according to what names you have chosen for those files.   Move the x.desktop file to the Desktop folder under the user (home/user/Desktop).  Move the y.py file to the knossos parent folder.

Open x.desktop in a text editor and enter the following data (copy and paste if you like):
Code: [Select]
[Desktop Entry]
Version=1.0
Name=Knossos   
Comment=Runs Knossos
Exec=/path/to/y.py
Icon=/path/to/icon.png
Path=/path/to/parent folder
Terminal=false
Type=Application
Categories=Application;

Name is the text that will show up under the icon after you allow Launching, which I will show you how later.  Exec is the path to the y.py file you created. Icon is the path to the icon (I chose the hlp.png file under the data folder, which is under the knossos parent folder).  Path is the path to the knossos parent folder.  The rest of the options you can leave as is.  Don't forget to save your changes  ;)

Let's edit the y.py file by opening it in a text editor.  Just paste ONE of the following commands inside of it:
Code: [Select]
python3 -m knossos
QT_AUTO_SCREEN_SCALE_FACTOR=1 python3 -m knossos

Use the first command if you have no scaling issues with the GUI.  Use the 2nd command if you have a HiDPi screen, like myself, and/or have scaling issues.  Save your changes  :)

Now for the final step, which may differ amongst distros.  So I cannot say if this works for them; I have only tested this on Ubuntu 20.04.  Go to your physical desktop (physical, AR?, projected particle display?  :confused:), right-click the x.desktop file you just created and click on 'Allow Launching'.  This should make the text below the icon change from x.desktop to the name you chose in the file itself.  It should also change the icon to the path you chose in said file.  If you don't see an icon or something weird, then recheck the path.

Now go ahead and test it by double-clicking on the icon.  It should load Knossos without relying on the terminal.  :yes:
AMD Ryzen 5 3600
B450I GAMING PLUS AC
Geforce GTX 1060 6GB
16GB DDR4-3600
WD SN750 1TB NVME
Samsung 850 EVO 250GB SSD
Corsair HX520W PSU
Cougar QBX Case
NEC V422 42" @ 1080p
Ubuntu 20.04 + Whatever I VM