Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

fix .desktop support #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ docker pull mundialis/docker-qgis2


You can download a convenient "qgis2" startup script here: [qgis2](https://raw.githubusercontent.com/mundialis/docker-qgis2/master/qgis2).

Download the file and store it either into `$HOME/bin/` or in `/usr/local/bin/` (or likewise into a directory listed in your PATH environment variable) and set the "executable" flag of the script.
Hence, be sure to make the "qgis2" script an executable:
```
chmod a+x qgis2
```

A .desktop file can be used as well for starting QGIS from a desktop environment.
Modify the paths to the qgis2 launch script and the icon inside `qgis.desktop` (must be full absolute paths!), then copy it:
```
cp qgis.desktop ~/.local/share/applications
```

## Usage

Simply run
Expand All @@ -46,6 +51,8 @@ then
docker rm <process id or container name>
```

In case the launch script doesn't work properly, try adding the `-t` flag to the `docker run` command.
This will break launching from the desktop environment though.

## Acknowledgements

Expand Down
6 changes: 3 additions & 3 deletions qgis.desktop
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
[Desktop Entry]
Name=QGIS 2.18 LTR in Docker
GenericName=QGIS 2.18 LTR in Docker
Comment=GIS 2.18 LTR in Docker
Exec=~/Documents/launch_scripts/docker_qgis.sh %U
Comment=QGIS 2.18 LTR in Docker
Exec=/home/norwin/bin/qgis2 %U
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here the user name is hardcoded, could that be changed?

Copy link
Author

@noerw noerw Sep 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is what this PR is primarily about:
In my environment (Gnome 3.32.2), the .desktop file is not recognized when relative paths or enironment variables are in the path.

Terminal=false
Type=Application
StartupNotify=true
MimeType=text/shp;
Icon=/usr/local/qgis-icon-60x60.png
Icon=/home/norwin/src/docker-qgis2/qgis-icon-60x60.png
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here the user name is hardcoded, could that be changed?

Categories=Science
4 changes: 2 additions & 2 deletions qgis2
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ USER_NAME=`basename $HOME`
# --rm will remove the container as soon as it ends


sudo docker run --rm --name qgis2 \
-it \
docker run --rm --name qgis2 \
-i \
-v ${HOME}:/home/${USER_NAME} \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=unix$DISPLAY \
Expand Down