X11環境でフルスクリーン状態でも時計を表示

macOSでフルスクリーン状態でもその上に時計を表示するアプリを知りました.昔Linux X11環境でも同じようなことをしていたなと掘り出してみました.

No more hovering just for time checking.

X11ではdzen2という汎用メッセージング及び通知アプリです.

Debian環境ではパッケージがあるのでaptコマンドなどで簡単に導入できます,

$ sudo apt install dzen2

そして例えば以下のようにして右上の辺りに時計を表示できます.

dzen2_x=$((`xrandr | grep \* | cut -f1 -dx` - 100 ))
while :; do
    date +"%H:%M:%S"
    sleep 1
done | dzen2 -p 1 -x ${dzen2_x} -y 12 -fn '12' -bg '#000000' -fg '#FFFFFF'

この状態でFirefoxやmpvでフルスクリーン表示してもその上にdzen2が表示され時計が確認できます.

最近はWaylandが規定値の環境が多いですがその場合は使えないと思います.
デスクトップ環境は$XDG_SESSION_TYPEなどで確認できます.

X11の場合
$ echo $XDG_SESSION_TYPE
x11
Waylandの場合
$ echo $XDG_SESSION_TYPE
wayland
環境
$ dpkg-query -W dzen2 x11-xserver-utils
dzen2   0.9.5+git20130923.488ab66-1
x11-xserver-utils       7.7+11
$ lsb_release -dr
Description:    Debian GNU/Linux 13 (trixie)
Release:        13
$ arch
x86_64

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)