Skip to content

Commit

Permalink
install keepassxc with flatpak
Browse files Browse the repository at this point in the history
There was no snap, and like this it's a little containerized.
--platform xcb switches to an x11 environment because there
auto type works.

See keepassxreboot/keepassxc#2281
  • Loading branch information
BacLuc committed Dec 22, 2024
1 parent b701116 commit 50a2730
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ci-inventory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ local:
#- git
#- gitk
#- gnome-tweaks
#- keepassxc
#- nextcloud-desktop
- tig
#- vlc
#- xournal

basic_utils:
enable_keepassxc: true

git:
config:
user_name: "User"
Expand Down
2 changes: 2 additions & 0 deletions playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
- role: ansible-role-visual-studio-code
when: enable_visula_studio_code | default(false)

- role: basic_utils

post_tasks:
- include_tasks: tasks/ubuntu_cleanup.yml
when: enable_ubuntu_cleanup | default(false)
3 changes: 3 additions & 0 deletions roles/basic_utils/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
- name: Reload desktop database
command: update-desktop-database
3 changes: 3 additions & 0 deletions roles/basic_utils/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
dependencies:
- role: flatpak
29 changes: 29 additions & 0 deletions roles/basic_utils/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
- name: basic_utils print var
debug:
var: basic_utils

# region keepassxc
- name: install keepassxc flatpak
when: basic_utils.enable_keepassxc | default(false)
command: flatpak install flathub org.keepassxc.KeePassXC --assumeyes

- name: Modify Desktop file
become: true
lineinfile:
dest="/var/lib/flatpak/app/org.keepassxc.KeePassXC/current/active/files/share/applications/org.keepassxc.KeePassXC.desktop"
line="{{ item.line }}"
regexp="{{ item.regexp }}"
state=present
insertafter=EOF
create=True
mode="u+rw"
with_items:
- { regexp: "^Exec=", line: "Exec=keepassxc --platform xcb %f" }
- { regexp: "^TryExec=", line: "TryExec=keepassxc --platform xcb" }
notify:
- Reload desktop database
# manually to do:
# enable ssh-agent integration
# enable auto type for shortcut

# endregion
4 changes: 4 additions & 0 deletions roles/flatpak/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: install flatpak
become: true
package:
name: flatpak

0 comments on commit 50a2730

Please sign in to comment.