Skip to content

The waybar-disks module and 2 or more paths #3533

Open
@Anonim19992

Description

@Anonim19992

Good time of day. I switched from the x environment, where I used polibar to wayland with waybar.
In polibar, I could specify 2 or more paths (because 2 ssd (on 1 / and /boot, on the other /home) (
mount-0 = /
mount-1 = /home
)
In waybar, at the moment I have to use the following bash script:

`#! /bin/bash
#--------------------------------------------------------------------------------------------

root_free_for_person="$(df -h | grep "/$" | sed 's/ */:/g' | cut -d : -f 5 )"
home_free_for_person="$(df -h | grep "/home$" | sed 's/ */:/g' | cut -d : -f 5 )"
TEXT=$(echo "$root_free_for_person $home_free_for_person")

#Optional parameter for tooltip
root_total="$(df -h | grep "/$" | sed 's/ */:/g' | cut -d : -f 2 )"
root_used="$(df -h | grep "/$" | sed 's/ */:/g' | cut -d : -f 3 )"
root_free="$(df -h | grep "/$" | sed 's/ */:/g' | cut -d : -f 4 )"
home_total="$(df -h | grep "/home$" | sed 's/ */:/g' | cut -d : -f 2 )"
home_used="$(df -h | grep "/home$" | sed 's/ */:/g' | cut -d : -f 3 )"
home_free="$(df -h | grep "/home$" | sed 's/ */:/g' | cut -d : -f 4 )"
TOOLTIP=$(echo "Root: Total:$root_total Used:$root_used Free:$root_free \n Home: Total:$home_total Used:$home_used Free:$home_free ")

printf '{"text": "%s", "tooltip": "%s"}
' "$TEXT" "$TOOLTIP"
`

"custom/percentage_disks": { "format": " {}", "interval": 30, "exec": "~/.config/waybar/scripts/disk.bash 2> /dev/null", "return-type":"json", "hide-empty-text": true },

How can such a moment be implemented using standard waybar tools?
I've tried it
"path-01": "/",
"path-02": "/home",

  • it didn't help

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions