labunix's blog

labunixのラボUnix

「mate-terminal」の背景を透過する。

■「mate-terminal」の背景を透過する。
 今回はstretch。クリーンインストールの機会が少なかったので5年ぶりにGUIの設定変更。。。
 おおまかには以下とほぼ同様。

 Squeezeのgnome-terminalをxcompmgrで「背景の透過」
 http://labunix.hateblo.jp/entry/20130504/1367672082

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.4 (stretch)
Release:	9.4
Codename:	stretch

$ sudo tasksel --list-tasks | grep mate
i mate-desktop	MATE

■透過用の「xcompmgr」を導入する。

$ apt-cache search xcompmgr
xcompmgr - X 合成マネージャ
cairo-clock - Analog clock drawn with vector-graphics
compton - compositor for X11, based on xcompmgr

$ sudo apt-get install -y xcompmgr

■自動起動の設定
 「mate-session-properties」で起動して設定するか、
 以下スクリプトで設定する。

$ echo '[Desktop Entry]
Type=Application
Exec=xcompmgr -n
Hidden=false
X-GNOME-Autostart-enabled=true
Name[ja_JP]=背景の透過
Name=背景の透過
Comment[ja_JP]=背景の透過
Comment=背景の透過
' | tee ~/.config/autostart/xcompmgr.desktop

■Xを再起動して有効化
 ※作業を終了してXからログオフし、[Alt]+[F2]等でコンソールから以下を入力。
 Xが復帰すると、[Alt]+[F8]でGUIにログイン出来る。

$ sudo pkill -HUP X

 ※面倒だったら、システムの再起動でも良い。

 man mate-session | grep -A 3 "FILES\|autostart=" | sed -e 's/,/\n\t\t/'
       -a
		 --autostart=DIR
              Start all applications defined in "DIR"
		 instead of starting the applications defined in /org/mate/desktop/session/default-session
              Multiple --autostart options can be passed.

--
FILES
       ~/.config/autostart
       /usr/share/autostart
       /usr/share/mate/autostart

■以下を実行した後、他のユーザを追加してみたところ、きちんと反映された。

$ sudo mkdir -p /usr/share/mate/autostart
$ sudo cp .config/autostart/xcompmgr.desktop /usr/share/mate/autostart
$ ls -l /usr/share/mate/autostart/xcompmgr.desktop 
-rw-r--r-- 1 root root 158  51 02:18 /usr/share/mate/autostart/xcompmgr.desktop