Testing waybar stuff

This commit is contained in:
iFargle 2023-08-16 14:58:00 +09:00
parent 54ad83006b
commit 00872a37d1

View file

@ -1,216 +1,487 @@
{ hostname, ...}: { { hostname, ...}: {
home.file = { home.file = {
# https://yewtu.be/watch?v=tWQB1NDDA9c # https://yewtu.be/watch?v=tWQB1NDDA9c
# https://github.com/DN-debug/waybar-examples
# Waybar configuration # Waybar configuration
".config/waybar/config.jsonc" = { ".config/waybar/config.jsonc" = {
enable = true; enable = true;
executable = false; executable = false;
text = '' text = ''
{ {
"position": "top", "layer": "top",
# "modules-left": ["sway/workspaces"], "position": "bottom",
# "modules-center": ["custom/spotify"], "height": 35,
"modules-right": ["network", "custom/vpn", "pulseaudio", "battery", "clock"], "spacing": 4,
// Modules configuration "margin-top": 10,
"sway/workspaces": { "margin-bottom":5,
"disable-scroll": true,
"all-outputs": true, // Choose the order of the modules
"format": "{icon}",
"persistent_workspaces": { "modules-left":[ "idle_inhibitor", "pulseaudio", "cpu", "memory", "temperature"],
"1": [], "modules-center": [ "custom/launcher", "custom/media","wlr/taskbar", "custom/power"],
"2": [], "modules-right":["custom/layout", "custom/updater", "custom/snip", "backlight", "keyboard-state", "battery", "battery#bat2", "network", "tray", "clock"],
"3": [], // Modules configuration
"4": [],
"5": [], "keyboard-state": {
"6": [], "numlock": true,
"7": [], "capslock": true,
"8": [], "format": " {name} {icon}",
"9": [], "format-icons": {
"10": [] "locked": "",
}, "unlocked": ""
"format-icons": {
"default": "",
"urgent": "",
"focused": "",
}
},
"custom/vpn": {
"format": "{}",
"interval": 1,
"exec": "/home/loki/bin/waybar-vpn.sh"
},
"custom/spotify": {
"format": "<span foreground='#E5B4E2'> </span><span font='OperatorMonoSSm Nerd Font weight=325 Italic'>{}</span>",
"interval": 1,
"exec-if": "pgrep spotify",
"on-click": "playerctl -p spotify play-pause",
"on-scroll-up": "playerctl -p spotify previous",
"on-scroll-down": "playerctl -p spotify next",
"tooltip": false,
"escape": true,
"max-length": 60,
"exec": "/home/loki/bin/spotify.sh"
},
"clock": {
"format": "<span foreground='#C6AAE8'> </span>{:%a %d %H:%M}",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
},
"battery": {
"states": {
"warning": 30,
"critical": 15,
},
"format": "<span size='13000' foreground='#B1E3AD'>{icon}</span> {capacity}%",
"format-warning": "<span size='13000' foreground='#B1E3AD'>{icon}</span> {capacity}%",
"format-critical": "<span size='13000' foreground='#E38C8F'>{icon}</span> {capacity}%",
"format-charging": "<span size='13000' foreground='#B1E3AD'> </span>{capacity}%",
"format-plugged": "<span size='13000' foreground='#B1E3AD'> </span>{capacity}%",
"format-alt": "<span size='13000' foreground='#B1E3AD'>{icon}</span> {time}",
"format-full": "<span size='13000' foreground='#B1E3AD'> </span>{capacity}%",
"format-icons": ["", "", "", "", ""],
"tooltip-format": "{time}"
},
"network": {
"format-wifi": "<span size='13000' foreground='#F2CECF'> </span>{essid}",
"format-ethernet": "<span size='13000' foreground='#F2CECF'>󰤭</span> Disconnected",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "<span size='13000' foreground='#F2CECF'> </span>Disconnected",
"tooltip-format-wifi": "Signal Strenght: {signalStrength}%",
},
"pulseaudio": {
"on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle",
"format": "<span size='13000' foreground='#EBDDAA'>{icon}</span> {volume}%",
"format-muted": "<span size='14000' foreground='#EBDDAA'></span> Muted",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", ""]
},
},
} }
},
"wlr/taskbar": {
"format": "{icon}",
"icon-size": 20,
"icon-theme": "Star",
"tooltip-format": "{title}",
"on-click": "minimize",
"on-click-middle": "close",
"on-click-right": "activate"
},
"sway/language": {
"format": " {}",
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
"icon-size": 20,
"spacing": 10
},
"clock": {
// "timezone": "America/New_York",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"format": "{usage}% ",
"tooltip": false
},
"memory": {
"format": "{}% "
},
"temperature": {
// "thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C {icon}",
"format-icons": ["", "", ""]
},
"backlight": {
"format": "{percent}% {icon}",
"format-icons": ["", ""]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
"format-icons": ["", "", "", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "Connected ",
"tooltip-format": "{ifname} via {gwaddr} ",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "Disconnected ",
"format-alt": "{ifname}: {ipaddr}/{cidr}",
"on-click-right": "bash ~/.config/rofi/wifi_menu/rofi_wifi_menu"
},
"pulseaudio": {
"format": "{volume}% {icon}",
"format-bluetooth": "{volume}% {icon}",
"format-bluetooth-muted": "{icon} {format_source}",
"format-muted": "{format_source}",
"format-source": "",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pavucontrol"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 15,
"format-icons": {
"spotify": " ",
"default": " "
},
"escape": true,
"exec": "$HOME/.config/system_scripts/mediaplayer.py 2> /dev/null",
"on-click": "playerctl play-pause"
},
"custom/launcher":{
"format": " ",
"on-click": "rofi -show drun -theme ~/.config/rofi/wayfire/config.rasi",
"on-click-right": "killall rofi"
},
"custom/power":{
"format": " ",
"on-click": "nwg-bar",
"on-click-right": "killall nwg-bar"
},
"custom/layout":{
"format": "",
"on-click": "bash ~/.config/system_scripts/layout.sh"
},
"custom/updater":{
"format": " {} Updates",
"exec": "checkupdates | wc -l",
"exec-if": "[[ $(checkupdates | wc -l) != 0 ]]",
"interval": 15,
"on-click": "alacritty -e yay -Syu"
}
}
''; '';
}; };
# Waybar theming # Waybar theming
".config/waybar/style.css" = { ".config/waybar/style.css" = {
enable = true; enable = true;
executable = false; executable = false;
text = '' text = ''* {
* { border: none;
font-family: "JetBrainsMono Nerd Font"; border-radius: 0px;
font-size: 17px; /* `otf-font-awesome` is required to be installed for icons */
/* font-weight: bold; */ font-family: Roboto, Helvetica, Arial, sans-serif;
border-radius: 0px; font-size: 13px;
} min-height: 0;
}
window#waybar { window#waybar {
background-color: #45403d; background-color: transparent;
border-radius: 10px; color: black;
} transition-property: background-color;
transition-duration: .5s;
}
.modules-right { window#waybar.hidden {
font-size: 10px; opacity: 0.2;
margin-right: 0.5rem; }
}
.modules-left {
margin-left: 0.5rem;
}
tooltip {
background: #45403d;
border-radius: 10px;
}
tooltip label {
color: #ebdbb2;
background-color: #45403d;
border-radius: 10px;
}
tooltip * {
border-radius: 10px;
}
#workspaces button {
margin: 0;
color: #d4be98;
font-weight: bolder;
font-style: normal;
margin: 0.2rem 0.1rem;
border-radius: 20px;
}
button:hover {
box-shadow: inherit;
text-shadow: inherit;
background: inherit;
}
#workspaces button.active {
color: #ebdbb2;
background-color: #7daea3;
text-shadow: 0 0 5px rgba(0, 0, 0, 0.818);
transition: all 0.1s ease-in-out;
}
#clock,
#custom-weather {
font-family: "GE Inspira";
font-weight: bolder;
text-shadow: 0 0 5px rgb(0, 0, 0);
color: #d4be98;
}
#clock { #workspaces button {
padding: 0 0 0 1.5em; background: #1f1f1f;
} color: black;
#custom-weather { border-radius: 20px;
padding: 0 1.5em 0 0.5em;
}
#memory {
color: #a9b665;
padding: 0 0.3em;
}
#pulseaudio { }
margin: 0;
padding: 0 0.5em 0 0.4em;
color: #d8a657;
}
#backlight { /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
margin: 0; #workspaces button:hover {
padding: 0 0.5em 0 0.4em; background: lightblue;
color: #d8a657; color: black;
} border-bottom: 3px solid black;
#cpu {
margin: 0;
padding: 0 0.1em 0 0.1em;
color: #a9b665;
}
#network {
margin: 0;
padding: 0 0.4em 0 0.5em;
color: #d8a657;
}
#custom-cycle_wall {
margin: 0;
padding: 0 0.5em;
color: #d3869b;
}
#language { }
margin: 0;
padding: 0 0.1em; #workspaces button.focused {
color: #d3869b; background: #1f1f1f;
} }
#tray {
margin: 0; #workspaces button.focused:hover {
padding: 0 0.2em; background: lightblue;
color: #d3869b; color: black;
} border-bottom: 3px solid black;
#battery {
margin: 0; }
padding: 0 0.5em 0 0.4em;
color: #a9b665; #workspaces button.urgent {
} background-color: #eb4d4b;
}
#mode {
background-color: #64727D;
border-bottom: 3px solid black;
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#custom-media,
#custom-launcher,
#custom-power,
#custom-layout,
#custom-updater,
#custom-snip,
#taskbar,
#tray,
#mode,
#idle_inhibitor,
#mpd {
padding: 0 10px;
color: black;
}
#window,
#workspaces {
margin: 0px 4px;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
margin-left: 0px;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
margin-right: 0px;
}
#clock {
background-color: #FA8BFF;
background-image: linear-gradient(-45deg, #FA8BFF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
border-radius: 0px 20px 20px 0px;
margin-right: 4px;
}
#battery {
background-color: black;
color: #000000;
}
#battery.charging, #battery.plugged {
color: black;
background-color: #26A65B;
}
@keyframes blink {
to {
background-color: black;
color: #000000;
}
}
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: black;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
background-color: #000000;
}
#cpu {
background-color: #FA8BFF;
background-image: linear-gradient(45deg, #2BD2FF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
}
#memory {
background-color: #FA8BFF;
background-image: linear-gradient(45deg, #2BD2FF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
}
#disk {
background-color: #FA8BFF;
background-image: linear-gradient(45deg, #2BD2FF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
}
#backlight {
background-color: #90b1b1;
}
#network {
background-color: #FA8BFF;
background-image: linear-gradient(45deg, #2BD2FF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
}
#network.disconnected {
background-color: #FA8BFF;
background-image: linear-gradient(45deg, #2BD2FF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: red;
}
#pulseaudio {
background-color: #FA8BFF;
background-image: linear-gradient(45deg, #2BD2FF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
}
#pulseaudio.muted {
background-color: #FA8BFF;
background-image: linear-gradient(45deg, #2BD2FF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: red;
}
#custom-media {
background-color: #8EC5FC;
background-image: linear-gradient(62deg, #8EC5FC 0%, #E0C3FC 100%);
color: black;
border-radius: 20px;
margin-right: 5px;
margin-left: 5px;
}
#custom-media.custom-spotify {
background-color: #8EC5FC;
background-image: linear-gradient(62deg, #8EC5FC 0%, #E0C3FC 100%);
color: black;
border-radius: 20px;
margin-right: 5px;
}
#custom-media.custom-vlc {
background-color: #8EC5FC;
background-image: linear-gradient(62deg, #8EC5FC 0%, #E0C3FC 100%);
color: black;
border-radius: 20px;
margin-right: 5px;
}
#custom-power{
background-color: #FA8BFF;
background-image: linear-gradient(45deg, #FA8BFF 0%, #2BD2FF 52%, #2BD2FF 90%);
font-size: 18px;
border-radius: 20px;
margin-left: 2px;
}
#custom-launcher{
background-color: #FA8BFF;
background-image: linear-gradient(-45deg, #FA8BFF 0%, #2BD2FF 52%, #2BD2FF 90%);
font-size: 25px;
border-radius: 20px;
margin-right: 2px;
}
#custom-updater {
background-color: #FA8BFF;
background-image: linear-gradient(45deg, #2BD2FF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
}
#custom-snip {
background-color: #FA8BFF;
background-image: linear-gradient(45deg, #2BD2FF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
font-size: 20px;
}
#custom-layout{
background-color: #FA8BFF;
background-image: linear-gradient(45deg, #FA8BFF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
font-size: 18px;
border-radius: 20px 0px 0px 20px;
}
#taskbar {
background-color: #2BD2FF;
background-image: linear-gradient(45deg, #FA8BFF 0%, #2BD2FF 52%, #FA8BFF 90%);
border-radius: 20px;
}
#temperature {
background-color: #FA8BFF;
background-image: linear-gradient(-45deg, #FA8BFF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
border-radius: 0px 20px 20px 0px;
}
#temperature.critical {
background-color: #eb4d4b;
}
#tray {
background-color: #FA8BFF;
background-image: linear-gradient(-45deg, #2BD2FF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
}
#tray > .passive {
-gtk-icon-effect: dim;
background-color: #FA8BFF;
background-image: linear-gradient(-45deg, #FA8BFF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
background-color: #FA8BFF;
background-image: linear-gradient(-45deg, #FA8BFF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
}
#idle_inhibitor {
background-color: #FA8BFF;
background-image: linear-gradient(45deg, #FA8BFF 0%, #2BD2FF 52%, #2BD2FF 90%);
border-radius: 20px 0px 0px 20px;
}
#idle_inhibitor.activated {
background-color: #FA8BFF;
background-image: linear-gradient(45deg, #FA8BFF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
border-radius: 20px 0px 0px 20px;
}
#language {
background-color: #FA8BFF;
background-image: linear-gradient(45deg, #FA8BFF 0%, #2BD2FF 52%, #2BD2FF 90%);
color: black;
min-width: 16px;
padding-left : 8px;
border-radius: 20px 0px 0px 20px;
}
#keyboard-state {
background: #97e1ad;
color: #000000;
min-width: 16px;
}
#keyboard-state > label {
padding: 0px 5px;
}
#keyboard-state > label.locked {
background: rgba(0, 0, 0, 0.2);
}
''; '';
}; };
}; };