-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yml
175 lines (150 loc) · 4.71 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
---
- name: linux applications
package: name={{ item }} state=present
become: true
with_items:
- community/rofi-calc
- docker
- ksshaskpass # https://wiki.archlinux.org/index.php/KDE_Wallet#Using_the_KDE_Wallet_to_store_ssh_key_passphrases
- pciutils # for lspci so we can inspect the video card
- pulseaudio # for audio
- ranger # visual file manager
- rofi
- xclip # for commandline clipboard management
- xorg-xrandr # for xwindow resizing/rotating/scaling
- xsel # for commandline clipboard management
- yay # AUR Helper written in go
- name: create a user .config dir
file: path="{{ ansible_env.HOME }}/.config" state=directory mode=0644
- name: create user dir for systemd inits
file: path="{{ ansible_env.HOME }}/.config/systemd/user" state=directory recurse=true owner={{ ansible_ssh_user }} mode=0644
- name: copying ssh-agent systemd init
copy:
src: ssh-agent.service
dest: "{{ ansible_env.HOME }}/.config/systemd/user/ssh-agent.service"
owner: "{{ ansible_ssh_user }}"
mode: 0644
- name: install tlp for power management
package: name={{ item }} state=present
become: true
with_items:
- tlp
- tlp-rdw
- name: ensure user has access to touch inputs
user:
name: "{{ ansible_ssh_user }}"
groups: input
append: true
become: true
- name: install libinput for touchpad gestures
package: name={{ item }} state=present
become: true
with_items:
- xdotool
- libinput-gestures
- name: check if libinput-gestures is installed
command: libinput-gestures-setup status
register: libinput_installed
ignore_errors: true
- name: create temporary installation directory
tempfile:
state: directory
register: temp_build_directory
when: libinput_installed is failed
- name: cloning lib-input-gestures for installation
git:
repo: 'https://github.com/bulletmark/libinput-gestures.git'
dest: "{{ temp_build_directory.path }}"
version: master
when: libinput_installed is failed
- name: installing lib-input-gestures
command:
cmd: make install
chdir: "{{ temp_build_directory.path }}"
creates: /usr/bin/libinput-gestures
become: true
when: libinput_installed is failed
- name: get libinput status
command: libinput-gestures-setup status
register: libinput_status
changed_when: false
- name: set libinput to autostart
command: libinput-gestures-setup autostart
when: '"is not set to autostart" in libinput_status.stdout'
- name: set libinput to start
command: libinput-gestures-setup start
when: '"is not running" in libinput_status.stdout'
# - name: disable quiet splash during bootup
# replace:
# path: /etc/default/grub
# regexp: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"'
# replace: 'GRUB_CMDLINE_LINUX_DEFAULT=""'
# become: true
# register: grub_config
# - name: update grub config
# command: update-grub
# become: true
# when: grub_config is changed
# https://forums.linuxmint.com/viewtopic.php?t=91453
# - name: fix issue with thinkpad x1 carbon volume
# blockinfile:
# path: "/usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common"
# block: |
# [Element Master]
# switch = mute
# volume = ignore
# marker: "; {mark} ANSIBLE MANAGED BLOCK"
# insertbefore: "Element PCM"
# become: true
# https://www.addictivetips.com/ubuntu-linux-tips/fix-media-keys-not-working-on-linux/
- name: install playerctl for full media key support
package: name=playerctl state=present
become: true
- name: add a docker group
group:
name: docker
state: present
system: true
become: true
# https://github.com/docker/docker-snap/issues/1
- name: ensure user has access to docker
user:
name: "{{ ansible_ssh_user }}"
groups: docker
append: true
become: true
- name: check for installed apps
command: pamac list -i
register: installed_apps
changed_when: false
- name: install google-chrome
command: pamac build --keep --no-confirm google-chrome
when: '"google-chrome" not in installed_apps.stdout'
- name: install spotify
command: pamac build --keep --no-confirm spotify
when: '"spotify" not in installed_apps.stdout'
- name: check for an intel graphics card
shell: |
set -o pipefail
lspci | grep VGA
args:
executable: /bin/bash
register: vga_card
changed_when: false
- name: copying x11 config for intel graphics card
copy:
src: 20-intel.conf
dest: /usr/share/X11/xorg.conf.d/
backup: true
mode: 0644
become: true
when: '"Intel Corporation" in vga_card.stdout'
# - name: other applications
# package: name={{ item }} state=present
# become: true
# with_items:
# - adobe-source-code-pro-fonts
# - nerd-fonts-complete
# - neomutt
# - polybar
# - community/sxiv