add all sway related config in a single package
This commit is contained in:
parent
f28a48967f
commit
0cbc27ac76
17 changed files with 719 additions and 0 deletions
90
sway-all/waybar/config
Normal file
90
sway-all/waybar/config
Normal file
|
@ -0,0 +1,90 @@
|
|||
{
|
||||
"layer": "top", // Waybar at top layer
|
||||
"position": "bottom", // Waybar position (top|bottom|left|right)
|
||||
"height": 30,
|
||||
"modules-left": ["sway/workspaces", "sway/mode", "sway/window"],
|
||||
"modules-center": [],
|
||||
"modules-right": ["temperature", "network", "battery", "pulseaudio", "backlight", "cpu", "memory", "custom/layout", "clock", "tray"],
|
||||
// Module config
|
||||
"sway/mode": {
|
||||
"tooltip": true,
|
||||
"format": "<span weight=\"bold\">{}</span>"
|
||||
},
|
||||
"temperature": {
|
||||
"thermal-zone": 1,
|
||||
"hwmon-path": "/sys/class/hwmon/hwmon2/temp3_input",
|
||||
"critical-threshold": 80,
|
||||
"format-critical": "🌡 {temperatureC}°C",
|
||||
"format": " {temperatureC}°C"
|
||||
},
|
||||
"custom/vpn": {
|
||||
},
|
||||
"network": {
|
||||
"tooltip": false,
|
||||
"interface": "wlp3s0*",
|
||||
"format-wifi": " {essid} ({signalStrength}%)",
|
||||
"format-ethernet": "{ifname}: {ipaddr}/{cidr}",
|
||||
"format-linked": "{ifname} (No IP)",
|
||||
"format-alt": "{ifname}: {ipaddr}",
|
||||
"format-disconnected": "No internet"
|
||||
},
|
||||
"battery": {
|
||||
"tooltip": false,
|
||||
"states": {
|
||||
"good": 95,
|
||||
"warning": 30,
|
||||
"critical": 15
|
||||
},
|
||||
"format": "{icon} {capacity}%",
|
||||
"format-alt": "{time} {icon} {power}",
|
||||
"format-charging": " {capacity}%",
|
||||
"format-icons": ["🪫", "", "🔋"],
|
||||
"format-plugged": " {capacity}%"
|
||||
},
|
||||
"backlight": {
|
||||
"device": "amdgpu_bl0",
|
||||
"format": "{icon} {percent}%",
|
||||
"format-icons": ["", ""]
|
||||
},
|
||||
"pulseaudio": {
|
||||
"tooltip": true,
|
||||
"scroll-step": 1.0,
|
||||
"format": "{icon} {volume}%",
|
||||
"format-bluetooth": " {volume}%",
|
||||
"format-muted": "🔇",
|
||||
"format-source": "{volume}%",
|
||||
"format-source-muted": "🔇",
|
||||
"format-icons": {
|
||||
"headphones": "🎧",
|
||||
"handsfree": "🎧",
|
||||
"headset": "🎧",
|
||||
"phone": "",
|
||||
"portable": "",
|
||||
"car": "",
|
||||
"default": ["🔊"]
|
||||
},
|
||||
"on-click": "pavucontrol"
|
||||
},
|
||||
"cpu": {
|
||||
"interval": 5,
|
||||
"tooltip": false,
|
||||
"format": " {usage}%"
|
||||
},
|
||||
"memory": {
|
||||
"format": " {}%"
|
||||
},
|
||||
"custom/layout": {
|
||||
"exec": "~/.config/waybar/keyboard-layout.py",
|
||||
"return-type": "json",
|
||||
"format": "| <span color='#ef9f33'>{}</span>"
|
||||
},
|
||||
"clock": {
|
||||
"tooltip": false,
|
||||
"format": "| {:%d.%m.%Y %H:%M}"
|
||||
},
|
||||
"tray": {
|
||||
"tooltip": false,
|
||||
"icon-size": 18,
|
||||
"spacing": 5
|
||||
}
|
||||
}
|
82
sway-all/waybar/config.yaml
Normal file
82
sway-all/waybar/config.yaml
Normal file
|
@ -0,0 +1,82 @@
|
|||
---
|
||||
outputMode: active
|
||||
scale: 1
|
||||
background:
|
||||
red: 0.0
|
||||
green: 0.0
|
||||
blue: 0.0
|
||||
opacity: 0.8999999761581421
|
||||
widget:
|
||||
margin:
|
||||
margins:
|
||||
- 20
|
||||
- 20
|
||||
- 20
|
||||
- 20
|
||||
widget:
|
||||
verticalLayout:
|
||||
- horizontalLayout:
|
||||
- margin:
|
||||
margins:
|
||||
- 0
|
||||
- 88
|
||||
- 0
|
||||
- 32
|
||||
widget:
|
||||
verticalLayout:
|
||||
- date:
|
||||
font: ~
|
||||
font_size: 64.0
|
||||
- clock:
|
||||
font: ~
|
||||
font_size: 256.0
|
||||
- verticalLayout:
|
||||
- margin:
|
||||
margins:
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 8
|
||||
widget:
|
||||
battery:
|
||||
font: ~
|
||||
font_size: 24.0
|
||||
length: 0
|
||||
- margin:
|
||||
margins:
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 8
|
||||
widget:
|
||||
backlight:
|
||||
device: intel_backlight
|
||||
font: ~
|
||||
font_size: 24.0
|
||||
length: 0
|
||||
- margin:
|
||||
margins:
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 8
|
||||
widget:
|
||||
pulseAudio:
|
||||
font: ~
|
||||
font_size: 24.0
|
||||
length: 0
|
||||
- calendar:
|
||||
font_primary: ~
|
||||
font_secondary: ~
|
||||
font_size: 16.0
|
||||
sections: 3
|
||||
- launcher:
|
||||
font: ~
|
||||
font_size: 32.0
|
||||
length: 0
|
||||
app_opener: ""
|
||||
term_opener: ""
|
||||
url_opener: ""
|
||||
fonts:
|
||||
sans: sans
|
||||
mono: mono
|
36
sway-all/waybar/keyboard-layout.py
Executable file
36
sway-all/waybar/keyboard-layout.py
Executable file
|
@ -0,0 +1,36 @@
|
|||
#!/usr/bin/python
|
||||
import i3ipc
|
||||
import json
|
||||
|
||||
|
||||
long_to_short = {
|
||||
'English (US)': 'en',
|
||||
'Macedonian': 'mk',
|
||||
}
|
||||
|
||||
def print_status(keyboard):
|
||||
layout = keyboard.xkb_active_layout_name
|
||||
short_code = long_to_short.get(layout, layout)
|
||||
output = {"text": short_code, "tooltip": layout, "class": short_code}
|
||||
print(json.dumps(output), flush=True)
|
||||
|
||||
def find_keyboard(sway):
|
||||
# *the* keyboard is the one with more than one layout
|
||||
for input_dev in sway.get_inputs():
|
||||
if input_dev.type == 'keyboard' and len(input_dev.xkb_layout_names) > 1:
|
||||
return input_dev
|
||||
|
||||
def on_input(sway, event):
|
||||
if event.change == "xkb_layout" and \
|
||||
event.input.identifier == sway.keyboard.identifier:
|
||||
print_status(event.input)
|
||||
|
||||
def main():
|
||||
sway = i3ipc.Connection()
|
||||
sway.keyboard = find_keyboard(sway)
|
||||
print_status(sway.keyboard)
|
||||
|
||||
sway.on(i3ipc.Event.INPUT, on_input)
|
||||
sway.main()
|
||||
|
||||
main()
|
123
sway-all/waybar/style.css
Normal file
123
sway-all/waybar/style.css
Normal file
|
@ -0,0 +1,123 @@
|
|||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: Consolas, "Material Design Icons";
|
||||
font-size: 1em;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: rgba(11, 11, 11, 0.8);
|
||||
color: #ffffff;
|
||||
transition-property: background-color;
|
||||
transition-duration: .5s;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
#window {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
window {
|
||||
color: rgba(217, 216, 216, 1);
|
||||
background: rgba(35, 31, 32, 0.00);
|
||||
}
|
||||
|
||||
window#waybar.solo {
|
||||
color: rgba(217, 216, 216, 1);
|
||||
background: rgba(35, 31, 32, 0.85);
|
||||
}
|
||||
|
||||
/*
|
||||
window#waybar.empty {
|
||||
background-color: transparent;
|
||||
}
|
||||
window#waybar.solo {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
*/
|
||||
|
||||
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
background-color: transparent;
|
||||
border-bottom: 2px solid rgba(180, 14, 25, 0.5);
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
color: #ffffff;
|
||||
background-color: #333333;
|
||||
border-bottom: 2px solid #ff9600;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#clock,
|
||||
#custom-vpn,
|
||||
#battery,
|
||||
#cpu,
|
||||
#memory,
|
||||
#backlight,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#tray,
|
||||
#temperature,
|
||||
#mode,
|
||||
#idle_inhibitor {
|
||||
padding: 0 5px;
|
||||
margin: 0 4px;
|
||||
background-color: transparent;
|
||||
border-bottom: 2px solid #bdbd45;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#temperature {
|
||||
border-bottom: 2px solid #42a832;
|
||||
}
|
||||
#mode {
|
||||
background-color: #00ff96;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#pulseaudio,
|
||||
#clock,
|
||||
#tray,
|
||||
#cpu {
|
||||
border-bottom: transparent;
|
||||
}
|
||||
|
||||
#battery {
|
||||
border-bottom: 2px solid #bff874;
|
||||
}
|
||||
|
||||
#battery.charging {
|
||||
border-bottom: 2px solid #00ff96;
|
||||
}
|
||||
|
||||
#custom-vpn.down,
|
||||
#temperature.critical,
|
||||
#battery.critical:not(.charging) {
|
||||
border-bottom: 2px solid #dd2241;
|
||||
}
|
||||
|
||||
label:focus {
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
#network.disconnected {
|
||||
border-bottom: 2px solid #dd2241;
|
||||
}
|
||||
|
||||
#pulseaudio.bluetooth {
|
||||
border-bottom: 2px solid #1a8cff;
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
border-bottom: 2px solid #fff569;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue