2021 Feb. 26.
サブディレクトリの画像も含め、デスクトップの最前面ウインドウにランダムにスライドショー表示するスクリプト
https://bitbucket.org/arsmus/shell-script-public/src/master/image/slideshow-random-on-top.sh
デスクトップの最前面は表示前のウインドウにしたままで、サブディレクトリの画像も含めランダムにスライドショー表示するスクリプト
https://bitbucket.org/arsmus/shell-script-public/src/master/image/slideshow-random-not-top.sh
デスクトップの最前面は表示前のウインドウにしたままで、サブディレクトリの画像も含め順次表示するスクリプト
https://bitbucket.org/arsmus/shell-script-public/src/master/image/slideshow-sequencial.sh
シェルスクリプト内で、コマンドの終了を待たず次のコマンドを実行するにはバックグラウンドに回す
2021 Feb. 25.
2021 Feb. 23.
シェルスクリプト内で、処理がいったん止まる/時間がかかるコマンド(commandA)の終了を待たず次のコマンドを実行するには、commandAをバックグラウンド実行させる。
display Image.jpg & cp File1 File2
sleepコマンドには小数値を与えることができる
2021 Feb. 23.
出典 【linux】sleepコマンドの使用例と注意点を解説 | 金融エンジニア
100ミリ秒休止する
$ sleep 0.1
googleドライブを同期するocamlfuseをインストール
2021 Feb. 27.
2021 Feb. 23.
出典 Ubuntu20.04でGoogleドライブを同期させたので手順を書く | 非IT企業に勤める中年サラリーマンのIT日記
パッケージインストール
$ sudo add-apt-repository ppa:alessandro-strada/ppa $ sudo apt update $ sudo apt install google-drive-ocamlfuse
Googleアカウント認証
認証開始
$ google-drive-ocamlfuse
PC起動時の自動マウントをsystemdに一般ユーザーとして設定
一般ユーザーのコマンドパス設定
$ mkdir ~/bin
~/.profile にPATH設定を記述
if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi
googleドライブをマウントするシェルスクリプト ~/bin/mount_ocamlfuse.sh を作成
次のサイトに掲載された内容で ~/bin/mount_ocamlfuse.sh を作成する
https://bitbucket.org/arsmus/shell-script-public/src/master/linux-utility/mount_ocamlfuse.sh
( mount_ocamlfuse.sh )
#!/bin/bash # 2021 Feb. 26. # mount ocamlfuse on start. Cmd=${0##*/} ################ ### function ### ################ function usage() { cat << EOS Error. Illegal number of arguements. Usage: $Cmd GOOGLE/DRIVE/DIR/FOR/OCAMLFUSE EOS } ################ ##### main ##### ################ # check arguement if [ $# -ne 1 ]; then usage exit 1 fi OcamlfuseDir="$1" OcamlfuseDir="${OcamlfuseDir%/}" if [ ! -d "$OcamlfuseDir" ]; then echo "$OcamlfuseDir does not exist." 1>&2 usage exit 1 fi google-drive-ocamlfuse "$OcamlfuseDir" exit 0
mount_ocamlfuse.shに実行属性を付与
$ chmod 700 ~/bin/mount_ocamlfuse.sh
systemd設定ファイル作成
$ mkdir -p ~/.config/systemd/user
~/.config/systemd/user/mount_ocamlfuse.service を次の内容で作成する。
[Unit] Description=Mount ocamlfuse-dir on google-drive [Service] Type=oneshot ExecStart=/home/USER/bin/mount_ocamlfuse.sh /home/USER/YOUR/OCAMLFUSE/DIR RemainAfterExit=yes [Install] WantedBy=default.target
systemd設定の有効化
$ systemctl --user enable mount_ocamlfuse $ sudo reboot
systemd一般ユーザー設定参考サイト
サーバー起動時に非rootユーザーでsystemdを使ってサービスを立ち上げる - Qiita
systemd/ユーザー - ArchWiki
systemdでユーザー固有のunitを動かす - φ(・・*)ゞ ウーン カーネルとか弄ったりのメモ
aptリポジトリの追加と削除
2021 Feb. 23.
出典 【Ubuntu】PPAを追加・削除する方法について | Hbk project
リポジトリ追加
## 書式 $ sudo apt-add-repository ppa:[user]/[ppa-name] ## webupd8リポジトリ追加の例 $ sudo add-apt-repository ppa:nilarimogard/webupd8
リポジトリ削除
## 書式 $ sudo add-apt-repository --remove ppa:[user]/[ppa-name] ## webupd8リポジトリ削除の例 $ sudo add-apt-repository --remove ppa:nilarimogard/webupd8