2

So I've seen plenty of displays of transparent logs or running logs or htop instances on what appear to be fixed areas of a desktop. I think this is something like root-tail but I can't get root-tail to work. This makes me suspect that either it's being done another way or the issue is trivial if you know how to fix it. Either could be the case.

So I tried a few of the examples:

sudo root-tail -g 800x250+100+50 /var/log/syslog,green

Example above shows no errors but also no display.

user@machine:/home/user/scripts# sudo root-tail -g 800x250+100+50 -font fixed /var/log/syslog,green /var/log/auth.log,red,'ALERT'
Missing charsets in String to FontSet conversion (ISO8859-2)
Missing charsets in String to FontSet conversion (ISO8859-2)

Nope. Struck out again.

Clues?

3 Answers 3

3

root-tail is doing exactly what you want, but there is another window in the way. This is briefly discussed in the BUGS section of root-tail's man page.

Most desktops nowadays manage the "root window" with an overlayed window. In LXDE this is done with pcmanfm, in GNOME it was nautilus, and Unity has its own thing. What you want to do is have root-tail output to this overlay.

  1. Open a terminal (xterm, rxvt, gnome-terminal, etc)
  2. Run xwininfo
  3. Your cursor has now changed to a cross-hair. Click on your background.
  4. In the output, note the line that starts with xwininfo: Window id:. You want the following hex number.
  5. Run root-tail as before but add the -id flag with the hex number from the previous step. ie: root-tail -g 800x250+100+50 -id 0x1000003 /var/log/syslog,green

Here is what xwininfo looks like for me (as an LXDE user):

❯ xwininfo 

xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.

xwininfo: Window id: 0x1000003 "pcmanfm"

  Absolute upper-left X:  0
  Absolute upper-left Y:  0
  Relative upper-left X:  0 
  Relative upper-left Y:  0
  Width: 1680
  Height: 1050
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +0+0  -0+0  -0-0  +0-0
  -geometry 1680x1050+0+0

If I kill pcmanfm (and abridge the output) you can see what the root window really is. This is where you're writing when you're not using root-tail's -id flag:

❯ ps xa |grep pcmanfm
13123 ?        Sl     0:00 pcmanfm --desktop --profile lubuntu
14496 pts/0    S+     0:00 grep pcmanfm

❯ kill 13123

❯ xwininfo |grep id: 
xwininfo: Window id: 0x29a (the root window) (has no name)

Note: the window id of your "managed background" will most likely change every session.

1
  • xwininfo -name "Desktop" | grep xwininfo | awk '{ print $4 }'
    – user447607
    May 9, 2017 at 15:31
2

You could use Conky to display logs with a transparent window maybe something like this:

conky.config = {
-- — SETTINGS —
    background = false,
    update_interval = 1,
    cpu_avg_samples = 2,
    net_avg_samples = 2,
    double_buffer = true,
    no_buffers = true,
    text_buffer_size = 2048,
    imlib_cache_size = 0,

-- — WINDOW —
    --own_window_class = 'Conky',
    own_window_argb_visual = true,
    own_window_argb_value=0,
    --own_window_type='dock',
    own_window=true,
    own_window_transparent=true,
    own_window_hints='undecorated,below,sticky,skip_taskbar,skip_pager',

-- — BORDER —
    border_inner_margin = 1,
    border_outer_margin = 1,
    border_width = 1,

-- — SIZE — #
    minimum_width = 1800,
    maximum_width = 1800,
--  default_bar_width = 50, default_bar_height = 15,

-- — ALIGNMENT —
    gap_x = 75,
    gap_y = 450,

-- — GRAPHIC —
    draw_shades = false,
    draw_outline = false,
    draw_borders = false,
    draw_graph_borders = true,
--default_shade_color 
--default_outline_color 909090
--own_window_colour 808080

-- — TEXT —
    use_xft = true,
    font = 'Dejavu Sans:size=10',
    xftalpha = 1.0,
    uppercase = false,
    override_utf8_locale = true,
    default_color = 'white',

-- — LUA —
--lua_load ~/Conky/bgcolor/bg.lua
--lua_draw_hook_pre conky_draw_bg

-- — Colors —
    color1 = '#C18C24',

};

conky.text = [[
${color1}${font Dejavu Sans:size=12:condensed:bold}DD-WRT Router Log${font}
#${exec curl ipinfo.io}
----------------------------------${font}${color}
${exec watch -nd | tail -n 15 /var/log/ddwrt/ddwrt.log | sort -r}
]];

Will display something like this:

Screenshot

0

A program like htop is a custom program developed in C language. It uses the ncurses library which allows the program to manage its output in a terminal, some sort of pseudo GUI. To get the same effect, a program needs to be written using ncurses.

3
  • Fair enough but how would you get it to display in the root XWindow? That's what root-tail does.
    – user447607
    Apr 4, 2015 at 2:03
  • I tried root-tail but, as you mentioned, there is no output in the root window. There may be some difficulties in writing to the root window. There are two solutions, both requiring considerable development work. First, develop an application in GTK+, that takes a file name and displays it in a window, continuously. Second, develop a program in ncurses to display file periodically in a terminal window. The first one is relatively simpler.
    – kjohri
    Apr 4, 2015 at 2:57
  • Perhaps what I need is a screen widget of some sort, then?
    – user447607
    Apr 4, 2015 at 14:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .