Update .config/waybar/config

Update .config/waybar/scripts/keyhint.sh
Update .config/waybar/style.css
This commit is contained in:
Kasper Juul Hermansen 2024-12-18 22:31:39 +01:00
parent 27e934e4c5
commit 93a9e246ff
3 changed files with 305 additions and 251 deletions

View File

@ -1,219 +1,186 @@
// Global
{ {
"layer": "top", "layer": "top", // Waybar at top layer
"position": "top", "position": "top", // Waybar position (top|bottom|left|right)
// "height": 30, // Auto-height is used when commented
// "width": 1280, // Full screen width when commented
"spacing": 16, // Gaps between modules (in px)
// See `man waybar` for more configuration options
// If height property would be not present, it'd be calculated dynamically // Configuration - modules-left
"height": 30,
"modules-left": [ "modules-left": [
"custom/launcher", "custom/launcher",
"sway/workspaces", "sway/workspaces",
"sway/mode", "sway/mode",
"sway/window"
], ],
"modules-center": [ "custom/launcher": {
], "format":"<span size='x-large'></span>",
"on-click": "exec nwg-drawer",
"tooltip": false
},
"modules-right": [ "sway/workspaces": {
"network", "disable-scroll": true,
"idle_inhibitor", "all-outputs": true,
"memory", "format": "{icon}",
"cpu", "format-icons": {
"pulseaudio", "3": "3",
"custom/keyboard-layout", "4": "4",
"battery", "5": "5",
//"custom/PBPbattery", "6": "6",
"backlight#icon", "7": "7",
"backlight#value", "8": "8",
"clock", "9": "9",
"tray", "10": "10"
//"custom/weather",
"custom/power",
],
// Modules
"idle_inhibitor": {
"format": "{icon} ",
"format-icons":{
"activated": "",
"deactivated": ""
} }
}, },
"battery": { "sway/mode": {
"states": { "format": "<span style=\"italic\">{}</span>",
// "good": 95, "tooltip": false
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
}, },
"custom/PBPbattery": { "sway/window": {
"exec": "~/.config/waybar/scripts/PBPbattery.sh",
"format": "{}", "format": "{}",
//"all-outputs": true, // Active window shows only on active display when commented
"max-length": 120
}, },
"clock": { // Configuration - modules-center
"interval": 10,
"format-alt": " {:%e %b %Y}", // Icon: calendar-alt "modules-center": [
"format": "{:%H:%M}", "network"
"tooltip-format": "{:%e %B %Y}" ],
"network": {
"format-disabled": " Disabled",
"format-wifi": " {bandwidthDownBits:>} 󰶡 {bandwidthUpBits:>} 󰶣",
"tooltip-format-wifi": "{essid}",
"format-ethernet": "󰈀 {bandwidthDownBits:>} 󰶡 {bandwidthUpBits:>} 󰶣",
"tooltip-format-ethernet": "{ifname}: {ipaddr}/{cidr}",
"format-disconnected": " Disconnected",
"on-click": "footclient -T waybar_nmtui -e nmtui",
"interval": 2
},
// Configuration - modules-right
"modules-right": [
"custom/keyboard-layout",
"idle_inhibitor",
"cpu",
"memory",
"backlight",
"pulseaudio",
"battery",
"clock",
"tray",
"custom/power"
],
"custom/keyboard-layout": {
"exec": "i=$(swaymsg -t get_inputs); echo \"\"; echo \"$i\" | grep -m1 'xkb_active_layout_name' | cut -d '\"' -f4",
"format": "",
// Interval set only as a fallback; use signal to update the module more immediately
"interval": 30,
// See example config for sending signal to Waybar in ~/.config/sway/config.d/input
"signal": 1,
"on-click": "~/.config/waybar/scripts/keyhint.sh"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
},
"tooltip-format-activated": "Idle Inhibitor Activated",
"tooltip-format-deactivated": "Idle Inhibitor Deactivated"
}, },
"cpu": { "cpu": {
"interval": 5, "interval": 5,
"format": " {usage}% ({load})", // Icon: microchip "format": "{usage:>3}%",
"states": { "states": {
"warning": 70, "warning": 70,
"critical": 90, "critical": 90,
}, },
"on-click": "xfce4-terminal -e 'htop'", "on-click": "footclient -T waybar_htop -e htop"
},
"custom/keyboard-layout": {
"exec": "swaymsg -t get_inputs | grep -m1 'xkb_active_layout_name' | cut -d '\"' -f4",
// Interval set only as a fallback, as the value is updated by signal
"interval": 30,
"format": " {}", // Icon: keyboard
// Signal sent by Sway key binding (~/.config/sway/key-bindings)
"signal": 1, // SIGHUP
"tooltip": false,
"on-click": "~/.config/waybar/scripts/keyhint.sh",
}, },
"memory": { "memory": {
"interval": 5, "interval": 5,
"format": " {}%", // Icon: memory "format": "{:>3}%",
"on-click": "xfce4-terminal -e 'htop'", "on-click": "footclient -T waybar_htop -e htop",
"states": { "states": {
"warning": 70, "warning": 70,
"critical": 90 "critical": 90
} }
}, },
"network": { "backlight": {
"interval": 5, "format": "{icon} {percent}%",
"format-wifi": " {essid} ({signalStrength}%)", // Icon: wifi "format-icons": ["󰄰", "󰪞", "󰪟", "󰪠", "󰪡", "󰪢", "󰪣", "󰪤", "󰪥"],
"format-ethernet": " {ifname}: {ipaddr}/{cidr}", // Icon: ethernet "tooltip-format": "Backlight (Scroll): {percent:}%",
"format-disconnected": "⚠ Disconnected", "on-scroll-down": "brightnessctl -c backlight set 5%-",
"tooltip-format": "{ifname}: {ipaddr}", "on-scroll-up": "brightnessctl -c backlight set +5%"
"on-click": "xfce4-terminal -e 'nmtui'",
},
"network#vpn": {
"interface": "tun0",
"format": " {essid} ({signalStrength}%)",
"format-disconnected": "⚠ Disconnected",
"tooltip-format": "{ifname}: {ipaddr}/{cidr}",
},
"sway/mode": {
"format": "{}",
"tooltip": false
},
"sway/window": {
"format": "{}",
"max-length": 120
},
"sway/workspaces": {
"disable-scroll": true,
"disable-markup" : false,
"all-outputs": true,
"format": " {icon} ",
//"format":"{icon}",
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
}
}, },
"pulseaudio": { "pulseaudio": {
"scroll-step": 1, // %, can be a float "scroll-step": 2,
"format": "{volume}% {icon}", "format": "{icon} {volume}%",
"format-bluetooth": "{volume}% {icon}  {format_source}", "format-muted":"󰝟 muted",
"format-bluetooth-muted": " {icon}  {format_source}",
"format-muted": "婢 {format_source}",
"format-source": "{volume}% ",
"format-source-muted": "",
"format-icons": { "format-icons": {
"headphone": "", "headphones": "",
"hands-free": "וֹ", "handsfree": "",
"headset": "", "headset": "",
"phone": "", "phone": "",
"portable": "", "portable": "",
"car": "", "car": "",
"default": [""] "default": ["󰕿", "󰖀", "󰕾"]
}, },
"on-click": "pavucontrol", "on-click": "pavucontrol"
"on-scroll-up": "pactl set-sink-volume @DEFAULT_SINK@ +2%",
"on-scroll-down": "pactl set-sink-volume @DEFAULT_SINK@ -2%",
}, },
// to use the weather module replace <your_location> with your city or town "battery": {
// note: do not use spaces: new york would be newyork "states": {
"custom/weather": { "warning": 30,
"exec": "~/.config/waybar/scripts/weather.sh <your_location>", "critical": 15
"return-type": "json", },
"interval": 600, "format": "{icon} {capacity}%",
"format-icons": ["", "", "", "", ""]
},
"clock": {
"format": "󰅐 {:%H:%M}",
"format-alt": "󰅐 {:%OI:%M %p}",
"tooltip-format": " {:%A %m/%d}\n\n<tt><small>{calendar}</small></tt>",
"calendar": {
"on-scroll": 1,
"format": {
"months": "<span color='#ffead3'><b>{}</b></span>",
"days": "<span color='#ecc6d9'><b>{}</b></span>",
"weeks": "<span color='#99ffdd'><b>W{}</b></span>",
"weekdays": "<span color='#ffcc66'><b>{}</b></span>",
"today": "<span color='#ff6699'><b><u>{}</u></b></span>"
},
},
"actions": {
"on-scroll-up": "shift_up",
"on-scroll-down": "shift_down"
},
}, },
"tray": { "tray": {
"icon-size": 18, "icon-size": 16,
"spacing":10, "spacing":10
}, },
"backlight#icon": {
"format": "{icon}",
"format-icons": [""],
"on-scroll-down": "brightnessctl -c backlight set 1%-",
"on-scroll-up": "brightnessctl -c backlight set +1%"
},
"backlight#value" :{
"format": "{percent}%",
"on-scroll-down": "brightnessctl -c backlight set 1%-",
"on-scroll-up": "brightnessctl -c backlight set +1%"
},
"custom/firefox": {
"format": " ",
"on-click": "exec firefox",
"tooltip": false
},
"custom/terminal": {
"format": " ",
"on-click": "exec xfce4-terminal",
"tooltip": false
},
"custom/files": {
"format": " ",
"on-click": "exec thunar",
"tooltip": false
},
"custom/launcher": {
"format":" ",
"on-click": "exec wofi -c ~/.config/wofi/config -I",
"tooltip": false,
},
"custom/power": { "custom/power": {
"format":"⏻", "format":"⏻",
"on-click": "exec ~/.config/waybar/scripts/power-menu.sh", "on-click": "exec ~/.config/sway/scripts/power_menu.sh",
"tooltip": false, "tooltip": false
}, },
} }

View File

@ -1,2 +1,103 @@
#!/bin/sh #!/bin/bash
yad --title="EndeavourOS Sway-WM keybindings:" --no-buttons --geometry=400x345-15-400 --list --column=key: --column=description: --column=command: "ESC" "close this app" "" "=" "modkey" "(set mod Mod4)" "+enter" "Terminal" "(xfce4-terminal)" "+d" "Application Menu" "(wofi)" "+p" "Activities" "(wofi)" "+o" "" "Open Broswer" "+n" "" "Open Files" "+q" "close focused app" "(kill)" "[Shift]+Print-key" "screenshot" "(grim)" "+Shift+e" "power-menu" "(wofi)" "+t" "open keybinding helper" "full list"
# Set the font
font="JetBrainsMono"
cheat=(
--title="EndeavourOS Sway keybindings:"
--no-buttons
--geometry=1200x680
--list
--no-click
--no-selection
--column="<span font='$font Bold 18'>Function</span>"
--column="<span font='$font Bold 18'>Binding</span>"
--column=""
--column="<span font='$font Bold 18'>Function</span>"
--column="<span font='$font Bold 18'>Binding</span>"
--column-align=ccccc
--header-align=ccccc
"<span font='$font 16' foreground='#808080'>GENERAL</span>"
""
""
"<span font='$font 16' foreground='#808080'>LAUNCHERS AND MENUS</span>"
""
"<span font='$font 14'>Mod key (Super/Meta//󰘳)</span>"
"<span font='$font 18'></span>"
""
"<span font='$font 14'>Open the launcher</span>"
"<span font='$font 14'> + </span><span font='$font 18'>󰯴</span>"
"<span font='$font 14'>Change window focus</span>"
"<span font='$font 14'> + </span><span font='$font 18'>󰜳 󰜰 󰜹 󰜶</span>"
""
"<span font='$font 14'>Open the application menu</span>"
"<span font='$font 14'> + Shift + </span><span font='$font 18'>󰯴</span>"
"<span font='$font 14'>Vim keys are supported</span>"
"<span font='$font 14'> + </span><span font='$font 18'>󰰀 󰰆 󰰉 󰰌</span>"
""
"<span font='$font 14'>Open the power menu</span>"
"<span font='$font 14'> + Shift + </span><span font='$font 18'>󰯷</span>"
"<span font='$font 14'>Close a window</span>"
"<span font='$font 14'> + </span><span font='$font 18'>󰰛</span>"
""
"<span font='$font 14'>Activities overview</span>"
"<span font='$font 14'> + </span><span font='$font 18'>󰰘</span>"
"<span font='$font 14'>Move a window</span>"
"<span font='$font 14'> + Shift + </span><span font='$font 18'>󰜳 󰜰 󰜹 󰜶</span>"
""
"<span font='$font 16' foreground='#808080'>SCREENSHOTS</span>"
""
"<span font='$font 14'>Move window with mouse</span>"
"<span font='$font 14'> + 󰍽</span>"
""
"<span font='$font 14'>Snip a screenshot</span>"
"<span font='$font 14'>Print</span>"
"<span font='$font 14'>Resize a window</span>"
"<span font='$font 14'> + Ctrl + </span><span font='$font 18'>󰜳 󰜰 󰜹 󰜶</span>"
""
"<span font='$font 14'>Screenshot a window</span>"
"<span font='$font 14'>Ctrl + Print</span>"
"<span font='$font 14'>Resize with right click</span>"
"<span font='$font 14'> + 󰍽</span>"
""
"<span font='$font 14'>Screenshot the display</span>"
"<span font='$font 14'>Shift + Print</span>"
"<span font='$font 14'>Change workspace</span>"
"<span font='$font 14'> + </span><span font='$font 18'>󰎦 󰎩 󰎬 󰎮</span><span font='$font 14'> ...</span>"
""
"<span font='$font 16' foreground='#808080'>CLIPBOARD MANAGER</span>"
""
"<span font='$font 14'>Send window to workspace</span>"
"<span font='$font 14'> + Shift + </span><span font='$font 18'>󰎦 󰎩 󰎬 󰎮</span><span font='$font 14'> ...</span>"
""
"<span font='$font 14'>Launch cliphist</span>"
"<span font='$font 14'>Ctrl +  + </span><span font='$font 18'>󰰪</span>"
"<span font='$font 14'>Toggle floating/tiling</span>"
"<span font='$font 14'> + Shift + Space</span>"
""
"<span font='$font 14'>Delete an entry from cliphist</span>"
"<span font='$font 14'>Ctrl +  + </span><span font='$font 18'>󰰰</span>"
"<span font='$font 14'>Toggle fullscreen</span>"
"<span font='$font 14'> + </span><span font='$font 18'>󰯺</span>"
""
"<span font='$font 16' foreground='#808080'>APPLICATION SHORTCUTS</span>"
""
"<span font='$font 16' foreground='#808080'>SCRATCHPAD</span>"
""
""
"<span font='$font 14'>Launch the terminal</span>"
"<span font='$font 14'> + Enter</span>"
"<span font='$font 14'>Move window to scratchpad</span>"
"<span font='$font 14'> + Shift + </span><span font='$font 18'>󰛲</span>"
""
"<span font='$font 14'>Launch the file explorer</span>"
"<span font='$font 14'> + </span><span font='$font 18'>󰰒</span>"
"<span font='$font 14'>Show next scratchpad window</span>"
"<span font='$font 14'> + </span><span font='$font 18'>󰛲</span>"
""
"<span font='$font 14'>Launch the web browser</span>"
"<span font='$font 14'> + </span><span font='$font 18'>󰰕</span>"
""
)
yad "${cheat[@]}"

View File

@ -10,11 +10,8 @@
* Keyframes * Keyframes
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
/* @define-color highlight #685878 ;
Arc-Dark Color Scheme @define-color base1 #19191e ;
*/
@define-color highlight #5294e2 ;
@define-color base1 #404552 ;
@keyframes blink-warning { @keyframes blink-warning {
70% { 70% {
@ -54,59 +51,74 @@ Arc-Dark Color Scheme
/* The whole bar */ /* The whole bar */
#waybar { #waybar {
background: transparent; background: transparent;
color: #bebebe; color: #e3e3ea;
background-color: @base1; background-color: @base1;
font-family: UbuntuMono; font-family: JetBrainsMono;
font-size: 14px; font-size: 13px;
} }
/* Every modules */ /* Every modules */
#mode,
#network,
#custom-keyboard-layout,
#idle_inhibitor,
#cpu,
#memory,
#backlight,
#pulseaudio,
#battery, #battery,
#clock, #clock,
#backlight, #tray {
#cpu,
#custom-keyboard-layout,
#memory,
#mode,
#custom-weather,
#network,
#pulseaudio,
#temperature,
#tray,
#idle_inhibitor,
#custom-PBPbattery {
padding:0.5rem 0.6rem; padding:0.5rem 0.6rem;
margin: 1px 0px; margin: 1px 0px;
} }
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* Modules styles * Module styles
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#battery { #custom-launcher {
animation-timing-function: linear; margin-left:15px;
animation-iteration-count: infinite; margin-right:10px;
animation-direction: alternate;
} }
#battery.warning { #workspaces {
font-size:13px;
}
#workspaces button {
border-radius: 5px;
color: #eceff4;
padding: 1px 6px;
margin-right: 2px;
margin-left: 2px;
}
#workspaces button.focused {
border: 1px solid #d8dee9;
}
#workspaces button.urgent {
border-color: #c9545d;
color: #c9545d;
}
#mode {
background: @highlight;
border-bottom: 3px transparent;
color:white;
margin-left: 5px;
padding: 7px;
}
#window {
font-weight: bold;
}
#network.disconnected {
color: orange; color: orange;
} }
#battery.critical {
color: red;
}
#battery.warning.discharging {
animation-name: blink-warning;
animation-duration: 3s;
}
#battery.critical.discharging {
animation-name: blink-critical;
animation-duration: 2s;
}
#cpu.warning { #cpu.warning {
color: orange; color: orange;
} }
@ -133,53 +145,38 @@ Arc-Dark Color Scheme
padding-right:5px; padding-right:5px;
} }
#mode { #backlight.icon {
background: @highlight;
border-bottom: 3px transparent;
color:white;
margin-left: 5px;
padding: 7px;
}
#network.disconnected {
color: orange;
} }
#pulseaudio { #pulseaudio {
padding-top:6px;
} }
#pulseaudio.muted { #pulseaudio.muted {
color: @highlight; color: @highlight;
} }
#temperature.critical { #battery {
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#battery.warning {
color: orange;
}
#battery.critical {
color: red; color: red;
} }
#window { #battery.warning.discharging {
font-weight: bold; animation-name: blink-warning;
animation-duration: 3s;
} }
#workspaces { #battery.critical.discharging {
font-size:13px; animation-name: blink-critical;
} animation-duration: 2s;
#workspaces button {
border-bottom: 3px solid transparent;
margin-bottom: 0px;
padding:0px;
}
#workspaces button.focused {
border-bottom: 3px solid @highlight;
margin-bottom: 1px;
padding-left:0;
}
#workspaces button.urgent {
border-color: #c9545d;
color: #c9545d;
} }
#custom-power { #custom-power {
@ -187,14 +184,3 @@ Arc-Dark Color Scheme
margin-right:15px; margin-right:15px;
font-size:15px; font-size:15px;
} }
#custom-launcher {
font-size:15px;
margin-left:15px;
margin-right:10px;
}
#backlight.icon {
padding-right:1px;
font-size: 13px;
}