[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
panel.sh modification suggestion (faster (once a second) clock update)
- To: "herbstluftwm _minus_ devel _at_ lists _dot_ sourceforge _dot_ net" <herbstluftwm _minus_ devel _at_ lists _dot_ sourceforge _dot_ net>
- Subject: panel.sh modification suggestion (faster (once a second) clock update)
- From: Raf Cloesen <rafcloesen _at_ yahoo _dot_ com>
- Date: Mon, 1 Apr 2013 23:08:56 -0700 (PDT)
Hi, I would like to start by stating that I actualy don't know much about bash scripting (my first experience comes from the past little over a week, studying panel.sh, and writing custom scripts to configure herbstluftwm). I therefore do not know if my suggestion is ideal. Here it goes:
I recently installed herbstluftwm, and I am absolutely delighted. I have delighted configuring this program. From the start, yet, I was somewat disappointed by the fact that the clock would take so long (a little over a minute on my sistem. Does somebody want the details of the sistem?) in updating. Initially it will not show until that time passed.
In my study of panel.sh, I have learnd that the clock will be updated in response to the correct hook (date [argument]) being send to the herbstluftwm. I have at this time not yet discovered where this hook is triggered (maybe it isn't?). Yet, based on this knowledge, I changed the following line (number 52 in the original panel.sh. Here the change stated as it would be if applied to the original panel.sh):
date +'date ^fg(#efefef)%H:%M^fg(#909090), %Y-%m-^fg(#efefef)%d'
to:
herbstclient emit_hook $(date +'date ^fg(#efefef)%H:%M^fg(#909090), %Y-%m-^fg(#efefef)%d')
Of course, given this formating of the time, no diference will be noticable (exept for the initial lack of clock for about a minute). In my configuration (showing seconds), this does make a considerable diference. A side effect worth mentioning is the fact that (given enough of the original panel.sh remains in your custom version) the hole panel will update every one second. So other data (like battery state provided by 'acpi --battery' in my custom panel.sh) will update every second too.
If you do not care about speeding up the update proces, yet would like the clock showing up at once at login, or 'herbstclient reload'... changing the line (in the original panel.sh it is the following (line number 61)):
date=""
to:
$(date +'date ^fg(#efefef)%H:%M^fg(#909090), %Y-%m-^fg(#efefef)%d')
will make the clock appear at once, but still update slowely.