你可以用GNOME Shell擴展來解決這個問題。
我寫了一個簡單的擴展,可能會幫助你。
的extension.js文件:
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() {
}
的metadata.js文件(注意外殼版本):
{"shell-version": ["3.14.4"], "uuid": "[email protected]", "name": "Command wallpaper", "description": "It shows the output of a command on the wallpaper"}
保存內外夾中的文件$ HOME/.local/share/gnome-shell/extensions/。要啓用它,請使用gnome-shell-extension-prefs
或者您可以從here下載它。