531 B
531 B
20240318201835 ログインしたら自動的にDISPLAY変数を設定したい
#tips #x-window
~/.profile
などに、こんな感じで書いておく。
# auto set display to last login
export DISPLAY=`who -um | awk '{print $NF}'| sed s/[\(\)]//g`:0.0
Ref.
- Automatically set DISPLAY Variable ? 現在のlinuxだとIPに () が付いてしまうので、↑はそこを取るsedを追加してある。