Posts

Showing posts with the label linux

.desktop files on Ubuntu

It took me a whole hour to figure how to set up a .desktop file on Ubuntu which honestly seems unnecessarily complicated. In previous versions of Ubuntu, there was a GUI (gnome-desktop-item-edit) which aided in this process but unfortunately, this appears to have been removed. Here are some useful notes to set up .desktop files .desktop file format example #!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Type=Application Terminal=false Exec=/usr/bin/gedit %U Name=Test_1 Comment=comment here Icon= What's the %U in the Exec file? It's a parameter for the Exec key in .desktop files (defined in the Desktop Entry Specification) that describes how arguments to the program (from the file manager/program launcher, e.g. multiple selected files) should be handled Make the desktop file executable and copy it to /.local/share/applications Launching the file from the terminal gtk-launch something.desktop  

gnuplot: Tips and tricks

  Presented in UCDavis Physics and Astronomy code review on March 17, 2023. check out the post here

Setting default applications in Ubuntu

  This post covers how to set default applications in Ubuntu from the command line using the mimeopen script. Example : Open .fits files always on ds9 ds9 is a program (stored in /home/bin/ds9) that allows astronomers to explore data (.fits files) taken at the telescope. Here's what I did to set that as the default application for opening any .fits file: ubuntu@ubuntu:~/$ mimeopen -d 22_23.fits Please choose a default application for files of type image/fits     1) home  (home-usercreated-1)     2) Siril  (org.free-astro.siril)     3) Munipack  (xmunipack)     4) Atom  (atom)     5) Other... use application #5 use command: /home/bin/ds9 Opening "22_23.fits"   (image/fits) References https://unix.stackexchange.com/questions/293433/where-mimeopen-saves-default-app-config https://askubuntu.com/questions/90214/how-do-i-set-the-default-program https://linux.die.net/man/1/mimeope...