add waybar

This commit is contained in:
Joel Beckmeyer 2023-07-21 21:51:30 -04:00
parent 28682f4a98
commit c9c615a2db
3 changed files with 209 additions and 0 deletions

102
dot_config/waybar/config Normal file
View File

@ -0,0 +1,102 @@
{
"layer": "top",
"position": "top",
"height": 24,
"modules-left": ["sway/workspaces", "custom/music"],
"modules-center": ["sway/window", "sway/mode"],
"modules-right": ["idle_inhibitor", "pulseaudio", "network", "cpu", "temperature#cpu", "temperature#gpu", "memory", "tray", "clock"],
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": false,
"format": "{name}",
"format-icons": {
"1:web": "www",
"2:code": "",
"3:term": "",
"4:work": "",
"5:music": "",
"6:docs": "",
"urgent": "",
"focused": "",
"default": ""
}
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"tray": {
"icon-size": 14,
"spacing": 10
},
"clock": {
// 24hr Robot Friendly
"format": "{:%Y-%m-%d - %H:%M}",
// Human Friendly
"format-alt": "{:%A, %B %d at %I:%M %p}"
},
"cpu": {
"format": "{usage}% "
},
"temperature#cpu": {
"hwmon-path": "/sys/class/hwmon/hwmon1/temp2_input",
"critical-threshold": 70,
"format": "C: {temperatureC}°C ",
"format-alt": "C: {temperatureF}°F "
},
"temperature#gpu": {
"hwmon-path": "/sys/class/hwmon/hwmon0/temp1_input",
"critical-threshold": 70,
"format": "G: {temperatureC}°C ",
"format-alt": "G: {temperatureF}°F "
},
"memory": {
"interval": 30,
"format": "{used:0.1f}/{total:0.1f}G "
},
"network": {
// "interface": "wlp2s0", // (Optional) To force the use of this interface
"format-wifi": "{signalStrength}% ",
"format-ethernet": "{ipaddr} ",
"tooltip-format-wifi": "{essid} ({signalStrength}%)",
"tooltip-format-ethernet": "{ifname}: {ipaddr}/{cidr} ",
"format-disconnected": ""
},
"pulseaudio": {
//"scroll-step": 1,
"format": "{volume}% {icon}",
"format-bluetooth": "{volume}% {icon}",
"format-muted": "",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", ""]
},
"on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle",
"on-click-right": "pavucontrol"
},
"custom/music": {
"format": " {}",
"max-length": 60,
"interval": 5, // Remove this if your script is endless and write in loop
"exec": "$HOME/.config/waybar/mediaplayer.sh 2> /dev/null", // Script in resources folder
"tooltip": false,
"on-click": "playerctl play-pause",
"on-scroll-up": "playerctl previous",
"on-scroll-down": "playerctl next"
}
}

View File

@ -0,0 +1,19 @@
#!/bin/sh
player_status=$(playerctl status 2> /dev/null)
title=$(playerctl metadata title)
if artist=$(playerctl metadata artist); then
song_info="${title} By ${artist}"
else
song_info="${title}"
fi
if [ "$player_status" = "Playing" ]; then
output="${song_info}"
elif [ "$player_status" = "Paused" ] ; then
output="⏸️ ${song_info}"
fi
echo $output

View File

@ -0,0 +1,88 @@
* {
border: none;
border-radius: 0;
font-family: 'Ubuntu', 'Font Awesome 5 Free';
font-size: 13px;
min-height: 0;
color: #ebdbb2;
}
window#waybar {
border-bottom: 2px solid #689d6a;
background: #1d2021;
}
#workspaces button {
}
#workspaces button.focused {
background: #689d6a;
color: #1d2021;
}
#mode {
background-color: #cc241d;
color: white;
}
#clock, #cpu, #temperature, #memory, #network, #pulseaudio, #backlight, #tray, #mode, #idle_inhibitor, #network {
padding: 0 4px;
margin: 0 10px;
}
#idle_inhibitor {
padding: 0 10px;
}
#idle_inhibitor.activated {
background-color: #689d6a;
color: #1d2021;
}
#custom-music {
color: #b8bb26;
margin: 0 15px;
padding: 0 20px;
border-bottom: 2px solid #b8bb26;
}
#clock {
margin: 0;
color: #fabd2f;
border-bottom: 2px solid #fabd2f;
}
#cpu {
}
#memory {
}
#network.disconnected {
background-color: #cc241d;
color: #1d2021;
border-bottom: 2px solid #cc241d;
}
#pulseaudio {
}
#pulseaudio.muted {
padding: 0 20px;
color: #cc241d;
border-bottom: 2px solid #cc241d;
}
#temperature.critical{
padding: 0 4px;
margin: 0 10px;
color: #cc241d;
border-bottom: 2px solid #cc241d;
}
#tray {
}