feat: create "desktop" role, configure waybar

This commit is contained in:
Ivan R. 2024-04-11 22:58:56 +05:00
parent b0ebe9af3c
commit d13b4f1e28
Signed by: lumin
GPG key ID: E0937DC7CD6D3817
12 changed files with 158 additions and 12 deletions

View file

@ -26,7 +26,7 @@ localhost ansible_connection=local
3. Run a playbook. 3. Run a playbook.
```bash ```bash
ansible-playbook -i inventory.ini [--ask-become] playbooks/ping.yml ansible-playbook -i inventory.ini [--ask-become] ping.yml
``` ```
## Purpose ## Purpose

4
desktop.yml Normal file
View file

@ -0,0 +1,4 @@
- name: Desktop environment
hosts: odhosts
roles:
- desktop

View file

@ -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

View 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;
}

View 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"
},
}

View file

@ -0,0 +1,2 @@
- name: Restart waybar
shell: "killall waybar && waybar &"

View file

@ -0,0 +1,2 @@
- name: Waybar
import_tasks: waybar.yml

View 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'