Waybar and Wodi

This commit is contained in:
OdiousImp2604
2021-01-24 13:47:49 +00:00
committed by GitHub
parent 02d4a89da6
commit c4b69bf43e
16 changed files with 845 additions and 115 deletions

View File

@@ -15,10 +15,7 @@
],
"modules-right": [
"custom/firefox",
"custom/files",
"custom/terminal",
"network",
"network",
"memory",
"cpu",
// "custom/weather",
@@ -33,23 +30,6 @@
// Modules
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": false,
"format": "{icon}",
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"6": "",
"urgent": "",
"focused": ",",
"default": ""
}
},
"battery": {
"states": {
// "good": 95,
@@ -121,28 +101,26 @@
},
"sway/workspaces": {
"all-outputs": false,
"disable-scroll": true,
"format": "{icon} {name}",
"format-icons": {
"1:www": "", // Icon: firefox-browser
"2:mail": "", // Icon: mail
"3:editor": "", // Icon: code
"4:terminals": "", // Icon: terminal
"5:portal": "", // Icon: terminal
"urgent": "",
"focused": "",
"default": ""
}
},
"disable-scroll": true,
"disable-markup" : false,
"all-outputs": true,
"format": " {icon} ",
//"format":"{icon}",
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
}
},
"pulseaudio": {
"scroll-step": 1, // %, can be a float
"format": "{volume}% {icon}",
"format-bluetooth": "{volume}% {icon}  {format_source}",
"format-bluetooth-muted": " {icon}  {format_source}",
"format-muted": " {format_source}",
"format-source": "{volume}% ",
"format-muted": " {format_source}",
"format-source": "{volume}% ",
"format-source-muted": "",
"format-icons": {
"headphone": "",
@@ -151,7 +129,7 @@
"phone": "",
"portable": "",
"car": "",
"default": [""]
"default": [""]
},
"on-click": "pavucontrol",
"on-scroll-up": "pamixer -ui 2",
@@ -167,6 +145,7 @@
"tray": {
"icon-size": 18,
"spacing":10,
},
"backlight": {
@@ -209,3 +188,11 @@
"tooltip": false,
},
}
"wlr/taskbar": {
"format": "{icon}",
"icon-size": 14,
"icon-theme": "Numix-Circle",
"tooltip-format": "{title}",
"on-click": "activate",
"on-click-middle": "close"
}

244
.config/waybar/config2 Normal file
View File

@@ -0,0 +1,244 @@
[{
"layer": "top", // Waybar at top layer
"position": "bottom", // Waybar position (top|bottom|left|right)
"height": 30, // Waybar height (to be removed for auto height)
// "width": 2560, // Waybar width
// Choose the order of the modules
"margin-right": 8,
"margin-left": 8,
"margin-top": 1,
"margin-bottom":8,
"modules-left": ["custom/launcher", "sway/workspaces","custom/firefox", "custom/libreoffice", "custom/youtube", "custom/dolphin", "custom/kate","custom/store", "custom/spotify",],
"modules-center": ["sway/window",],
"modules-right": ["pulseaudio", "custom/weather", "cpu", "custom/pacman", "battery", "backlight" , "tray", "clock", "custom/recorder", "custom/power", ],
// Modules configuration
"sway/workspaces": {
"disable-scroll": false,
"all-outputs": true,
"format": "{icon}",
"persistent_workspaces": {
"1": [],
"2": [],
"3": [],
"4": [],
},
"format-icons": {
"1": "1",
"2": "2",
"3": "3",
"4": "4",
"5": "5",
"focused": "",
"urgent": "",
"default": ""
},
"icon-size": 15
},
"river/tags": {
"num-tags": 5
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"sway/window": {
"format": "{}",
"max-length": 65,
},
"custom/media": {
"format": "{icon}{}",
"return-type": "json",
"format-icons": {
"Playing": " ",
"Paused": " ",
"Music": " "
},
"max-length":65,
"interval": 2,
"exec": "fish -c playerstatus",
"exec-on-event": "fish -c playerstatus",
"on-click": "playerctl play-pause",
"on-click-right": "mpc toggle --host 127.0.0.1 --port 6002",
},
"custom/recorder": {
"return-type": "json",
"format": "",
"interval": 1,
"exec-if": "pgrep wf-recorder",
"exec": "echo '{\"class\": \"recording\"}'",
"on-click": "fish -c recording",
"tooltip": false,
},
"tray": {
"spacing": 10,
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"clock": {
// "timezone": "America/New_York",
"format": "{:%I:%M %p}",
"format-alt": "{:%A, %B %d}",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
// "format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"format": "{usage} ",
"on-click": "alacritty -e ytop",
"tooltip": false
},
"memory": {
"format": "{} "
},
"temperature": {
"thermal-zone": 2,
"hwmon-path": "/sys/class/hwmon/hwmon0/temp1_input",
"critical-threshold": 80,
"format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC} {icon}",
"interval": 60,
"format-icons": ["", "", ""]
},
"backlight": {
"interval": 5,
"format": "{icon}",
"format-alt": "{percent}% {icon}",
"format-alt-click": "click-right",
"format-icons": ["🌕", "🌔", "🌓", "🌒", "🌑"],
"on-scroll-down": "brightnessctl -c backlight set +5%",
"on-scroll-up": "brightnessctl -c backlight set 5%-"
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
},
"network": {
"interface": "wlan0", // (Optional) To force the use of this interface
"format-wifi": " connected",
"format-ethernet": "{ifname}: {ipaddr}/{cidr} ",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "Disconnected ⚠",
"format-alt": "{ifname}: {ipaddr}/{cidr}",
"interval": 60,
"on-click-right": "exec /home/aryan/nmcli-rofi/nmcli-rofi"
},
"pulseaudio": {
"scroll-step": 1, // %, can be a float
"format": "{volume}% {icon}",
"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",
"on-scroll-up": "pactl set-sink-volume @DEFAULT_SINK@ -5%",
"on-scroll-down": "pactl set-sink-volume @DEFAULT_SINK@ +5%",
},
"custom/weather": {
"exec": "~/.config/waybar/scripts/weather.sh Royal Tunbridge Wells",
"format": "{}",
"return-type": "json",
"interval": 600
},
"custom/pacman": {
"format": "{} ",
"interval": 3600, // every hour
// "restart-interval": 3600,
"exec": "checkupdates | wc -l", // # of updates
"exec-if": "exit 0", // always run; consider advanced run conditions
"on-click": "alacritty -e yay; pkill -SIGRTMIN+8 waybar", // update system
"signal": 8,
},
"disk": {
"interval": 30,
"format": "{free}",
"path": "/run/media/aryan/",
},
"custom/power": {
"format": "⏻",
"on-click": "exec nwgbar",
"tooltip": false
},
"custom/firefox": {
"format": "",
"on-click": "exec firefox",
"tooltip": false
},
"custom/libreoffice": {
"format": "",
"on-click": "exec libreoffice",
"tooltip": false
},
"custom/youtube": {
"format": "輸",
"on-click": "xdg-open https://www.youtube.com/",
"tooltip": false
},
"custom/dolphin": {
"format": "",
"on-click": "exec dolphin",
"tooltip": false
},
"custom/kate": {
"format": "",
"on-click": "exec kate",
"tooltip": false
},
"custom/store": {
"format": " ",
"on-click": "exec pamac-manager",
"tooltip": false
},
"custom/launcher": {
"format":" ",
"on-click": "exec ~/.config/rofi/launchers/text/launcher.sh",
"tooltip": false
},
"wlr/taskbar": {
"format": "{icon}",
// "format": "{app_id}",
"icon-theme": "Papirus",
"icon-size": 15,
"on-click": "activate",
"markup": true,
"max-length": 7,
"on-click-right": "minimize",
"on-click-middle": "close"
},
"custom/spotify": {
"interval": 1,
"return-type": "json",
"exec": "~/.config/waybar/modules/spotify.sh",
"exec-if": "pgrep spotify",
"escape": true
}
}]

View File

@@ -0,0 +1,18 @@
#!/bin/sh
class=$(playerctl metadata --player=spotify --format '{{lc(status)}}')
icon=""
if [[ $class == "playing" ]]; then
info=$(playerctl metadata --player=spotify --format '{{artist}} - {{title}}')
if [[ ${#info} > 40 ]]; then
info=$(echo $info | cut -c1-40)"..."
fi
text=$info" "$icon
elif [[ $class == "paused" ]]; then
text=$icon
elif [[ $class == "stopped" ]]; then
text=""
fi
echo -e "{\"text\":\""$text"\", \"class\":\""$class"\"}"

View File

@@ -0,0 +1,58 @@
package main
import (
"encoding/json"
"fmt"
"os"
"os/exec"
"strings"
)
type jsonOutput struct {
Text string `json:"text,omitempty"`
Alt string `json:"alt,omitempty"`
Tooltip string `json:"tooltip,omitempty"`
Class string `json:"class,omitempty"`
Percentage int `json:"percentage,omitempty"`
}
func main() {
o := jsonOutput{}
pac, err := exec.Command("checkupdates").CombinedOutput()
if err != nil {
o.Tooltip = err.Error()
}
aur, err := exec.Command("yay", "--devel", "-Qu").CombinedOutput()
if err != nil {
o.Tooltip += err.Error()
}
updates := append(strings.Split(string(pac), "\n"), strings.Split(string(aur), "\n")...)
updates = removeEmptyLines(updates)
n := len(updates)
o.Class = "no-updates"
if n > 0 {
o.Class = "updates"
o.Tooltip = strings.Join(updates, "\n")
}
o.Text = fmt.Sprintf("%d", n)
o.Alt = fmt.Sprintf("%d", n)
o.Percentage = n
json.NewEncoder(os.Stdout).Encode(o)
}
func removeEmptyLines(list []string) []string {
out := []string{}
for _, line := range list {
if len(line) > 0 {
out = append(out, line)
}
}
return out
}

View File

@@ -0,0 +1,3 @@
#!/bin/bash
alacritty --class aptus-upgrade -e yay --devel -Syu

View File

@@ -0,0 +1,3 @@
#!/bin/bash
report=$(curl wttr.in/?format="%C,+%t")
echo $report

View File

@@ -0,0 +1,3 @@
#!/bin/bash
echo '{"text": "'$(playerctl metadata title)'", "alt": "'$(playerctl status)'", "tooltip": "'$(playerctl metadata --format "{{ playerName }} : {{ artist }} - {{ title }}")'", "class": "'$(playerctl status)'" }'

View File

@@ -2,7 +2,7 @@
entries="Logout Suspend Reboot Shutdown"
selected=$(printf '%s\n' $entries | wofi --width 300 --height 150 --show=dmenu --cache-file /dev/null | awk '{print tolower($1)}')
selected=$(printf '%s\n' $entries | wofi --width 100 --height 20 --show=dmenu --cache-file /dev/null | awk '{print tolower($1)}')
case $selected in
logout)

View File

@@ -0,0 +1,7 @@
#!/bin/bash
if pgrep river; then
wlogout -p layer-shell
else
nwgbar -o 0.4
fi

View File

@@ -9,6 +9,14 @@
/* -----------------------------------------------------------------------------
* Keyframes
* -------------------------------------------------------------------------- */
/*
Arc-Dark Color Scheme
*/
@define-color highlight #5294e2 ;
@define-color base1 #404552 ;
@keyframes blink-warning {
70% {
@@ -39,22 +47,39 @@
/* Reset all styles */
* {
border: none;
border: none;
border-radius: 0;
margin-top: 0px;
padding-top: 1px;
padding-bottom: 1px;
padding-left: 10;
padding-right: 10;
min-height: 0;
margin: 1px;
padding: 1.5;
}
/* The whole bar */
#waybar {
background: black;
color: white;
background: transparent;
color: #bebebe;
background-color: @base1;
font-family: UbuntuMono;
font-size: 14px;
}
/* Each module */
#battery,
#clock,
#backlight,
#cpu,
#custom-keyboard-layout,
#memory,
#mode,
#network,
#pulseaudio,
#temperature,
#tray {
margin-left:10px;
margin-right:10px;
}
/* -----------------------------------------------------------------------------
@@ -112,7 +137,7 @@
#mode {
background: red;
border-bottom: 3px transparent;
margin: 3;
margin: 3px;
}
#network.disconnected {
@@ -120,7 +145,7 @@
}
#pulseaudio.muted {
color: @base07;
color: @highlight;
}
#temperature.critical {
@@ -132,15 +157,16 @@
}
#workspaces button {
border-bottom: 3px solid transparent;
margin-bottom: 0;
padding-left: 1;
padding-right:1;
border-bottom: 3px solid transparent;
margin-bottom: 0px;
padding:0px;
}
#workspaces button.focused {
border-bottom: 3px solid #ffffff;
border-bottom: 3px solid @highlight;
margin-bottom: 1px;
padding-left:0;
}
#workspaces button.urgent {
@@ -148,22 +174,14 @@
color: #c9545d;
}
#custom-firefox {
color: #d08770;
}
#custom-files {
color: #ebcb8b;
}
#custom-power {
font-size: 15px;
margin-right:1px;
padding:0;
}
#custom-launcher {
font-size: 20px;
padding:0;
}
#custom-power,
#custom-launcher{
margin-left:15px;
margin-right:15px;
font-size:15px;
}
#custom-launcher{
font-size:20px;
}

285
.config/waybar/style2.css Normal file
View File

@@ -0,0 +1,285 @@
* {
border: none;
font-size: 15px;
margin: 2.5px;
font-family: MagicMushroom;
}
window#waybar {
background-color: transparent;
color: #d8dee9;
border-radius: 15px;
}
#workspaces {
font-family:JetBrainsMono;
background-color: #3b4252;
padding: 1px 5px 1px 5px;
font-size: 15px;
border-radius: 10px;
}
#workspaces button {
font-size: 10px;
border-radius: 10px;
margin: 0;
background-color: transparent;
color: #ffffff;
}
#window {
color: #d8dee9;
margin: 0px;
font-size: 14px;
border-radius: 10px;
padding: 0px 6px 0px 6px;
}
@keyframes fadeIn {
from {opacity: 0;}
to {opacity: 1;}
}
window#waybar.empty {
/* background-color: #353b49; */
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
#workspaces button:hover {
box-shadow: inherit;
color: #5e81ac;
}
#workspaces button.focused,#tags button.occupied {
color: #81a1c1;
}
#tags button.focused {
color: #5e81ac;
}
#workspaces button.urgent {
color: #BF616A;
}
#tags button {
font-family:MagicMushroom;
font-weight: 600;
}
#mpd {
padding: 0px 10px;
color: #ffffff;
}
/* TASKBAR */
#taskbar {
margin: 2px 4px 2px 4px;
}
#taskbar button {
border-radius: 10px;
font-size: 14px;
margin: 0px 5px 0px 5px;
padding: 0px 6px 0px 6px;
background-color: #2e3440;
}
#taskbar button.active {
/* background-color: #434c5e; */
color: #5e81ac;
}
#taskbar button.minimized {
color: #ebcb8b;
}
#taskbar button:hover {
box-shadow: inherit;
background-color: rgba(35,39,49,0.4);
}
/* BROWSER BOOKMARKS */
#custom-name, #custom-firefox,#custom-libreoffice,#custom-dolphin,#custom-youtube,#custom-kate, #custom-store. {
background-color: transparent;
font-size: 15px;
margin-left: 0;
margin-right: 0;
padding: 0px 15px 0px 15px ;
}
#custom-firefox {
margin-left: 10px;
border-radius: 10px 0px 0px 10px;
font-size: 15px;
color: #d08770;
}
#custom-libreoffice {
color: #ebcb8b;
font-size: 15px;
}
#custom-library {
color: #c57078;
font-size: 15px;
}
#custom-dolphin {
color: #a3be8c;
border-radius: 0px 10px 10px 0px;
font-size: 15px;
}
#custom-youtube {
color: #b48ead;
font-size: 15px;
}
#custom-kate {
color: #88c0d0;
font-size: 15px;
}
#custom-store {
margin-left: 10px;
font-size: 15px;
}
#custom-launcher {
margin-left: 10px;
margin-right: 10px;
font-size: 15px;
background-color: #88c0d0;
padding: 7px 7px 7px 7px;
border-radius: 15px;
}
/* WIDGETS */
#cpu, #idle_inhibitor, #custom-pacman, #memory, #backlight, #disk, #network, #pulseaudio, #custom-weather, #temperature, #mpd {
font-size: 14px;
background-color: #3b4252;
padding: 0px 14px 0px 14px;
margin: 3px 0px 3px 0px;
border-radius: 0px;
}
#disk {
color:#b48ead;
}
#memory {
color:#d08770;
}
#cpu {
color:#c57078;
}
#network {
color: #9da98d;
}
#custom-weather {
color:#81a1c1;
}
#custom-weather {
padding: 0px 8px 0px 8px;
background-color:#4c566a;
color:#b48ead;
}
#custom-media {
color: #818896;
border-radius: 0px;
margin-left: 10px;
padding: 0px 14px 0px 14px;
}
#custom-media.Playing {
color: #81a1c1;
border-radius: 0px;
font-weight: 500;
}
#custom-media.Music {
color: #b48ead;
border-radius: 0px;
font-weight: 500;
}
#custom-pacman {
color: #ebcb8b;
border-radius: 0px 10px 10px 0px;
font-weight: 600;
background-color:#4c566a;
}
#pulseaudio {
color: #8fbcbb;
border-radius: 10px 0px 0px 10px;
}
#pulseaudio.muted {
border-radius: 10px;
color: #4c566a;
}
#temperature{
color: #88c0d0;
}
#temperature.critical {
color: #eb4d4b;
}
#backlight{
background-color:#4c566a;
margin: 3px 0px 3px 0px;
color: #ebcb8b;
border-radius: 0px 10px 10px 0px;
font-size: 17px;
}
#battery {
font-size: 14px;
background-color: #3b4252;
border-radius: 10px 0px 0px 10px;
color: #88c0d0;
padding: 0px 14px 0px 14px;
margin: 3px 0px 3px 12px;
}
#battery.charging {
color: #ffffff;
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
#battery.critical:not(.charging) {
background-color: #88c0d0;
border-radius: 10px;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
background-color: #000000;
}
#idle_inhibitor {
font-size: 20px;
color: #6f7787;
}
#idle_inhibitor.activated {
color: #ffffff;
}
#custom-power, #custom-recorder, #tray {
background-color: transparent;
padding: 2px 10px 2px 10px;
margin: 2px 10px 2px 10px;
}
#clock {
font-family:MagicMushroom;
font-size: 14px;
margin-left: 5px;
padding: 0px 14px 0px 14px;
background-color: #3b4252;
border-radius: 10px;
}
#custom-recorder {
color:#c57078;
padding: 2px 5px 2px 15px;
margin: 2px 2px 2px 2px;
font-size: 18px;
}
#tray {
border-radius: 15px;
margin-left: 7px;
color: #8fbcbb;
}
#custom-power {
color: #eceff4;
background-color: #88c0d0;
font-size: 17px;
margin-right: 2px;
border-radius: 15px;
}
#mpd.disconnected {
background-color: #f53c3c;
}
#mpd.stopped {
background-color: #90b1b1;
}
#mpd.paused {
background-color: #51a37a;
}

5
.config/waybar/taskbar Normal file
View File

@@ -0,0 +1,5 @@
{
"layer": "top",
"position": "bottom",
"height": 25
}