serhii.net

In the middle of the desert you can say anything you want

09 Feb 2022

Adding output of a shell script to qtile statusbar

Wanted to show the currently active taskwarrior task (220209-1901 taskwarrior getting currently active task) in my statusbar.

Github had helpful discussion1 that led me to this qtile widget code:

widget.GenPollText(
	update_interval=1,
	func=lambda: subprocess.check_output("path/to/my/get_tasks.sh").decode( "utf-8").strip(),
),

that runs this shell script:

#!/bin/bash

task  rc.verbose=nothing rc.color=off a || true

The || true bit makes sure the return code is 0. Taskwarrior returns 1 if no tasks are shown, in this case - if no task is in progress.

2022-02-09-192544_431x35_scrot.png j

Nel mezzo del deserto posso dire tutto quello che voglio.