[SOLVED] customizing the statusbar dwmblock (DWM - Tiling Window Manager)
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
#!/bin/bash
if [[ "$(udisksctl dump|awk -F':\n' -vRS= '/[ \t]*HintAuto:[ \t]*true/&&/\.Filesystem:/{print "found"}')" != "" ]]; then
icon=" "
else
icon=""
fi
printf "%s%s\\n" "$icon"
one more thing my DWM build tends to freeze my laptop randomly like im here typing this sentence and suddenly my laptop is frozen or im just browing the internet and scrolling and it freezes it has happened 3 4 times now i had to hard reboot by long pressing power button. any ideas why? or way to debug this issue?
also i want to enable tap to touch and natural scrolling for my touchpad right now i can do this with
for tap to click
Code:
xinput set-prop 11 300 1
and for natural scrolling
Code:
xinput set-prop 11 308 1
so i just put it in my `autostart.sh` or is there a better way to do it?
doesn't show anything, i only want it to shows "Device Connected - (name of the device)" when a device is a connected else it shows "No Device Connected", but click action doesn't seems to work it doesn't even show a blank notification. left and right click works.
this is the full script
Code:
#!/bin/bash
case $BLOCK_BUTTON in
1) setsid -f blueman-manager ;;
2) notify-send "Device Connected" "$(if [[ "$(bluetoothctl info)" != "Missing device address argument" ]]; then
echo= "$(bluetoothctl info | grep "Name" | awk '{print $2}')"
else
echo= "No Device Connected" )" ;;
3) notify-send "Bluetooth" "\- Show Bluetooth Status.
- Click to open Bluetooth Manager.
- Middle click to show Connected Devices." ;;
esac
if [[ "$(bluetoothctl info)" != "Missing device address argument" ]]; then
icon=" "
else
icon=" "
fi
printf "%s%s\\n" "$icon"
yes, i actually learned about logical operators yesterday.
i was writing another script yesterday for internet that shows me a wifi icon if its connected and/or ethernet icon if its connected.
Code:
if [[ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" == "up" || "$(cat /sys/class/net/e*/operstate 2>/dev/null)" == "up" ]]; then
icon=" 📶 "
else
icon=" 🌐 "
fi
printf "%s%s\n" "$icon"
the script works, but it always show the wifi icon even if i have ethernet connected. and i also want to show " ❎ " this icon when nothing connected. but couldn't figure out how.
yes, i actually learned about logical operators yesterday.
i was writing another script yesterday for internet that shows me a wifi icon if its connected and/or ethernet icon if its connected.
Code:
if [[ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" == "up" || "$(cat /sys/class/net/e*/operstate 2>/dev/null)" == "up" ]]; then
icon=" �� "
else
icon=" �� "
fi
printf "%s%s\n" "$icon"
the script works, but it always show the wifi icon even if i have ethernet connected. and i also want to show " ❎ " this icon when nothing connected. but couldn't figure out how.
ok so i edited the script but its not working now. i tried the link you sent `shellcheck` its says no errors, but when i execute in terminal it fails.
It may have nothing to do with your script, but rather with wttr.in. Here is what I currently get:
Quote:
Sorry, we are running out of queries to the weather service at the moment.
Update. Now, it works again.
Quote:
Originally Posted by apoorv569
Code:
printf "%s%s\\n" "$weather"
I guess just printf "%s\n" "$weather" would be enough. You are quoting the variable $weather anyway, so even if its value includes a space, it will be counted as just one parameter to printf.
It may have nothing to do with your script, but rather with wttr.in. Here is what I currently get:
Update. Now, it works again.
I guess just printf "%s\n" "$weather" would be enough. You are quoting the variable $weather anyway, so even if its value includes a space, it will be counted as just one parameter to printf.
its working, actually the update interval in blocks.h was 18000(5 hrs), i changed it to 1 its showing now. i guess it was not updating because of long interval.
It may have nothing to do with your script, but rather with wttr.in. Here is what I currently get:
Update. Now, it works again.
I guess just printf "%s\n" "$weather" would be enough. You are quoting the variable $weather anyway, so even if its value includes a space, it will be counted as just one parameter to printf.
i edited my weather script as it was continuously using the internet and updating/downloading, so i did this
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.