When using flatpak. Add open function to CLI.

Will open Junction (Flatpak) to select applications
This commit is contained in:
Sagi Dayan 2021-11-25 12:59:22 +02:00
parent bada246014
commit 7ede21e362
Signed by: sagi
GPG key ID: FAB96BFC63B46458

View file

@ -22,3 +22,16 @@
- re.sonny.Junction - re.sonny.Junction
- org.gnome.DejaDup - org.gnome.DejaDup
state: present state: present
- name: Check if open function is set
shell: grep -c "^function open" ~/.shellconfig/functions.sh || true
register: open_test
- name: "Adding 'open' shell function"
ansible.builtin.lineinfile:
name: ~/.shellconfig/functions.sh
line: |
# Open files from CLI via Junction flatpak
function open() { if [[ -f $@ || -d $@ ]]; then flatpak run re.sonny.Junction $@ &>/dev/null; else echo "❌No such file or directory '$@'"; false; fi}
state: present
when: open_test.stdout|int == 0