0
2

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 5 years have passed since last update.

Raspberry Pi起動後にImpressのスライドショーを自動実行させた時のあれやこれや

Last updated at Posted at 2019-11-19

やりたかったこと

Raspberry Pi 3を起動すると下記のコマンドでImpressのスライドショーを自動実行する。

※1

soffice --show /home/pi/Documents/xxxxx.odp

やったこと

rc.local

/etc/rc.localのexitの前に※1を追記

profile

/etc/profileの最終行に※1を追記

systemctl

/etc/systemd/system/start-xxxxx.serviceを作成

[Unit]
Description=launch soffice

[Service]
User=pi
Environment=DISPLAY=:0
ExecStart=soffice --show /home/pi/Documents/xxxxx.odp

[Install]
WantedBy=user@.service

サービスの作成などは、下記を参考にした。
Raspberry Piで、autostartが使えなくなったので、Systemdを使ってchromium-browserを自動起動した
Raspberry Piでプログラムを自動起動する5種類の方法を比較・解説

結果

rc.local

psでは、sofficeが存在するが、画面上ではなにも変化なし。

profile

起動中にLibre Officeのロゴが表示されたままシステム停止。→ セーフモードで立ち上がればよかったかもしれないが、ジャンパーピンがなかったのでraspbianの再インストール。

systemctl

再起動後、Impressが起動し、スライドショーが自動実行された!!!

やらなかったこと

crontab

8時に開始して23時にリブートさせるという方法も考えたが、途中の時間に開始することができないので不採用。

終わりに

以前は、Raspberry Piにはautostartという方法があったようだが、現在はなくなっている。
systemctlは敷居が高い感じがするが、見様見真似でもなんとかなった。

0
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?