feat: create "desktop" role, configure waybar
This commit is contained in:
parent
b0ebe9af3c
commit
d13b4f1e28
12 changed files with 158 additions and 12 deletions
|
@ -26,7 +26,7 @@ localhost ansible_connection=local
|
|||
3. Run a playbook.
|
||||
|
||||
```bash
|
||||
ansible-playbook -i inventory.ini [--ask-become] playbooks/ping.yml
|
||||
ansible-playbook -i inventory.ini [--ask-become] ping.yml
|
||||
```
|
||||
|
||||
## Purpose
|
||||
|
|
4
desktop.yml
Normal file
4
desktop.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- name: Desktop environment
|
||||
hosts: odhosts
|
||||
roles:
|
||||
- desktop
|
|
@ -1,11 +0,0 @@
|
|||
- name: Desktop environment
|
||||
hosts: odhosts
|
||||
tasks:
|
||||
- name: Install KDE
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
- kde-plasma-desktop
|
||||
- kate
|
||||
- okular
|
||||
- dolphin
|
43
roles/desktop/files/waybar.css
Normal file
43
roles/desktop/files/waybar.css
Normal file
|
@ -0,0 +1,43 @@
|
|||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: JetBrains Mono;
|
||||
font-size: 13px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: rgba(43, 48, 59, 0.5);
|
||||
color: white;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
background: rgba(43, 48, 59, 0.5);
|
||||
border: 1px solid rgba(100, 114, 125, 0.5);
|
||||
}
|
||||
|
||||
tooltip label {
|
||||
color: white;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
background: transparent;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#workspaces button.focused,
|
||||
#mode {
|
||||
background: #64727D;
|
||||
}
|
||||
|
||||
#workspaces button,
|
||||
#mode,
|
||||
#clock,
|
||||
#battery,
|
||||
#pulseaudio,
|
||||
#network,
|
||||
#backlight,
|
||||
#language {
|
||||
padding: 0 12px;
|
||||
}
|
83
roles/desktop/files/waybar.jsonc
Normal file
83
roles/desktop/files/waybar.jsonc
Normal file
|
@ -0,0 +1,83 @@
|
|||
{
|
||||
"height": 30, // Waybar height (to be removed for auto height)
|
||||
"spacing": 0, // Gaps between modules (px)
|
||||
"modules-left": [
|
||||
"sway/workspaces",
|
||||
"sway/mode",
|
||||
"sway/scratchpad",
|
||||
],
|
||||
"modules-center": [
|
||||
"sway/window"
|
||||
],
|
||||
"modules-right": [
|
||||
"pulseaudio",
|
||||
"network",
|
||||
"backlight",
|
||||
"sway/language",
|
||||
"battery",
|
||||
"clock",
|
||||
"tray"
|
||||
],
|
||||
"sway/workspaces": {
|
||||
"disable-scroll": true,
|
||||
"all-outputs": true,
|
||||
"warp-on-scroll": false,
|
||||
"format": "{name}"
|
||||
},
|
||||
"sway/scratchpad": {
|
||||
"format": "{icon} {count}",
|
||||
"show-empty": false,
|
||||
"format-icons": ["", ""],
|
||||
"tooltip": true,
|
||||
"tooltip-format": "{app}: {title}"
|
||||
},
|
||||
"tray": {
|
||||
"spacing": 12
|
||||
},
|
||||
"clock": {
|
||||
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
|
||||
"format-alt": "{:%Y-%m-%d}"
|
||||
},
|
||||
"backlight": {
|
||||
"format": "{percent}% {icon}",
|
||||
"format-icons": ["", ""]
|
||||
},
|
||||
"battery": {
|
||||
"states": {
|
||||
"warning": 30,
|
||||
"critical": 15
|
||||
},
|
||||
"format": "{capacity}% {icon}",
|
||||
"format-full": "{capacity}% {icon}",
|
||||
"format-charging": "{capacity}% ",
|
||||
"format-plugged": "{capacity}% ",
|
||||
"format-alt": "{time} {icon}",
|
||||
"format-icons": ["", "", "", "", ""]
|
||||
},
|
||||
"network": {
|
||||
"format-wifi": "{essid} ({signalStrength}%) ",
|
||||
"format-ethernet": "{ipaddr}/{cidr} ",
|
||||
"tooltip-format": "{ifname} via {gwaddr} ",
|
||||
"format-linked": "{ifname} (No IP) ",
|
||||
"format-disconnected": "Disconnected ⚠",
|
||||
"format-alt": "{ifname}: {ipaddr}/{cidr}"
|
||||
},
|
||||
"pulseaudio": {
|
||||
"format": "{volume}% {icon} {format_source}",
|
||||
"format-bluetooth": "{volume}% {icon} {format_source}",
|
||||
"format-bluetooth-muted": " {icon} {format_source}",
|
||||
"format-muted": " {format_source}",
|
||||
"format-source": "{volume}% ",
|
||||
"format-source-muted": "",
|
||||
"format-icons": {
|
||||
"headphone": "",
|
||||
"hands-free": "",
|
||||
"headset": "",
|
||||
"phone": "",
|
||||
"portable": "",
|
||||
"car": "",
|
||||
"default": ["", "", ""]
|
||||
},
|
||||
"on-click": "pavucontrol"
|
||||
},
|
||||
}
|
2
roles/desktop/handlers/main.yml
Normal file
2
roles/desktop/handlers/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
- name: Restart waybar
|
||||
shell: "killall waybar && waybar &"
|
2
roles/desktop/tasks/main.yml
Normal file
2
roles/desktop/tasks/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
- name: Waybar
|
||||
import_tasks: waybar.yml
|
23
roles/desktop/tasks/waybar.yml
Normal file
23
roles/desktop/tasks/waybar.yml
Normal file
|
@ -0,0 +1,23 @@
|
|||
- name: Install waybar
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
- waybar
|
||||
- psmisc # killall command
|
||||
- name: Create waybar config dir
|
||||
ansible.builtin.file:
|
||||
path: /home/lumin/.config/waybar
|
||||
state: directory
|
||||
mode: '1770'
|
||||
- name: Copy waybar config
|
||||
notify: Restart waybar
|
||||
ansible.builtin.copy:
|
||||
src: files/waybar.jsonc
|
||||
dest: /home/lumin/.config/waybar/config.jsonc
|
||||
mode: '0660'
|
||||
- name: Copy waybar styles
|
||||
notify: Restart waybar
|
||||
ansible.builtin.copy:
|
||||
src: files/waybar.css
|
||||
dest: /home/lumin/.config/waybar/style.css
|
||||
mode: '0660'
|
Loading…
Reference in a new issue