1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_i3wm.git synced 2024-08-16 10:09:53 +02:00

Create better waybar config

This commit is contained in:
L3D 2024-07-18 20:48:07 +02:00
parent 8c11848097
commit f93380d872
Signed by: l3d
GPG key ID: CD08445BFF4313D1
4 changed files with 46 additions and 16 deletions

View file

@ -4,7 +4,7 @@ sway__user_list:
- user: "{{ ansible_user_id }}" - user: "{{ ansible_user_id }}"
home: "{{ ansible_env.HOME | default('/home/{{ ansible_user_id }}') }}" home: "{{ ansible_env.HOME | default('/home/{{ ansible_user_id }}') }}"
sway__dynamic_names: true sway__dynamic_names: false
# sway behavior and favorites # sway behavior and favorites
sway__logo_key: 'Mod4' sway__logo_key: 'Mod4'
@ -17,6 +17,7 @@ sway__term_pkgs:
sway__keyboard_settings: true sway__keyboard_settings: true
sway__keyboard_lang: 'de' sway__keyboard_lang: 'de'
sway__lock: 'swaylock --color 000000 --image /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png' sway__lock: 'swaylock --color 000000 --image /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png'
sway__waybar: true
# version check for this role? # version check for this role?
submodules_versioncheck: true submodules_versioncheck: true

View file

@ -14,3 +14,12 @@
mode: "u=rwX,g=rX" mode: "u=rwX,g=rX"
owner: "{{ swayusr.user }}" owner: "{{ swayusr.user }}"
group: "{{ swayusr.user }}" group: "{{ swayusr.user }}"
- name: Deploy sway-dynamic-names config
become: true
ansible.builtin.template:
src: "templates/sdn-config.yaml.j2"
dest: '{{ swayusr.home }}/.config/sway/sdn-config.yaml'
mode: '0640'
owner: "{{ swayusr.user }}"
group: "{{ swayusr.user }}"

View file

@ -41,10 +41,10 @@ output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
# #
# Example configuration: # Example configuration:
# #
# exec swayidle -w \ exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \ timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
# before-sleep 'swaylock -f -c 000000' before-sleep 'swaylock -f -c 000000'
# #
# This will lock your screen after 300 seconds of inactivity, then turn off # This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when # your displays after another 300 seconds, and turn your screens back on when
@ -132,6 +132,7 @@ input type:keyboard {
# #
# Switch to workspace # Switch to workspace
bindsym $mod+0 workspace number 0
bindsym $mod+1 workspace number 1 bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2 bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3 bindsym $mod+3 workspace number 3
@ -141,8 +142,8 @@ input type:keyboard {
bindsym $mod+7 workspace number 7 bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8 bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9 bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Move focused container to workspace # Move focused container to workspace
bindsym $mod+Shift+0 move container to workspace number 0
bindsym $mod+Shift+1 move container to workspace number 1 bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2 bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3 bindsym $mod+Shift+3 move container to workspace number 3
@ -152,16 +153,15 @@ input type:keyboard {
bindsym $mod+Shift+7 move container to workspace number 7 bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8 bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9 bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# Note: workspaces can have any name you want, not just numbers. # Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default. # We just use 0-9 as the default.
# dynamic workspaces # dynamic workspaces
# https://pypi.org/project/sway-dynamic-names/ # https://pypi.org/project/sway-dynamic-names/
{% if sway__dynamic_names %} {% if sway__dynamic_names %}
exec_always --no-startup-id exec {{ swayusr.home }}/.config/sway/venv/bin/sway-dynamic-names exec_always --no-startup-id exec {{ swayusr.home }}/.config/sway/venv/bin/sway-dynamic-names
{% else %} {% else %}
exec_always --no-startup-id exec {{ swayusr.home }}/.config/sway/venv/bin/sway-dynamic-names # exec_always --no-startup-id exec {{ swayusr.home }}/.config/sway/venv/bin/sway-dynamic-names
{% endif %} {% endif %}
# #
# Layout stuff: # Layout stuff:
@ -228,20 +228,23 @@ bindsym $mod+r mode "resize"
# #
# Status Bar: # Status Bar:
# #
{% if sway__waybar | bool %}
exec waybar
{% else %}
# Read `man 5 sway-bar` for more information about this section. # Read `man 5 sway-bar` for more information about this section.
bar { bar {
position top position top
# When the status_command prints a new line to stdout, swaybar updates. # When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time. # The default just shows the current date and time.
# status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done
status_command waybar
# colors { colors {
# statusline #ffffff statusline #ffffff
# background #323232 background #323232
# inactive_workspace #32323200 #32323200 #5c5c5c inactive_workspace #32323200 #32323200 #5c5c5c
# } }
} }
{% endif %}
include /etc/sway/config.d/* include /etc/sway/config.d/*

View file

@ -0,0 +1,17 @@
---
{{ ansible_managed | comment }}
clients:
chromium: chrome
{{ sway__term }}: terminal
firefox: firefox
x-terminal-emulator: terminal
thunderbird: envelope
nautilus: folder-open
clementine: music
vlc: play
signal: comment
gedit: code
deliminator: " "
default_icon: dot-circle
default:
new_desktop: true