Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.65k stars 709 forks source link

Memory Module Does Not Work #1073

Closed usdogu closed 3 years ago

usdogu commented 3 years ago

Waybar Version : 0.9.7 OS : Arch Linux (64 bit) Desktop : Sway v1.6

I just copied memory module example from the wiki but it doesn't show. I tried launching waybar from commandline for errors but there was nothing about memory module

my config :

{
    // "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": 1280, // Waybar width
    // Choose the order of the modules
    "modules-left": ["custom/space", "custom/powermenu", "custom/seperator", "sway/workspaces", "sway/mode", "custom/media", "sway/window"],
    //"modules-center": ["sway/window"],
    "modules-right": ["custom/pacman", "idle_inhibitor", "custom/fan", "backlight", "pulseaudio", "battery", "network", "clock", "tray", "custom/space"],
    // Modules configuration
    // "sway/workspaces": {
    //     "disable-scroll": true,
    //     "all-outputs": true,
    //     "format": "{name}: {icon}",
    //     "format-icons": {
    //         "1": "",
    //         "2": "",
    //         "3": "",
    //         "4": "",
    //         "5": "",
    //         "urgent": "",
    //         "focused": "",
    //         "default": ""
    //     }
    // },
    "sway/workspaces": {
        "format": " {}"
    },
    "sway/mode": {
        "format": "<span style=\"italic\">{}</span>"
    },
    "sway/window": {
        "format": "   {}   "
    },
    "idle_inhibitor": {
        "format": "    {icon}    ",
        "format-icons": {
            "activated": "",
            "deactivated": ""
        },
    },
    "tray": {
        // "icon-size": 21,
        "spacing": 10
    },
    "clock": {
        // "timezone": "America/New_York",
        "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
        "format-alt": "  {:%d/%m/%Y - %H:%M:%S}",
        "format": "  {:%H:%M:%S}",
        "interval": 1
    },
    "backlight": {
        "device": "intel_backlight",
        "format": "{icon}  {percent}%",
        "format-icons": [""],
        "on-scroll-up": "~/.config/sway/scripts.d/brightness.sh up",
        "on-scroll-down": "~/.config/sway/scripts.d/brightness.sh down"
    },
    "battery": {
        "states": {
            // "good": 95,
            "warning": 30,
            "critical": 15
        },
        "format": "{icon} {capacity}%  [{time}]",
        "format-charging": "  {capacity}%  [{time}]",
        "format-plugged": "  {capacity}%",
        "format-alt": "{icon}  {time}",
        // "format-good": "", // An empty format will hide the module
        // "format-full": "",
        "format-icons": ["", "", "", "", ""]
    },
    "battery#bat2": {
        "bat": "BAT2"
    },
    "network": {
        // "interface": "wlp2*", // (Optional) To force the use of this interface
        "format-wifi": "",
        "format-ethernet": "  {ifname}",
        "format-linked": "  {ifname} (No IP)",
        "format-disconnected": "⚠  Disconnected",
        // "format-alt": "{ifname}: {ipaddr}/{cidr}",
    "format-alt": " [ {essid} ]",
        "on-click-right": "kitty -e nmtui"
    },
    "custom/fan": {
        "exec": "cat /sys/devices/virtual/hwmon/*/fan1_input",
    "format": "  {} RPM",
        "interval": 1
    },
   "memory": {
         "format": "{}% ",
    },
    "custom/space": {
        "exec": "echo '   '",
    "format": "{}",
        "interval": 10000
    },
    "custom/seperator": {
        "exec": "echo '  |  '",
    "format": "{}",
        "interval": 10000
    },
    "custom/powermenu": {
        "format": "      ",
        "interval": 3600,
        "on-click": "$HOME/.config/sway/scripts.d/powermenu.sh"
    },
    "pulseaudio": {
        // "scroll-step": 1, // %, can be a float
        "format": "{icon} {volume}%",
        "format-bluetooth": "{icon}  {volume}%",
        "format-bluetooth-muted": "{icon}  ",
        "format-muted": "",
        "format-source-muted": "",
        "format-icons": {
            "headphone": "",
            "hands-free": "",
            "headset": "",
            "phone": "",
            "portable": "",
            "car": "",
            "default": ["", "", ""]
        },
        "scroll-step": 5,
        "on-click": "pactl set-sink-mute $(pacmd list-sinks | grep -e '* index:' | awk -F ': ' '{print $2}') toggle",
    "on-click-right": "pavucontrol"
    },
}

my style.css

@define-color colorin    #541404;
@define-color background #0a0000;
@define-color foreground #D03109;
@define-color color15    #ffffff;
@define-color split      #D03109;

* {
    border-radius: 0;
    font-family: SFNS Display, FontAwesome5Brands, FontAwesome5Free, Arial, sans-serif;
    font-size: 13px;
    min-height: 0;
}

window#waybar {
    background-color: @background;
    color: @color15;
    transition-property: background-color;
    transition-duration: .5s;
}

#workspaces button {
    padding: 0 5px;
    background-color: @background;
    color: @color15;
}

#workspaces button:hover {
    background-color: @background;
}

#workspaces button.focused {
    background-color: @foreground;
    color: @color15;
    border-top: 3px solid @background;
    border-bottom: 3px solid @background;
    padding: 0 5px 0 2px;
}

#workspaces button.urgent {
    border-top: 3px solid @foreground;
    border-bottom: 3px solid @foreground;
    background-color: #eb4d4b;
}

#tray,
#network,
#custom-fan,
#memory,
#pulseaudio {
    padding: 0 8px;
    margin: 0 4px;
    background-color: @foreground;
    color: @color15;
    border-top: 3px solid @background;
    border-bottom: 3px solid @background;
}

#clock,
#battery,
#backlight,
#mode {
    padding: 0 8px;
    margin: 0 4px;
    border-top: 3px solid @foreground;
    border-bottom: 3px solid @foreground;
    background-color: @background;
    color: @color15;
    border-top: 3px solid @background;
    border-bottom: 3px solid @background;
}

#window {
    margin: 0 4px;
    background-color: @foreground;
    color: @color15;
    border-top: 3px solid @background;
    border-bottom: 3px solid @background;
}

.modules-left > widget:first-child > #workspaces {
    margin-left: 0;
}

.modules-right > widget:last-child > #workspaces {
    margin-right: 0;
}

#workspaces {
    margin: 0 4px;
    margin-right: 10px;
}
usdogu commented 3 years ago

my bad I just forget to replace custom/pacman with memory