widget - A simple way to show my hostname/ip in Gnome Panel or on my Desktop Background? -
hi searching while how can add app or widget show me output script or command "hostname --fqdn" on gnome panel or on desktop background... conky that, think simple shell output giplet ip , gnome panel , has no packages debian wheezy.
i've many displays around 2000 in bigger area , running application, if application goes down normal desktop on top :) in case nice show hostname/ip adress engineering.
you work out gnome shell extension.
i wrote simple extension out on that.
the extension.js file:
const clutter = imports.gi.clutter; const main = imports.ui.main; const glib = imports.gi.glib; const command = "hostname --fqdn"; const font_size = 48; let stage_bg_color = clutter.color.get_static(clutter.staticcolor.chocolate_dark); let myactor = null; function run_command() { let output = ""; try { output = glib.spawn_command_line_sync(command, null, null, null, null); } catch(e) { throw e; } return output[1] + ""; } function init() { let myactor = new clutter.text(); myactor.set_font_name("sans " + font_size); myactor.set_position(400, 400); myactor.set_background_color(stage_bg_color); myactor.set_text(run_command()); let n_children = main.layoutmanager._backgroundgroup.get_n_children(); main.layoutmanager._backgroundgroup.insert_child_at_index(myactor, n_children); } function enable() { } function disable() { }
the metadata.js file (watch out shell-version):
{"shell-version": ["3.14.4"], "uuid": "cmd_wallpaper@felipeborges.net", "name": "command wallpaper", "description": "it shows output of command on wallpaper"}
save both files in folder inside $home/.local/share/gnome-shell/extensions/. enable it, use gnome-shell-extension-prefs
or download here.