Manage favorites menu
This commit is contained in:
parent
0a716d469c
commit
203e6f58dd
@ -3,3 +3,8 @@ development: true
|
||||
|
||||
users:
|
||||
- name: vagrant
|
||||
|
||||
favorites:
|
||||
- firefox-esr.desktop
|
||||
- terminator.desktop
|
||||
- org.remmina.Remmina.desktop
|
||||
|
24
roles/common/defaults/main.yml
Normal file
24
roles/common/defaults/main.yml
Normal file
@ -0,0 +1,24 @@
|
||||
# Follows homelab package list:
|
||||
# https://github.com/krislamo/moxie/blob/master/roles/base/defaults/main.yml
|
||||
moxie_packages:
|
||||
- cryptsetup
|
||||
- curl
|
||||
- dnsutils
|
||||
- hashdeep
|
||||
- htop
|
||||
- jq
|
||||
- kpartx
|
||||
- ncdu
|
||||
- rsync
|
||||
- screen
|
||||
- strace
|
||||
- tree
|
||||
- vim
|
||||
- wget
|
||||
|
||||
packages:
|
||||
- "{{ moxie_packages }}"
|
||||
- firefox-esr
|
||||
- meld
|
||||
- remmina
|
||||
- terminator
|
@ -8,6 +8,7 @@
|
||||
apt:
|
||||
name: fasttrack-archive-keyring
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: Enable fasttrack
|
||||
copy:
|
||||
|
@ -20,3 +20,21 @@
|
||||
lookandfeeltool -a $(lookandfeeltool --list | grep dark)
|
||||
fi
|
||||
loop: "{{ users }}"
|
||||
|
||||
- name: Install packages
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
loop: "{{ packages }}"
|
||||
|
||||
- name: Install sqlite3
|
||||
apt:
|
||||
name: sqlite3
|
||||
state: present
|
||||
|
||||
- name: Change favorites menu
|
||||
template:
|
||||
src: favorites.sh.j2
|
||||
dest: "/home/{{ item.name }}/.config/autostart-scripts/favorites.sh"
|
||||
mode: a+x
|
||||
loop: "{{ users }}"
|
||||
tags: debug
|
||||
|
18
roles/common/templates/favorites.sh.j2
Normal file
18
roles/common/templates/favorites.sh.j2
Normal file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
sqlite3 ~/.local/share/kactivitymanagerd/resources/database <<-EOF
|
||||
CREATE TEMPORARY TABLE FavoritesList (usedActivity TEXT, initiatingAgent TEXT, targettedResource TEXT);
|
||||
INSERT INTO FavoritesList (usedActivity, initiatingAgent, targettedResource)
|
||||
VALUES
|
||||
{% for item in favorites %}
|
||||
(":global", "org.kde.plasma.favorites.applications", "{{ item }}"){{ "," if not loop.last else ";" }}
|
||||
{% endfor %}
|
||||
|
||||
INSERT INTO ResourceLink (usedActivity, initiatingAgent, targettedResource)
|
||||
SELECT f.usedActivity, f.initiatingAgent, f.targettedResource
|
||||
FROM FavoritesList AS f
|
||||
WHERE f.targettedResource NOT IN (SELECT targettedResource FROM ResourceLink);
|
||||
|
||||
DELETE FROM ResourceLink
|
||||
WHERE targettedResource NOT IN (SELECT targettedResource FROM FavoritesList);
|
||||
EOF
|
Loading…
Reference in New Issue
Block a user