Distinguish between device types

This commit is contained in:
Oliver Traber 2023-11-26 20:54:40 +01:00
parent c4357fa2e7
commit 600110e625
Signed by: Bluemedia
GPG key ID: C0674B105057136C
5 changed files with 68 additions and 12 deletions

3
group_vars/all.yml Normal file
View file

@ -0,0 +1,3 @@
isNotebook: true
isDesktop: false
isVm: false

View file

@ -20,21 +20,70 @@
- fonts-noto-color-emoji
- name: Add flathub remote to flatpak
become: yes
community.general.flatpak_remote:
name: flathub
state: present
flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
method: user
- name: Install wezterm
become: yes
- name: Install flatpaks
community.general.flatpak:
name: org.wezfurlong.wezterm
name: "{{ item }}"
state: present
method: user
loop:
- org.wezfurlong.wezterm
- name: Copy config files
- name: Create group for sudoers config
become: yes
group:
name: admins
state: present
- name: Add user to group for sudoers config
become: yes
user:
append: true
name: "{{ ansible_user_id }}"
groups:
- admins
- name: Create sudoers config
become: yes
community.general.sudoers:
name: desktop-environment
group: admins
nopassword: true
commands:
- "/usr/bin/systemctl poweroff"
- "/usr/bin/systemctl reboot"
- "/usr/bin/systemctl suspend"
- name: Copy static config files
copy:
src: "{{ role_path }}/files/"
dest: "{{ ansible_env.HOME }}"
src: "{{ item.src }}"
dest: "{{ item.dest }}"
loop:
- src: "{{ role_path }}/files/.config"
dest: "{{ ansible_env.HOME }}/"
- name: Ensure presence of required directories
file:
path: "{{ item }}"
recurse: yes
state: directory
loop:
- "{{ ansible_env.HOME }}/.config/sway"
- "{{ ansible_env.HOME }}/.config/waybar"
- name: Render config files
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
loop:
- src: "bash_profile.j2"
dest: "{{ ansible_env.HOME }}/.bash_profile"
- src: "sway-config.j2"
dest: "{{ ansible_env.HOME }}/.config/sway/config"
- src: "waybar-config.j2"
dest: "{{ ansible_env.HOME }}/.config/waybar/config"

View file

@ -14,4 +14,7 @@ fi
export GPG_TTY=$(tty)
# Autostart sway at login
{% if isVm == true %}
export WLR_NO_HARDWARE_CURSORS=1
{% endif %}
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then exec sway; fi

View file

@ -213,7 +213,6 @@ exec hash dbus-update-activation-environment 2>/dev/null && \
exec waybar
# Autostart applications
#exec waybar
exec --no-startup-id nextcloud --background
# Theme colors
@ -225,20 +224,20 @@ client.placeholder #c6c6c6 #1f1f1f #c6c6c6 #8abeb7 #8abeb7
client.background #1f1f1f
{% if isNotebook == true %}
# backlight control
bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl -d intel_backlight set +5%
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl -d intel_backlight set 5%-
# set power-manager and volume control
# set volume control
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -c 0 -q set Master 2dB+ unmute
bindsym XF86AudioLowerVolume exec --no-startup-id amixer -c 0 -q set Master 2db- unmute
bindsym XF86AudioMute exec --no-startup-id amixer -q set Master toggle
# touchpad on and off controller on laptop with Fn+<touchpad control functional key>
# touchpad on and off controller on laptops with Fn keys
bindsym XF86TouchpadOn exec --no-startup-id synclient Touchpadoff=0
bindsym XF86TouchpadOff exec --no-startup-id synclient Touchpadoff=1
{% endif %}
focus_follows_mouse no

View file

@ -30,11 +30,13 @@
"reverse-scrolling": true,
"on-click": "swaymsg exec amixer -q set Master toggle"
},
{% if isNotebook == true %}
"battery": {
"format": "{icon} {capacity}%",
"format-charging": " {capacity}%",
"format-icons": ["", "", "", "", ""]
},
{% endif %}
"custom/power":{
"format":"  ",
"on-click":"swaynag -t warning -m 'Power Menu Options' -b 'Logout' 'swaymsg exit' -b 'Suspend' 'swaymsg exec sudo systemctl suspend' -b 'Reboot' 'swaymsg exec sudo systemctl reboot' -b 'Shutdown' 'swaymsg exec sudo systemctl poweroff'"