mirror of
https://gitlab.com/sagidayan/linux-config.git
synced 2024-11-21 23:05:25 +00:00
When using flatpak. Add open function to CLI.
Will open Junction (Flatpak) to select applications
This commit is contained in:
parent
bada246014
commit
7ede21e362
1 changed files with 13 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue