sync notes(auto)

This commit is contained in:
Kaz Saita(raspi4) 2024-03-18 20:30:05 +09:00
parent caa1994347
commit 74a811beaa

View file

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