Skip to content

Commit 0111648

Browse files
committed
install keepassxc with flatpak
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
1 parent b701116 commit 0111648

File tree

5 files changed

+47
-1
lines changed

5 files changed

+47
-1
lines changed

ci-inventory.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ local:
4949
#- git
5050
#- gitk
5151
#- gnome-tweaks
52-
#- keepassxc
5352
#- nextcloud-desktop
5453
- tig
5554
#- vlc
5655
#- xournal
5756

57+
basic_utils:
58+
enable_keepassxc: false
59+
5860
git:
5961
config:
6062
user_name: "User"

playbook.yml

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
- role: ansible-role-visual-studio-code
4848
when: enable_visula_studio_code | default(false)
4949

50+
- role: basic_utils
51+
5052
post_tasks:
5153
- include_tasks: tasks/ubuntu_cleanup.yml
5254
when: enable_ubuntu_cleanup | default(false)

roles/basic_utils/meta/main.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
dependencies:
3+
- role: flatpak

roles/basic_utils/tasks/main.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
- name: basic_utils print var
2+
debug:
3+
var: basic_utils
4+
5+
# region keepassxc
6+
- name: install keepassxc flatpak
7+
when: basic_utils.enable_keepassxc | default(false)
8+
command: flatpak install flathub org.keepassxc.KeePassXC --assumeyes
9+
10+
- name: Modify Desktop file
11+
when: basic_utils.enable_keepassxc | default(false)
12+
become: true
13+
lineinfile:
14+
dest="/var/lib/flatpak/exports/share/applications/org.keepassxc.KeePassXC.desktop"
15+
line="{{ item.line }}"
16+
regexp="{{ item.regexp }}"
17+
state=present
18+
insertafter=EOF
19+
create=True
20+
mode="u+rw"
21+
with_items:
22+
- {
23+
regexp: "^Exec=",
24+
line: "Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=keepassxc --file-forwarding org.keepassxc.KeePassXC --platform xcb @@ %f @@",
25+
}
26+
# manually to do:
27+
# enable ssh-agent integration
28+
# enable auto type for shortcut
29+
30+
# endregion

roles/flatpak/tasks/main.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
- name: install flatpak
2+
become: true
3+
package:
4+
name: flatpak
5+
6+
- name: add flathub repository
7+
become: true
8+
command: |
9+
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

0 commit comments

Comments
 (0)