diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 53b5df2..6dfa3e5 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -93,6 +93,25 @@ spacer = widget({type = "textbox"}) separator = widget({type = "textbox"}) spacer.text = " " separator.text = "|" +-- Execute command and return its output. You probably won't only execute commands with one +-- line of output +function execute_command(command) + local fh = io.popen(command) + local str = "" + for i in fh:lines() do + str = str .. i + end + io.close(fh) + return str +end + +pom = widget({type = "textbox"}) +pom.text = " " .. execute_command("~/src/tpm/tpm") .. " " +pomtimer = timer({ timeout = 1}) +pomtimer:add_signal("timeout", function() + pom.text = " " .. execute_command("~/src/tpm/tpm") .. " " +end) +pomtimer:start() -- {{{ Menu -- Create a laucher widget and a main menu @@ -275,6 +294,7 @@ for s = 1, screen.count() do spacer, separator, spacer, + pom, mytasklist[s], layout = awful.widget.layout.horizontal.rightleft } diff --git a/.tmux.conf b/.tmux.conf index 9fdebc7..c1a5bc5 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -32,7 +32,7 @@ set -g status-fg white set -g status-interval 1 set -g status-left '#[fg=green]#H#[default]' set -g status-left-length 20 -set -g status-right '#[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]' +set -g status-right '#[fg=green]#(~/src/tpm/tpm) #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]' # Notifying if other windows has activities setw -g monitor-activity on