Could conky report the login time for the *current* user only too?

Bug #405707 reported by Cesare Tirabassi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Conky
Unknown
Unknown
conky (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

This was originally reported as part of bug #405188.
Conky reports in the variable user_times the login times for all the current system users. It would be nice if it could also keep track in a separate variable (eg. current_user_time) of the login time for the *current* user.

I don' t currently know if that is possible, especially what is it that defines the *current* user?
Is the current user the tty that owns the conky process!?
Anyway, something to look for for 1.7.3.

Related branches

Changed in conky (Ubuntu):
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Vish (vish) wrote :

The problem with user_times variable is , it messes up the conky every time a new terminal is opened, because it reports time's'.
If a new variable is created as current_user_time , it could just report the tty time without the mention of "tty" .

Shall i file this feature request in sourceforge upstream or has it been already been submitted?

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

As I said, how do you define who is the *current user* ?
The only info one can gather inside conky, is the login time for the tty connected to conky's standard input. The attached patch adds support for it (it should work on any posix compliant *nix), note that in coherence with the definition, the variable is called conky_user_time (for a single user stand-alone machine used as a desktop this would be the "current" user time).

Revision history for this message
Cesare Tirabassi (norsetto) wrote :
Revision history for this message
Vish (vish) wrote :

Cesare Tirabassi,
Hi , when can we expect conky 1.7.3[with this variable]? i tried to apply the patch to the current revs and to build a deb , but somehow I keep messing up and had build problems :(

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

Upstream is pretty busy right now with major code refactorings, and the lead devel just got a new job and is moving out to another town, so, I don't think we will see 1.7.3 any time soon.
If you apply the patch above, mind you that there is a bit missing (you have to add the new object in text_object.h).
Also mind you that the patch was against the git tree at the time of writing, if you apply it to the 1.7.2 tarball you might have to do some manual tuning.

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

Now that karmic has been released, I have added the patch to the karmic version in my ppa (https://launchpad.net/%7Enorsetto/%2Barchive), for eventual release into lucid. Can you please check it out?

Changed in conky (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Vish (vish) wrote :

@Cesare Tirabassi:
Hi , I tired the ppa. But, it only works if the conky is started from the terminal.
If I add conky to the startup applications or if i launch conky using launcher scripts , it doesnt work. :(

The launchers i have are "killallconky; conky-q" , and "sleep 15; conky -q" , but when starting conky for none of these or from the startup items , the conky user time is reported.
Also , rather than the user login time , it seems to show the tty time of the terminal. So if i start from the terminal the time starts from the moment i start the conky.

Is there any other way the user time alone can be reported?
How about getting the output from the user_times and displaying only the first time? Isnt that mostly the user login time. [well thats how it works for me]

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

>Hi , I tired the ppa. But, it only works if the conky is started from the terminal.
>If I add conky to the startup applications or if i launch conky using launcher scripts , it doesnt work. :(

Hmmm, what is who telling you once the session is started and what is ps aux | grep conky giving?

>Also , rather than the user login time , it seems to show the tty time of the terminal.

Thats what it is supposed to show.

>So if i start from the terminal the time starts from the moment i start the conky.

No, it shows the elapsed time since that terminal was launched. If you launch conky soon after the terminal is launched then the two times are obviously very close.

>How about getting the output from the user_times and displaying only the first time?
>Isnt that mostly the user login time. [well thats how it works for me]

No, thats a horrible hack, there is no assurance that that would always be the case. Anyway, one can do it himself simply by using lua to strip and display that information only.

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

Also, assuming 1234 is the pid of the conky process, what is ls -l /proc/1234/fd giving for 0, 1 and 2?

Revision history for this message
Vish (vish) wrote :

Hi , The who and the grep revealed the same user .
I noticed the upstream comment. And tried the latest update. conky-all 1.7.2-0ubuntu6~karmic3 , solves this feature request.
Thanks for adding this...

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

conky (1.7.2-0ubuntu6) lucid; urgency=low

  * Change arch to all for transitional package
  * Change source package format to 3.0 (quilt)
  * Reformat all patch headears iaw DEP-3
  * Move deletion of config.{guess, sub} to clean target to avoid FTBFS
    if built twice in a row
  * debian/patches/add_thread_fix_proc.patch:
    add support for $threads and fix $processes on Linux
    commit aad43bea8d3840babb502d939be324ba49c3b74e
  * debian/patches/fix_segfault_leaks_curl.patch:
    fix segfault and memleaks in curl
    commit e292dd5e280aa9c288bc6c2e1143270f5f5a08f4
  * debian/patches/add_current_user.patch (LP: #405707):
    add $user_time: if no argument is given, lists the
    login time for the tty connected to conky's standard input (if any).
    Given a console as an argument it gives the login time for that.
  * debian/patches/fix_mpd_when_stop.patch:
    fix $if_mpd_playing and $mpd_percent when you stop playing a song
    commit 827be3bde828fcf8d7be949168ac4909f6c323a2
    Thanks Sakari Matikka
  * debian/patches/fix_idle_rate_when_not_averaging.patch (LP: #493131):
    fix idle rate equal to 1 instead of 0 when using net_avg_samples=1
    commit b1cbc64f6075e0145edfb919df3e21a210f5328e
  * debian/patches/fix_manpage_width.patch:
    fix man warning: table wider than line width
    commit a14cca6592ec506b1a535be43912b4a72b40f11f
  * debian/patches/add_startup_pause_option.patch:
    add the -p/--pause command line option
    commit 584d05d2ad66edf1f53372382826a2416b50d9da
  * debian/patches/add_extended_cairo_structures.patch
    add creation functions for the cairo_font_extents_t,
    cairo_text_extents_t and cairo_matrix_t structures
    commit 8bd41caa51e080fd3ef28c7cdeee775872cdc1f4
  * debian/patches/fix_manpage_typos.patch
    fix typos in manpage
    commit c8a99a865adbd862bf74c0ca310fda796601fb5f

 -- Cesare Tirabassi <email address hidden> Sun, 27 Dec 2009 23:22:54 +0100

Changed in conky (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.