-
Notifications
You must be signed in to change notification settings - Fork 28
/
setup-02-de.yml
665 lines (603 loc) · 23 KB
/
setup-02-de.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
---
- name: Installing Sway desktop environment
hosts: "{{ custom_hosts | default('127.0.0.1') }}"
connection: "{{ custom_connection | default('local') }}"
strategy: linear
vars:
SWAY_DIR: "{{ ansible_user_dir }}/.config/sway"
SWAY_ZSH: false
BIN_DIR: "{{ ansible_user_dir }}/.local/bin"
ROOT_BIN_DIR: "/root/.local/bin"
SYSTEMD_UDIR: "{{ ansible_user_dir }}/.config/systemd/user"
STARSHIP_OPTIONS:
- { section: null, option: add_newline, value: "false" }
- { section: cmd_duration, option: disabled, value: "true" }
- { section: line_break, option: disabled, value: "true" }
HOWTO: |
After a reboot you can start Sway by entering "sway" on the console or let it automatically start after login via the following entry at the beginning of your ~/.bashrc:
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
if [ -f "$FILE" ]; then mv $HOME/sway.log $HOME/sway-prev.log; fi
#exec sway -d 2> $HOME/sway.log
exec sway
fi
Also don't forget to set environment variables. Take a look at the README.md file.
tasks:
- name: Common | Getting Pictures directory
ansible.builtin.command:
cmd: xdg-user-dir PICTURES
register: XDG_OUTPUT
when: not ansible_check_mode
changed_when: false
- name: Common | Setting User Picture directory fact
ansible.builtin.set_fact:
USER_PICTURE_DIR: "{{ XDG_OUTPUT.stdout }}"
when: not ansible_check_mode
- name: Common | Setting USER_PICTURE_DIR for check_mode
ansible.builtin.set_fact:
USER_PICTURE_DIR: "{{ ansible_user_dir }}/Pictures"
when: ansible_check_mode
- name: Arch | Root Tasks
when: ansible_distribution == 'Archlinux'
become: true
block:
- name: Arch | Installing required software
community.general.pacman:
name:
- alacritty
- antiword
- autoconf
- automake
- bemenu
- bemenu-wayland
- blueman
- brightnessctl
- cdrtools
- chafa
- docx2txt
- fakeroot
- ffmpeg
- gcc
#- gammastep
- glow
- gnome-power-manager
- gobject-introspection
- grim
- highlight
- imagemagick
- inetutils
- jq
- kanshi
- lsd
- make
- mako
- ncmpcpp
- network-manager-applet
- noto-fonts-emoji
- odt2txt
#- otf-font-awesome
- pamixer
- pavucontrol
- pcmanfm-gtk3
- perl-image-exiftool
- pipewire-alsa
- pipewire-audio
- pipewire-jack
- pipewire-pulse
- pkgconf
- pkgfile
- playerctl
- polkit-gnome
- python-pywal
- qt5-wayland
- qt6-wayland
- rsync
- slurp
- starship
- swappy
- sway
- swaybg
- swayidle
- swaylock
- thefuck
- ttf-dejavu-nerd
- udiskie
- waybar
- wf-recorder
- wl-clipboard
- xdg-desktop-portal-wlr
- xorg-xwayland
- zsh
state: present
extra_args: --noconfirm --ask=4
#update_cache: true
vars:
mitogen_task_isolation: fork
- name: Arch | Creating ~/.gnupg folder for user aur_builder
ansible.builtin.file:
owner: aur_builder
group: aur_builder
mode: 0700
path: "~/.gnupg"
state: directory
become_user: aur_builder
- name: Arch | Making sure file ~/.gnupg/gpg.conf exists for user aur_builder
ansible.builtin.copy:
content: ""
dest: "~/.gnupg/gpg.conf"
force: false
group: aur_builder
owner: aur_builder
mode: 0640
become_user: aur_builder
#- name: Arch | Adding gpg keyserver for user aur_builder
# ansible.builtin.lineinfile:
# path: "~/.gnupg/gpg.conf"
# regexp: "^keyserver hkp.*"
# line: keyserver pool.sks-keyservers.net
# owner: aur_builder
# group: aur_builder
# mode: 0640
# become_user: aur_builder
- name: Arch | Colors for pacman
community.general.files.ini_file:
path: /etc/pacman.conf
section: options
option: "{{ item.option }}"
owner: root
group: root
allow_no_value: true
mode: 0644
with_items:
- { option: "Color" }
- { option: "ILoveCandy" }
- name: Arch | Installing yay from aur
kewlfft.aur.aur:
name:
- yay
state: present
use: makepkg
become_user: aur_builder
vars:
mitogen_task_isolation: fork
- name: Arch | Installing required software from aur part1
kewlfft.aur.aur:
name:
- archivemount-git
- autotiling
- avizo
- bemenu-dmenu
- bemoji-git
- clipman
- dragon-drop
- edir
#- glow-bin
- j4-dmenu-desktop
- lf
- nwg-look-bin
- pandoc-bin
- shikane
#- otf-font-awesome-4
#- remontoire-git
#- ttf-font-awesome-4
#- wl-clipboard-git
#- wl-clipboard-x11
- wshowkeys-git
state: present
use: yay
extra_args: --pgpfetch
become_user: aur_builder
vars:
mitogen_task_isolation: fork
- name: Arch | Installing required software from aur part2
kewlfft.aur.aur:
name:
- wlsunset
state: present
use: yay
extra_args: --pgpfetch --mflags --skipinteg
become_user: aur_builder
vars:
mitogen_task_isolation: fork
- name: Common | If run in molecule test environment
when: (ansible_hostname == 'instance' and ansible_virtualization_type == 'kvm')
block:
- name: Test Env | Setting GIT_REPO Path
ansible.builtin.set_fact:
GIT_REPO: "{{ ansible_user_dir }}/Git/Sway-DE"
- name: Test Env | Creating directories...
ansible.builtin.file:
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: 0750
path: "{{ item }}"
state: directory
with_items:
- "{{ GIT_REPO }}"
- name: Test Env | Git Clone repository
ansible.builtin.git:
repo: https://github.com/Madic-/Sway-DE.git
dest: "{{ GIT_REPO }}"
- name: Common | Setting GIT_REPO Path
ansible.builtin.set_fact:
GIT_REPO: "{{ playbook_dir }}"
when: not (ansible_hostname == 'instance' and ansible_virtualization_type == 'kvm')
- name: Common | Creating directories...
ansible.builtin.file:
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: 0750
path: "{{ item }}"
state: directory
with_items:
- "{{ SWAY_DIR }}"
- "{{ SWAY_DIR }}/{{ ansible_hostname }}"
- "{{ BIN_DIR }}/sway"
- "{{ BIN_DIR }}/bash"
- "{{ BIN_DIR }}/zsh"
- "{{ SYSTEMD_UDIR }}"
- "{{ ansible_user_dir }}/.config/mako"
- "{{ ansible_user_dir }}/.config/kanshi"
- "{{ ansible_user_dir }}/.config/swappy"
- "{{ ansible_user_dir }}/.config/lf"
- "{{ ansible_user_dir }}/.config/alacritty"
- "{{ ansible_user_dir }}/.config/wal/templates"
- "{{ ansible_user_dir }}/.config/wget"
- "{{ ansible_user_dir }}/.config/zsh"
- "{{ ansible_user_dir }}/.config/xdg-desktpo-portal-wlr"
- "{{ ansible_user_dir }}/.local/share/themes/Windows-10"
- "{{ ansible_user_dir }}/.local/share/icons/Windows-10"
- "{{ USER_PICTURE_DIR }}/screenshots"
- name: Common | Ensure wgetrc exists
ansible.builtin.copy:
content: ""
dest: "{{ ansible_user_dir }}/.config/wget/wgetrc"
force: false
group: "{{ ansible_user_id }}"
owner: "{{ ansible_user_id }}"
mode: 0640
- name: Common | Getting all shell script
ansible.builtin.find:
paths: "{{ GIT_REPO }}/bin/"
patterns: "*.sh"
register: shell_scripts
changed_when: False
- name: Common | Creating shell script symlinks part1
ansible.builtin.file:
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: 0750
src: "{{ item.path }}"
dest: "{{ BIN_DIR }}/sway/{{ item.path | basename }}"
state: link
loop: "{{ shell_scripts.files }}"
- name: Common | Creating shell script symlinks part2
ansible.builtin.file:
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: 0750
src: "{{ item }}"
dest: "{{ BIN_DIR }}/sway/{{ item | basename }}"
state: link
with_items:
- "{{ GIT_REPO }}/bin/emoji"
- "{{ GIT_REPO }}/bin/steam"
- name: Common | Checking existence of bingwallaper script
ansible.builtin.stat:
path: "{{ BIN_DIR }}/sway/bingwallpaper"
register: bingwallpaper_script
- name: Common | Downloading bingwallaper script
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/whizzzkid/bing-wallpapers-for-linux/master/bingwallpaper
dest: "{{ BIN_DIR }}/sway/bingwallpaper"
mode: "0750"
when: not bingwallpaper_script.stat.exists
- name: Common | Templating custom bashrc...
ansible.builtin.template:
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: 0640
src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- { src: "{{ playbook_dir }}/config/bash/bashrc.j2", dest: "{{ BIN_DIR }}/bash/sway-de.sh" }
- { src: "{{ playbook_dir }}/config/bash/bashrc.j2", dest: "{{ BIN_DIR }}/zsh/sway-de.sh" }
- name: Common | Checking existence of alacritty.yml
ansible.builtin.stat:
path: "{{ ansible_user_dir }}/.config/alacritty/alacritty.yml"
register: alacritty_config
- name: Common | Templating alacritty config file...
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: 0640
with_items:
- { src: "{{ playbook_dir }}/config/alacritty/alacritty.yml.j2", dest: "{{ ansible_user_dir }}/.config/alacritty/alacritty.yml" }
when: not alacritty_config.stat.exists
- name: Common | Templating systemd user units...
ansible.builtin.template:
src: "{{ item }}"
dest: "{{ SYSTEMD_UDIR }}/{{ item | basename | regex_replace('.j2$', '') }}"
mode: 0640
with_fileglob:
- "{{ playbook_dir }}/config/systemd/user/*.j2"
register: systemd_user_units
- name: Common | Enabling systemd user units...
ansible.builtin.systemd:
name: "{{ item }}"
enabled: true
daemon_reload: true
scope: user
with_items:
- autotiling
- avizo-service
- inactive-windows-transparency
#- kanshi
- mako
- polkit-gnome
- ssh-agent
- swayidle
- udiskie
- waybar
- name: Common | Reloading systemd user units when changed...
ansible.builtin.systemd:
daemon_reload: true
scope: user
when: systemd_user_units.changed
- name: Common | Creating wal template symlinks...
ansible.builtin.file:
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: "{{ item.mode }}"
src: "{{ item.src }}"
dest: "{{ item.dest }}"
state: link
with_items:
- { src: "{{ GIT_REPO }}/config/wal/templates/colors-mako", dest: "{{ ansible_user_dir }}/.config/wal/templates/colors-mako", mode: "0640" }
- name: Common | Checking if created colors-mako exist
ansible.builtin.stat:
path: "{{ ansible_user_dir }}/.cache/wal/colors-mako"
register: mako_pywal_config
- name: Common | Creating default pywal config
ansible.builtin.command: wal --theme base16-dracula -o {{ BIN_DIR }}/sway/wal.sh
when: not mako_pywal_config.stat.exists
- name: Common | Creating config symlinks...
ansible.builtin.file:
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: "{{ item.mode }}"
src: "{{ item.src }}"
dest: "{{ item.dest }}"
state: link
with_items:
- { src: "{{ GIT_REPO }}/config/sway/sway.conf", dest: "{{ SWAY_DIR }}/config", mode: "0640" }
- { src: "{{ GIT_REPO }}/config/sway/sway.d", dest: "{{ SWAY_DIR }}/sway.d", mode: "0750" }
- { src: "{{ ansible_user_dir }}/.cache/wal/colors-mako", dest: "{{ ansible_user_dir }}/.config/mako/config", mode: "0640" }
- { src: "{{ GIT_REPO }}/config/waybar", dest: "{{ ansible_user_dir }}/.config/waybar", mode: "0750" }
- { src: "{{ GIT_REPO }}/config/kanshi/config.example", dest: "{{ ansible_user_dir }}/.config/kanshi/config.example", mode: "0640" }
- { src: "{{ GIT_REPO }}/config/swappy/config", dest: "{{ ansible_user_dir }}/.config/swappy/config", mode: "0640" }
- { src: "{{ GIT_REPO }}/config/lf/lfrc", dest: "{{ ansible_user_dir }}/.config/lf/lfrc", mode: "0640", }
- { src: "{{ GIT_REPO }}/config/zsh/.zshrc", dest: "{{ ansible_user_dir }}/.config/zsh/.zshrc", mode: "0640" }
- { src: "{{ GIT_REPO }}/config/xdg-desktpo-portal-wlr/config", dest: "{{ ansible_user_dir }}/.config/xdg-desktpo-portal-wlr/config", mode: "0640" }
- name: Common | Cloning Windows-10 themes and icons...
ansible.builtin.git:
repo: "{{ item.src }}"
dest: "{{ item.dest }}"
update: true
with_items:
- { src: "https://github.com/B00merang-Project/Windows-10.git", dest: "{{ ansible_user_dir }}/.local/share/themes/Windows-10" }
- { src: "https://github.com/B00merang-Artwork/Windows-10.git", dest: "{{ ansible_user_dir }}/.local/share/icons/Windows-10" }
diff: false
- name: Common | Extending user .bashrc...
ansible.builtin.blockinfile:
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: 0640
dest: "{{ ansible_user_dir }}/.bashrc"
block: |
for f in {{ BIN_DIR }}/bash/*.sh; do source $f; done
eval "$(starship init bash)"
marker: "
# {mark} Sway desktop environment config"
insertafter: EOF
create: true
- name: Common | Creating root directories...
ansible.builtin.file:
owner: root
group: root
mode: 0750
path: "{{ item }}"
state: directory
with_items:
- "{{ ROOT_BIN_DIR }}/bash"
become: true
- name: Common | Extending root .profile...
ansible.builtin.blockinfile:
dest: "/root/.profile"
block: |
for f in {{ ROOT_BIN_DIR }}/bash/*.sh; do source $f; done
eval "$(starship init bash)"
marker: "
# {mark} Sway desktop environment config"
insertafter: EOF
create: true
owner: root
group: root
mode: 0640
become: true
- name: Common | Templating root bashrc files...
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: root
group: root
mode: "{{ item.mode }}"
with_items:
- { src: "{{ playbook_dir }}/config/bash/bashrc.j2", dest: "{{ ROOT_BIN_DIR }}/bash/sway-de.sh", mode: "0600" }
- { src: "{{ playbook_dir }}/bin/sway", dest: "/usr/local/sbin/sway", mode: "0755" }
become: true
- name: Common | Configuring {{ ansible_user_dir }}/.config/gtk-3.0/settings.ini
community.general.files.ini_file:
path: "{{ ansible_user_dir }}/.config/gtk-3.0/settings.ini"
section: Settings
option: "{{ item.option }}"
value: "{{ item.value }}"
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
no_extra_spaces: true
mode: 0640
with_items:
- { option: "gtk-theme-name", value: "Windows-10" }
- { option: "gtk-icon-theme-name", value: "Windows-10" }
- name: Common | Configuring {{ ansible_user_dir }}/.config/gtk-2.0/gtkrc-2.0
community.general.files.ini_file:
path: "{{ ansible_user_dir }}/.config/gtk-2.0/gtkrc-2.0"
section: null
option: "{{ item.option }}"
value: "{{ item.value }}"
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
no_extra_spaces: true
mode: 0640
with_items:
- { option: "gtk-theme-name", value: '"Windows-10"' }
- { option: "gtk-icon-theme-name", value: '"Windows-10"' }
# {{ ansible_user_dir }}/.pam_environment is the most compatible way
# to set enviromment variables. --> Deprecated as of
# https://github.com/linux-pam/linux-pam/commit/ecd526743a27157c5210b0ce9867c43a2fa27784
- name: Common | Configuring {{ ansible_user_dir }}/.config/sway/env
ansible.builtin.blockinfile:
dest: "{{ ansible_user_dir }}/.config/sway/env"
block: |
# Reduces crashs for some gdk apps, like evolution
# ! Do not set as global variable. Electron Apps will not start !
# export GDK_BACKEND=wayland
# Required for tray icons on waybar
export XDG_CURRENT_DESKTOP=sway
# Enable QT apps to have gtk theme
export QT_QPA_PLATFORMTHEME=qt5ct
# Force wayland on qt apps
export QT_QPA_PLATFORM=wayland;xcb
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
# Explicitly set to '96' instead of 'physical' because some apps have problems
# Looking at you nextcloud client!
# https://github.com/nextcloud/desktop/issues/1079
# https://github.com/swaywm/sway/issues/2424
export QT_WAYLAND_FORCE_DPI=96
# Make Qt apps honour DPI settings.
export QT_AUTO_SCREEN_SCALE_FACTOR=1
# Mozilla Wayland support + hardware video decoding
export MOZ_ENABLE_WAYLAND=1
export MOZ_WAYLAND_USE_VAAPI=1
# SDL
export SDL_VIDEODRIVER=wayland
# Java under Xwayland
export _JAVA_AWT_WM_NONREPARENTING=1
# Bemenu
export BEMENU_BACKEND=wayland
# Session Type for later screensharing
export XDG_SESSION_TYPE=wayland
marker: "
# {mark} Sway desktop environment config"
insertafter: EOF
create: true
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: 0640
- name: Common | Configuring {{ ansible_user_dir }}/.config/environment.d/sway.conf
ansible.builtin.blockinfile:
dest: "{{ ansible_user_dir }}/.config/environment.d/sway.conf"
block: |
LESSHISTFILE=-
# Path to SSH_AUTH_SOCK
SSH_AUTH_SOCK=${HOME}/.ssh/ssh-agent.sock
# XDG Settings Basic
XDG_CONFIG_HOME=${HOME}/.config
XDG_DATA_HOME=${HOME}/.local/share
XDG_CACHE_HOME=${HOME}/.local/cache
XDG_STATE_HOME=${HOME}/.local/state
# XDG_CONFIG_HOME
AWS_SHARED_CREDENTIALS_FILE=${XDG_CONFIG_HOME}/aws/credentials
AWS_CONFIG_FILE=${XDG_CONFIG_HOME}/aws/config
DOCKER_CONFIG=${XDG_CONFIG_HOME}/docker/
GTK2_RC_FILES=${XDG_CONFIG_HOME}/gtk-2.0/gtkrc-2.0
KIMAI_CONFIG=${XDG_CONFIG_HOME}/kimai2/settings.ini
KUBECONFIG=${XDG_CONFIG_HOME}/kube/config
NOTMUCH_CONFIG=${XDG_CONFIG_HOME}/notmuch-config
WGETRC=${XDG_CONFIG_HOME}/wget/wgetrc
ZDOTDIR=${XDG_CONFIG_HOME}/zsh
# ${HOME}/.local/cache
ZSH_CACHE_DIR=${HOME}/.local/cache/zi
# ${HOME}/.local/share
ANSIBLE_HOME=${HOME}/.local/share/ansible
CARGO_HOME=${HOME}/.local/share/cargo
GNUPGHOME=${HOME}/.local/share/gnupg
GOPATH=${HOME}/.local/share/go
HISTFILE=${HOME}/.local/share/bash.history
WINEPREFIX=${HOME}/.local/share/wineprefixes/default
_ZL_DATA="${HOME}/.local/share/zlua"
# Include {{ BIN_DIR }}/sway and ${GOPATH}/bin in $PATH
PATH={{ BIN_DIR }}/sway:${GOPATH}/bin:${PATH}
marker: "
# {mark} Sway desktop environment config"
insertafter: EOF
create: true
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: 0640
- name: Common | Configuring {{ ansible_user_dir }}/.profile
ansible.builtin.blockinfile:
dest: "{{ ansible_user_dir }}/.profile"
block: |
eval $(sed -e '/^$/d' -e '/^\s*#/d' -e 's/^/export /' $HOME/.config/environment.d/*.conf)
marker: "
# {mark} Sway desktop environment config"
insertafter: EOF
create: true
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: 0640
- name: Common | Configuring {{ ansible_user_dir }}/.config/starship.toml
community.general.files.ini_file:
path: "{{ ansible_user_dir }}/.config/starship.toml"
section: "{{ item.section }}"
option: "{{ item.option }}"
value: "{{ item.value }}"
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: 0640
with_items:
- "{{ STARSHIP_OPTIONS }}"
- name: Common | Configuring /root/.config/starship.toml
community.general.files.ini_file:
path: "/root/.config/starship.toml"
section: "{{ item.section }}"
option: "{{ item.option }}"
value: "{{ item.value }}"
owner: root
group: root
mode: 0640
with_items:
- "{{ STARSHIP_OPTIONS }}"
become: true
- name: Creating custom sway.desktop entry to load correct environment variables
ansible.builtin.blockinfile:
dest: /usr/share/wayland-sessions/sway-custom.desktop
block: |
[Desktop Entry]
Name=Sway (Custom)
Comment=An i3-compatible Wayland compositor
Exec=/usr/local/sbin/sway
Type=Application
marker: "
# {mark} Sway desktop entry"
insertafter: EOF
create: true
owner: "root"
group: "root"
mode: 0644
become: true
- name: Common | Informational Output
ansible.builtin.debug:
msg: "{{ HOWTO.split('\n') }}"