Distinguish between device types

This commit is contained in:
Oliver Traber 2023-11-26 20:54:40 +01:00
parent c4357fa2e7
commit 944b24c7e4
Signed by: Bluemedia
GPG key ID: C0674B105057136C
5 changed files with 59 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,61 @@
- fonts-noto-color-emoji - fonts-noto-color-emoji
- name: Add flathub remote to flatpak - name: Add flathub remote to flatpak
become: yes
community.general.flatpak_remote: community.general.flatpak_remote:
name: flathub name: flathub
state: present state: present
flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
method: user method: user
- name: Install wezterm - name: Install flatpaks
become: yes
community.general.flatpak: community.general.flatpak:
name: org.wezfurlong.wezterm name: "{{ item }}"
state: present state: present
method: user 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: copy:
src: "{{ role_path }}/files/" src: "{{ item.src }}"
dest: "{{ ansible_env.HOME }}" dest: "{{ item.dest }}"
loop:
- src: "{{ role_path }}/files/.config"
dest: "{{ ansible_env.HOME }}/.config"
- 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) export GPG_TTY=$(tty)
# Autostart sway at login # Autostart sway at login
{% if isVm %}
export WLR_NO_HARDWARE_CURSORS=1
{% endif %}
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then exec sway; fi 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 exec waybar
# Autostart applications # Autostart applications
#exec waybar
exec --no-startup-id nextcloud --background exec --no-startup-id nextcloud --background
# Theme colors # Theme colors
@ -225,20 +224,20 @@ client.placeholder #c6c6c6 #1f1f1f #c6c6c6 #8abeb7 #8abeb7
client.background #1f1f1f client.background #1f1f1f
{% if isNotebook %}
# backlight control # backlight control
bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl -d intel_backlight set +5% bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl -d intel_backlight set +5%
bindsym XF86MonBrightnessDown 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 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 XF86AudioLowerVolume exec --no-startup-id amixer -c 0 -q set Master 2db- unmute
bindsym XF86AudioMute exec --no-startup-id amixer -q set Master toggle 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 XF86TouchpadOn exec --no-startup-id synclient Touchpadoff=0
bindsym XF86TouchpadOff exec --no-startup-id synclient Touchpadoff=1 bindsym XF86TouchpadOff exec --no-startup-id synclient Touchpadoff=1
{% endif %}
focus_follows_mouse no focus_follows_mouse no

View file

@ -30,11 +30,13 @@
"reverse-scrolling": true, "reverse-scrolling": true,
"on-click": "swaymsg exec amixer -q set Master toggle" "on-click": "swaymsg exec amixer -q set Master toggle"
}, },
{% if isNotebook %}
"battery": { "battery": {
"format": "{icon} {capacity}%", "format": "{icon} {capacity}%",
"format-charging": " {capacity}%", "format-charging": " {capacity}%",
"format-icons": ["", "", "", "", ""] "format-icons": ["", "", "", "", ""]
}, },
{% endif %}
"custom/power":{ "custom/power":{
"format":"  ", "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'" "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'"