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

コメントを残す

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

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.