0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ubuntuでipアドレスをメッセージボックス表示する方法

Posted at

結論

コード

$ zenity --info --text=$(hostname -I) &

結果
image.png

解説

Zenityコマンドは、簡単なポップアップを表示するための機能でUbuntuに標準で備わっています。
Hostnameを呼び出し、その結果を引数に渡しています。

Zenityの例
image.png

Hostnameの例

$ hostname -I
xxx.xxx.xxx.xxx

以上となります。
今回はちょっと薄味でした。
特に詳しく解説することが無いので...

おまけ程度に

--title="hogehoge"

とするとタイトルつけられたり、とか

参考にしたサイト

https://moomindani.wordpress.com/2014/09/17/linux-command-ip-address/
https://unix.stackexchange.com/questions/144924/how-can-i-create-a-message-box-from-the-command-line

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?