vivien / i3blocks-contrib

Official repository for community contributed blocklets

Home Page:https://github.com/vivien/i3blocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

USB Blocklet unable to print correct device leaf path

aliefamzari opened this issue · comments

At line 98
lines = check_output(['lsblk', '-spndo', 'NAME'], universal_newlines=True)

Expected behavior

lsblk -lpno NAME
/dev/nvme0n1
/dev/nvme0n1p1
/dev/nvme0n1p2
/dev/nvme0n1p3

Actual behavior

lsblk -spndo NAME
/dev/nvme0n1p1
└─/dev/nvme0n1
/dev/nvme0n1p2
└─/dev/nvme0n1
/dev/nvme0n1p3
└─/dev/nvme0n1

i3blocks config relevant to blocklet(s)

USB

Output of blocklet(s) when run from command line

./usb
Unknown device "/dev/└─/dev/nvme0n1": No such file or directory
Traceback (most recent call last):
File "/home/alif/.config/i3blocks/usb/./usb", line 361, in
attributeMaps = getAttributeMaps(leaves)
File "/home/alif/.config/i3blocks/usb/./usb", line 263, in getAttributeMaps
return {path : makeAttributeMap(path) for path in paths}
File "/home/alif/.config/i3blocks/usb/./usb", line 263, in
return {path : makeAttributeMap(path) for path in paths}
File "/home/alif/.config/i3blocks/usb/./usb", line 252, in makeAttributeMap
lines = check_output(
File "/usr/lib/python3.9/subprocess.py", line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.9/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['udevadm', 'info', '--query=property', '--name=└─/dev/nvme0n1']' returned non-zero exit status 1.

Output of any relevant other commands that might help diagnostics

``

Resolved