Giter Club home page Giter Club logo

dwm-bar's Issues

dwm_mpd? :)

not a pro at shell scripting :) but I am eager for the dwm_mpd function, any chance it will come out anytime soon?

status bar is not showing

after applying the dwm barpadding patch status has been hidden but dwm-bar.sh is running but showing on the bar

dwm-bar

Missing network traffic and sensors features

Hello, thank you for the work on this.
I have been searching for a module available about network traffics (download/upload) but cannot find it also how can I show CPU temperature (like from libsensors).

binclock script

I am trying to add binclock script to dwm-bar.

`#!/usr/bin/python3

'''
binclock
binclock outputs the current time in binary clock format using unicode braille
characters.
Created Aug 2015 by cbarox
'''

import datetime

_BRAILLE_ZERO = 0x2800

maps bit to the value for braille

_BRAILLE_MAP1 = [0x40, 0x04, 0x02, 0x01]
_BRAILLE_MAP2 = [0x80, 0x20, 0x10, 0x08]

converts a 2 digit number to binary clock form

def num2clock(num):
d1, d2 = int(num / 10), int(num % 10)
brl = _BRAILLE_ZERO
for i in range(4):
if (d1 & (2i)):
brl |= _BRAILLE_MAP1[i]
if (d2 & (2
i)):
brl |= _BRAILLE_MAP2[i]
return brl

result = ""
now = datetime.datetime.now()
t = [now.hour, now.minute, now.second]
for i in t:
result += chr(num2clock(i))
print(result)`

I get an error about BRAILLE.

Any tips most welcome.

Weather service wttr.in ran out of requests ...

The weather service wttr.in ran out of requests just now (for today).

Sorry, we processed more than 1M requests today and we ran out of our datasource capacity.
We hope to solve the problem as soon as possible, so you can enjoy
your favourite weather service 24x365 even if it rains or snows.

We will solve the problem as soon as possible.
follow @igor_chubin for the updates. 

You might want to remind people to slow down requests a bit, or add some reminds in README, if they meet unexpected problems on the weather module.

weird text error in cmus plugin

this only happens on specific artists for some reason, but it shows the word "tag artistsort", the artists name twice, then the title track and everything else.

Screenshot from 2021-04-24 11-03-19

Big CPU consumption

Including some modules, like dwm_data.sh or dwm_battery.sh results in big CPU consumption(stable 20%) leading to fast battery discharging. Maybe something wrong with my setup.

OS: Gentoo/Linux

/etc/X11/Sessions/dwm (managed by Gentoo)

DIR=${HOME}/.dwm
if [ -f "${DIR}"/dwmrc ]; then
	/bin/sh "${DIR}"/dwmrc &
else
	while true; do
		xsetroot -name "`date`"
		sleep 1
	done &
fi
exec /usr/bin/dwm

It's crucial here, that default Gentoo's script(which is used while there's no ~/.dwm/dwmrc) uses same command date and doesn't consume CPU).
~/.dwm/dwmrc is symlink to ~/Projects/dwm-bar/dwm-bar.sh and its content:
Just default dwm-bar.sh with enabled dwm-alsa.sh and dwm-keyboard.sh and commented parallelize function. As was mentioned above, enabling some essential modules like dwm_data.sh results in big CPU consumption.

#!/bin/sh

# A modular status bar for dwm
# Joe Standring <[email protected]>
# GNU GPLv3

# Dependencies: xorg-xsetroot

# Import functions with "$include /route/to/module"
# It is recommended that you place functions in the subdirectory ./bar-functions and use: . "$DIR/bar-functions/dwm_example.sh"

# Store the directory the script is running from
LOC=$(readlink -f "$0")
DIR=$(dirname "$LOC")

echo $LOC
echo $DIR

# Change the appearance of the module identifier. if this is set to "unicode", then symbols will be used as identifiers instead of text. E.g. [๐Ÿ“ช 0] instead of [MAIL 0].
# Requires a font with adequate unicode character support
export IDENTIFIER="unicode"

# Change the charachter(s) used to seperate modules. If two are used, they will be placed at the start and end.
export SEP1="["
export SEP2="]"

# Import the modules
#. "$DIR/bar-functions/dwm_alarm.sh"
. "$DIR/bar-functions/dwm_alsa.sh"
#. "$DIR/bar-functions/dwm_backlight.sh"
#. "$DIR/bar-functions/dwm_battery.sh"
#. "$DIR/bar-functions/dwm_ccurse.sh"
#. "$DIR/bar-functions/dwm_cmus.sh"
#. "$DIR/bar-functions/dwm_connman.sh"
#. "$DIR/bar-functions/dwm_countdown.sh"
#. "$DIR/bar-functions/dwm_currency.sh"
#. "$DIR/bar-functions/dwm_date.sh"
. "$DIR/bar-functions/dwm_keyboard.sh"
#. "$DIR/bar-functions/dwm_loadavg.sh"
#. "$DIR/bar-functions/dwm_mail.sh"
#. "$DIR/bar-functions/dwm_mpc.sh"
#. "$DIR/bar-functions/dwm_networkmanager.sh"
#. "$DIR/bar-functions/dwm_pulse.sh"
#. "$DIR/bar-functions/dwm_resources.sh"
#. "$DIR/bar-functions/dwm_spotify.sh"
#. "$DIR/bar-functions/dwm_transmission.sh"
#. "$DIR/bar-functions/dwm_vpn.sh"
#. "$DIR/bar-functions/dwm_weather.sh"

# parallelize() {
#     while true
#     do
#         printf "Running parallel processes\n"
#         #dwm_networkmanager &
#         #dwm_weather &
#         sleep 5
#     done
# }
# parallelize &

# Update dwm status bar every second
while true
do
    # Append results of each func one by one to the upperbar string
    upperbar=""
    #upperbar="$upperbar$(dwm_alarm)"
    upperbar="$upperbar$(dwm_alsa)"
    #upperbar="$upperbar$(dwm_backlight)"
    #upperbar="$upperbar$(dwm_battery)"
    #upperbar="$upperbar$(dwm_ccurse)"
    #upperbar="$upperbar$(dwm_cmus)"
    #upperbar="$upperbar$(dwm_connman)"
    #upperbar="$upperbar$(dwm_countdown)"
    #upperbar="$upperbar$(dwm_currency)"
    #upperbar="$upperbar$(dwm_date)"
    upperbar="$upperbar$(dwm_keyboard)"
    #upperbar="$upperbar$(dwm_loadavg)"
    #upperbar="$upperbar$(dwm_mail)"
    #upperbar="$upperbar$(dwm_mpc)"
    #upperbar="$upperbar$(dwm_pulse)"
    #upperbar="$upperbar$(dwm_resources)"
    #upperbar="$upperbar$(dwm_spotify)"
    #upperbar="$upperbar$(dwm_transmission)"
    #upperbar="$upperbar$(dwm_vpn)"
    #upperbar="$upperbar${__DWM_BAR_NETWORKMANAGER__}"
    #upperbar="$upperbar${__DWM_BAR_WEATHER__}"
   
    # Append results of each func one by one to the lowerbar string
    lowerbar=""
    
    xsetroot -name "$upperbar"
    # Uncomment the line below to enable the lowerbar 
    #xsetroot -name "$upperbar;$lowerbar"
    sleep 1
done

Typo

In the CONTRIBUTING.md file, it says prokect instead of project.

Crash in Ubuntu20.04

Hi! I'm new to dwm and have a problem in running dwm-bar. What I did:

  1. Install dwm using apt
  2. log out gnome and log in dwm
  3. run ./dwm_bar.sh

Then, it just crashed and took me back to the login screen. How to solve it? Cheers!

Parallelizing non-local processes

Parallelizing internet related tasks

I'm opening this issue because i wanted to make a pull request, with some change to the code, in order to improve this bar that is amazing.

Why an issue

Well, if you don't have a powerful connection, that's my case, you might have noticed that when getting weather forecast, as an example, the bar stops working, and all the real time data,such as battery percentage or time, that i need become useless.

How to solve this

I solved it on my machine, by creating a separation in modules:

  • Local modules : All that modules that work in your local area network, such as date, battery, solar panels,backlight,audio,resources...
  • Non-local modules : All that modules that make use of the world area network, such as weather forecast, external ip...

As a solution i would not use local variable for non-local modules, but environment variables named as follows: __DWM_BAR_XXXXX_MODULE__

And here is the weather module code: (Note that 2 lines only has changed:

      LOCATION=Modica

      printf "%s" "$SEP1"
      if [ "$IDENTIFIER" = "unicode" ]; then
>>        export __DWM_BAR_WEATHER_MODULE__="${SEP1} $(curl -s wttr.in/$LOCAT
  ION?format=1) ${SEP2}"
      #   printf "%s" "$(curl -s wttr.in/$LOCATION?format=1)"
      else
>>        export __DWM_BAR_WEATHER_MODULE__="${SEP1}WEA $(curl -s wttr.in/$LO
  CATION?format=1 | grep -o "[0-9].*") ${SEP2}"
      #   printf "WEA %s" "$(curl -s wttr.in/$LOCATION?format=1 | grep -o "[0
  -9].*")"
      fi
  }

  dwm_weather

While in the dwm_bar.sh i would add a function named parallelize() that calls the non-local modules, note that this runs on background so it doesn't stops the other local modules which are running.
Now i describe its behaviour, at the first time, if the DWM_BAR_WEATHER_MODULE has not been set, it simply returns an error and doesn't add it to the bar, but when it finishes fetching it, then it will update the environment variable and the next second it will show up in the bar.

parallelize() {
        while true
        do
                dwm_weather
        done
}

# call to parallelize
parallelize &


# Update dwm status bar every second
while true
do

    # Append results of each func one by one to a string
    dispstr=""
    dispstr="$dispstr$(dwm_resources)"
    dispstr="$dispstr$(dwm_battery)"
    dispstr="$dispstr$(dwm_backlight)"
    dispstr="$dispstr$(dwm_pulse)"
    dispstr="$dispstr${__DWM_BAR_WEATHER_MODULE__}"
    dispstr="$dispstr$(dwm_date)"

    xsetroot -name "$dispstr"
    sleep 1

done

Conclusion

By applying this to all modules we can achieve real-time status bar without stopping it in case of slow internet connection speed.

Specify the refresh frequency for each plugin

I think some plugins like the resources weather plugins don't need to be updated every second. So I'm writing to request a new feature that sets the refresh rate for each plugin and THANK you for sharing this great job.

how do I show dwm-bar on all my monitors?

Hey there! Great job, btw!

Is there any way I can show dwm-bar on all my monitors, not just the active one?
If I switch static const int statusmon = 'A' to -1, it doesn't show at all...

Thanks a bunch!

Read/write disk speed functions

It would be cool if there was a dwm_disk_io function from /sys/class/block/*/stat. In the form of disk read/write speed. Read is the third and write is the seventh columns.

I tried to write myself, but it didn't work (

Network (using networkmanager function) doesn't update after changing wifi networks

#!/bin/sh

# A modular status bar for dwm
# Joe Standring <[email protected]>
# GNU GPLv3

# Dependencies: xorg-xsetroot

# Import functions with "$include /route/to/module"
# It is recommended that you place functions in the subdirectory ./bar-functions and use: . "$DIR/bar-functions/dwm_example.sh"

# Store the directory the script is running from
LOC=$(readlink -f "$0")
DIR=$(dirname "$LOC")

# Change the appearance of the module identifier. if this is set to "unicode", then symbols will be used as identifiers instead of text. E.g. [๐Ÿ“ช 0] instead of [MAIL 0].
# Requires a font with adequate unicode character support
export IDENTIFIER="unicode"

# Change the charachter(s) used to seperate modules. If two are used, they will be placed at the start and end.
export SEP1=" | "
# export SEP2="]"

# Import the modules
. "$DIR/bar-functions/dwm_countdown.sh"
. "$DIR/bar-functions/dwm_alarm.sh"
. "$DIR/bar-functions/dwm_transmission.sh"
. "$DIR/bar-functions/dwm_cmus.sh"
. "$DIR/bar-functions/dwm_mpc.sh"
. "$DIR/bar-functions/dwm_spotify.sh"
. "$DIR/bar-functions/dwm_resources.sh"
. "$DIR/bar-functions/dwm_battery.sh"
. "$DIR/bar-functions/dwm_mail.sh"
. "$DIR/bar-functions/dwm_backlight.sh"
. "$DIR/bar-functions/dwm_alsa.sh"
. "$DIR/bar-functions/dwm_pulse.sh"
. "$DIR/bar-functions/dwm_weather.sh"
. "$DIR/bar-functions/dwm_vpn.sh"
. "$DIR/bar-functions/dwm_networkmanager.sh"
. "$DIR/bar-functions/dwm_keyboard.sh"
. "$DIR/bar-functions/dwm_ccurse.sh"
. "$DIR/bar-functions/dwm_date.sh"
. "$DIR/bar-functions/dwm_connman.sh"
. "$DIR/bar-functions/dwm_loadavg.sh"
. "$DIR/bar-functions/dwm_currency.sh"

parallelize() {
    while true
    do
        printf "Running parallel processes\n"
        # dwm_weather &
        dwm_networkmanager 
        sleep 10
    done
}
parallelize &

# Update dwm status bar every second
while true
do
    # Append results of each func one by one to the upperbar string
    upperbar=""
    # upperbar="$upperbar$(dwm_connman)"
    # upperbar="$upperbar$(dwm_countdown)"
    # upperbar="$upperbar$(dwm_alarm)"
    # upperbar="$upperbar$(dwm_transmission)"
    # upperbar="$upperbar$(dwm_cmus)"
    # upperbar="$upperbar$(dwm_mpc)"
    # upperbar="$upperbar$(dwm_spotify)"
    # upperbar="$upperbar$(dwm_resources)"
    upperbar="$upperbar$(dwm_battery)"
    # upperbar="$upperbar$(dwm_mail)"
    upperbar="$upperbar$(dwm_backlight)"
    # upperbar="$upperbar$(dwm_alsa)"
    upperbar="$upperbar$(dwm_pulse)"
    # upperbar="$upperbar${__DWM_BAR_WEATHER__}"
    # upperbar="$upperbar$(dwm_vpn)"
    upperbar="$upperbar${__DWM_BAR_NETWORKMANAGER__}"
    # upperbar="$upperbar$(dwm_keyboard)"
    # upperbar="$upperbar$(dwm_ccurse)"
    upperbar="$upperbar$(dwm_date)"
    # upperbar="$upperbar$(dwm_loadavg)"
    # upperbar="$upperbar$(dwm_currency)"
   
    # Append results of each func one by one to the lowerbar string
    lowerbar=""

    
    xsetroot -name "$upperbar"
    
    # Uncomment the line below to enable the lowerbar 
#    xsetroot -name "$upperbar;$lowerbar"
    sleep 0.3
done

That's my current dwm-bar configuration. My problem is the bar displays the network the system was connected to at boot, and if at any point the network changes, dwm-bar does not show that and has to be restarted to show the change.
Currently on Arch-Linux, zen kernel, using dwm 6.2.

dwm bar not showing

when i attempt to start the stock shell script, it doesnt show up on the upperbar. output in the terminal is just "Running parallel processes"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.