sync notes(auto)
This commit is contained in:
parent
caa1994347
commit
74a811beaa
1 changed files with 11 additions and 0 deletions
11
content/20240318201835 ログインしたら自動的にDISPLAY変数を設定したい.md
Normal file
11
content/20240318201835 ログインしたら自動的にDISPLAY変数を設定したい.md
Normal 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を追加してある。
|
Loading…
Reference in a new issue