customizing the statusbar dwmblock (DWM - Tiling Window Manager)
i need some help with customizing my DWM bar, im using dwmblocks, i want to know the commands to get the specific output to show on my status bar.
what command gives me - 1. CPU USAGE % actual usage not load average, like (9% 99% 100%) no decimal value or text. 2. RAM USAGE % actual ram usage same as cpu without decimal value or text. 3. command for detecting when the webcam is in use and displays 🎥 or something else, only when webcam is being used no text just emoticon or unicode, when not is use nothing shows 4. command for detecting when the microphone is in use and displays 🎙️ or something else same as webcam, only when being used else nothing shows 5. command for detecting when a usb drive is connected and shows a or something, only when a usb device is connected, else nothing shows 6. command for bluetooth that shows always in status bar but changes to when a device is connected to bluetooth 7. command that gets download and upload internet speeds in megabytes per second EDIT : i edited the post and title to add clarification and avoid confusion. |
For #1 and #2 you probably should have a look at info in the /proc pseudo-filesystem, specifically at /proc/stat and /proc/meminfo.
|
Quote:
Post your efforts, and tell us where you're stuck, and what error(s)/message(s) you're getting, and we will be happy to assist. Otherwise, there are MANY bash tutorials you can find with a brief search to help you get started. |
Quote:
Code:
top -bn1 | grep load | awk '{printf "%.2f%%\t\t\n", $(NF-2)}' Code:
free -m | awk 'NR==2{printf "%.2f%%\t\t", $3*100/$2 } for netspeed im using someone else's script i found here but it shows value in kilobits i want in kilobytes and in 9.99% format decimal value with only 2 digits after decimal and for other other stuff like webcam i found this script here i did not put this on my statusbar yet i ran this in the terminal to see what output it gives. so its always visible i guess and changes to rec or off accordingly. which i don't want i want to show only icon when in use no text and hide when not in use. for microphone usb and bluetooth i didn't find anything yet. |
Quote:
You're telling us commands, and what you DON'T want...what steps have you taken to get what you DO want?? Have you read the man pages on the command(s) you posted? Read up on printf and how to modify the output? Done/tried ANYTHING? And you posted links to other scripts...what modifications have you made to change them?? Again, we aren't going to modify other peoples scripts for you, anymore than we would write them for you. You need to show us YOUR efforts. |
Quote:
and im not looking for anyone to write down scripts for me, im looking for the commands that can get the me the specific output that im looking for. i have already edited the OP for much more clarification |
Quote:
**AGAIN** Posting a list of things you looked up somewhere and saying "I want this instead", isn't effort on your part. You're taking something from someone else and asking US to modify it FOR YOU. You have provided no more clarification, as all you've done is re-state your question, and tell us (again) what you don't want...still not seeing where you've attempted to make any changes to what you were given, despite being given hints as to what to look at. **AGAIN** You were told to read the man pages, and directed to scripting tutorials, which are both easy to find. That is where you begin to 'know the steps'. Look at the commands; run them in pieces, and see how you can modify the output; experiment and learn. Don't just hand us things you've found and expect us to do it for you. |
Quote:
for cpu i did Code:
top -bn 1 | awk '/^%Cpu/ {print int($2 + $4 + $6)" %"}' Code:
free -h | awk '/^Mem: /{ print $3 }' for webcam i did Code:
Code:
if [[ "$(bluetoothctl info)" != "Missing device address argument" ]]; then what do you think? |
Quote:
Quote:
|
Quote:
and i want to see either total used ram percentage or used memory in Mib or Gib. not available memory. |
Quote:
Quote:
Quote:
|
Quote:
And regarding what printf does...again, did you try to look this up?? https://www.man7.org/linux/man-pages/man3/printf.3.html https://www.geeksforgeeks.org/printf...with-examples/ |
Quote:
Code:
dmesg -S | tail Code:
dmesg -S | tail | grep "usb-storage" Code:
if [[ "$(dmesg -S | tail | grep "usb-storage")" == "USB Mass Storage device detected"]]; then Code:
./usb: line 3: syntax error in conditional expression: unexpected token `;' for microphone "fuser /dev/snd" does nothing. but "fuser /dev/snd/controlC0" gives me this when mic is not in use Code:
fuser /dev/snd/controlC0 Code:
fuser /dev/snd/controlC0 Code:
fuser /dev/snd/pcmC1D0c |
Quote:
Code:
if dmesg -S|grep -q "USB Mass Storage device detected"; then |
Quote:
Code:
if [[ "$(dmesg -S | tail | grep "usb-storage")" =~ "USB Mass Storage device detected" ]]; then Quote:
|
All times are GMT -5. The time now is 07:20 PM. |