Advertising

Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum Linuxiarze.pl

Author Topic: auto wallpaper switcher  (Read 216 times)

Offline genek

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
auto wallpaper switcher
« on: December 13, 2020, 07:36:40 pm »
Hi
I wanna switch user wallpaper into my picture via network from host 172.16.1.56

I do scritpt /bin/tlo
Quote
#!/bin/bash
sshpass -p password scp uczen@172.16.1.56:rules/tlo.sh /home/uczen
/home/uczen/tlo.sh

tlo.sh
Quote
export DISPLAY=:0.0
pcmanfm-qt --set-wallpaper="/home/uczen/.config/172921.jpg"
touch /home/uczen/t.txt

All work fine (I have some preinstalled pictures in .config directory), but only if I execute in terminal window "tlo"
But doesn't work from
crontab -l
Quote
@reboot sleep 44 && /bin/tlo
neither with file
/home/uczen/.profile ending with
Quote
sleep 44 && /bin/tlo

Any suggestion - WHY?
« Last Edit: December 13, 2020, 07:38:47 pm by genek »

Offline pavroo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2169
  • Karma: 2
    • SparkyLinux
Re: auto wallpaper switcher
« Reply #1 on: December 13, 2020, 08:47:33 pm »
Hi
I don't know what is your desktop, but if you run pacman-qt I guess it is LXQt, so add your script to the LXQt Session Settings-> Autostart instead of the .profile file.
Make sure the script has exec chmod:
Code: [Select]
sudo chmod +x /path/to/yourscript
Nothing is easy as it looks. Danielle Steel
Join #sparkylinux at irc.freenode.net

Offline genek

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: auto wallpaper switcher
« Reply #2 on: December 13, 2020, 11:13:38 pm »
I have chmod 755 on that scripts. It works, when i write commnad manually.
And unfortunatelly, adding it to autostart daesn't help :(

Hi
I don't know what is your desktop, but if you run pacman-qt I guess it is LXQt, so add your script to the LXQt Session Settings-> Autostart instead of the .profile file.
Make sure the script has exec chmod:
Code: [Select]
sudo chmod +x /path/to/yourscript

Offline pavroo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2169
  • Karma: 2
    • SparkyLinux
Re: auto wallpaper switcher
« Reply #3 on: December 14, 2020, 11:55:37 pm »
Try other way.
Remove your file from the LXQt autostart.
Create a your.desktop file in the system's autostart:
Code: [Select]
sudo nano /etc/xdg/autostart/your.desktoppaste into the file:
Code: [Select]
[Desktop Entry]
Encoding=UTF-8
Name=My wallpaper
Exec=/bin/tlo
Terminal=false
Type=Application
Then reboot your OS.
Nothing is easy as it looks. Danielle Steel
Join #sparkylinux at irc.freenode.net