Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add executable and desktop icon #2

Open
wants to merge 2 commits 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
11 changes: 11 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,14 @@
- configuration
- pycharm
- pycharm-install

- name: Retrieve pycharm dir name
command: "ls -t {{ pycharm_install_prefix }}"
register: result_pycharm_folder_name
changed_when: no

- name: Ensure pycharm bin exist
template: src=pycharm.j2 dest=/usr/bin/pycharm mode=755

- name: Ensure pycharm shortcut is present
template: src=pycharm.desktop.j2 dest=/usr/share/applications/pycharm.desktop
Empty file removed templates/empty
Empty file.
11 changes: 11 additions & 0 deletions templates/pycharm.desktop.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# {{ ansible_managed }}
[Desktop Entry]
Encoding=UTF-8
Name=PyCharm
Comment=PyCharm
Exec=pycharm
Icon={{ pycharm_install_prefix }}/{{ pycharm_folder_name }}/bin/pycharm.png
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true
4 changes: 4 additions & 0 deletions templates/pycharm.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
export PYCHARM_HOME="{{ pycharm_install_prefix }}/{{ pycharm_folder_name }}/bin"

$PYCHARM_HOME/pycharm.sh $*
2 changes: 2 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# vars file for pycharm
---
pycharm_downloads_path: /var/lib/ansible/pycharm/downloads

pycharm_folder_name: "{{ result_pycharm_folder_name.stdout_lines.0 }}"