![KDE 플라즈마 데스크탑이 로드된 후 한 번 실행되는 시스템 서비스](https://linux55.com/image/219836/KDE%20%ED%94%8C%EB%9D%BC%EC%A6%88%EB%A7%88%20%EB%8D%B0%EC%8A%A4%ED%81%AC%ED%83%91%EC%9D%B4%20%EB%A1%9C%EB%93%9C%EB%90%9C%20%ED%9B%84%20%ED%95%9C%20%EB%B2%88%20%EC%8B%A4%ED%96%89%EB%90%98%EB%8A%94%20%EC%8B%9C%EC%8A%A4%ED%85%9C%20%EC%84%9C%EB%B9%84%EC%8A%A4.png)
시스템 색상과 배경 화면을 변경하는 스크립트를 실행하는 systemd 서비스를 만들었습니다. 로그인 후 10분마다 스크립트가 적용되도록 하고 싶습니다.
원칙적으로는 작동하지만 첫 번째 실행에서는 손실됩니다. 스크립트가 호출되지만(로그 파일에 표시됨) 시작 시 호출되면 적용되지 않습니다. 두 번째 실행 시 변경 사항이 적용됩니다. 내 생각엔 데스크톱 세션이 동시에 로드되기 때문인 것 같습니다.
해결 방법으로 첫 번째 실행을 2분 동안 기다립니다. 그런데 로그인하자마자 갖고 싶어요. 데스크톱 세션 대기에 대한 올바른 키워드는 무엇입니까?
/etc/systemd/user/kde_color_switch.timer
[Unit]
Description=Timer for color switch script
After=graphical.target xdg-user-dirs-update #tried this ones
Requires=graphical.target #what is the kde desktop loaded argument?
[Timer]
OnBootSec=0min
OnUnitActiveSec=10min
[Install]
WantedBy=timers.target
/etc/systemd/user/kde_color_switch.service
[Unit]
Description=Switches the kde color by time between light and dark
[Service]
Type=simple
ExecStart=/my_scripts/kde_auto_color_switch.sh
[Install]
WantedBy=default.target
/my_scripts/kde_auto_color_switch.sh의 일부:
if [ $(plasma-apply-colorscheme -l | grep "current color scheme" | grep Dracula | wc -l) -eq 1 ]
then #if dark then switch light
plasma-apply-colorscheme BreezeLight #this line fails the first time
sed -i "s/$imgNight/$imgDay/g" $kdeconfigdir/plasma-org.kde.plasma.desktop-appletsrc
konsole -e kquitapp5 plasmashell && kstart5 plasmashell --windowclass plasmashell --window Desktop >>/dev/null 2>&1
fi
위에서 요청한 대로 플라즈마 데스크탑이 완전히 부팅될 때까지 첫 번째 실행을 기다리고 싶습니다. 그럼 좋겠다플라즈마 적용 색 구성표 BreezeLight효력이 발생합니다.