Author Topic: Using feh as the Background Manager, Autostart (SOLVED)  (Read 1927 times)

Offline stricktoo

  • Hero Member
  • *****
  • Posts: 520
  • Linux - it's elementary
Using feh as the Background Manager, Autostart (SOLVED)
« on: July 16, 2010, 01:45:20 AM »
I've disabled PCManFM as the background manager and am experimenting with feh (a versatile command line image viewer) to control my background. However, I can't figure out how to autostart it on login. I currently have this script (feh.sh) in my ~/.config/autostart folder.

Code: [Select]
#!/bin/bash
feh --bg-scale /home/stricktoo/.wallpapers/desktop1.png

However, it doesn't seem to be working. Frankly I'm not surprised, because I know absolutely nothing about writing scripts and I'm sure I've made an error. If somebody could point me in the right direction, I'd much appreciate it.

Also, in my research I've found several walk-throughs that reference a file called ~/.fehbg, which apparently is supposed to store the last background you set with feh. However that file doesn't exist on my system. I do have a .fehrc in my home directory, but it just tells you how to use feh.
« Last Edit: July 16, 2010, 02:39:19 PM by stricktoo »

Online gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3793
Re: Using feh as the Background Manager, Autostart
« Reply #1 on: July 16, 2010, 01:53:21 AM »
This doesn't directly answer your question, but I have this in my ~/.kde4/Autostart/ folder:

Code: [Select]
#!/bin/bash
feh --bg-scale /home/galen/Documents/Galen/st.helens.png
conky -c ~/.conkyrc &
while inotifywait ~/.kde4/share/config/plasma-appletsrc; do
feh --bg-scale /home/galen/Documents/Galen/st.helens.png
done

I got this script as a way to do fake transparency with conky. I am not even sure it was the best way in kde4, but it works, so I use it. I am not sure of the correct autostart location with other desktops.

Galen

Offline stricktoo

  • Hero Member
  • *****
  • Posts: 520
  • Linux - it's elementary
Re: Using feh as the Background Manager, Autostart
« Reply #2 on: July 16, 2010, 02:06:21 PM »
This doesn't directly answer your question, but I have this in my ~/.kde4/Autostart/ folder:

Code: [Select]
#!/bin/bash
feh --bg-scale /home/galen/Documents/Galen/st.helens.png
conky -c ~/.conkyrc &
while inotifywait ~/.kde4/share/config/plasma-appletsrc; do
feh --bg-scale /home/galen/Documents/Galen/st.helens.png
done

I got this script as a way to do fake transparency with conky. I am not even sure it was the best way in kde4, but it works, so I use it. I am not sure of the correct autostart location with other desktops.

Galen

I replaced my script with this part of yours:

Code: [Select]
#!/bin/bash
feh --bg-scale /home/stricktoo/.wallpapers/wallpaper1.png
conky -c ~/.conkyrc &
done

However, it still doesn't work. I've placed it in ~/.config/autostart, which is the correct location. I know because other applications I've placed in there start correctly. Maybe I've named it incorrectly? It's called feh.sh. And I've made it executable. It works when I manually double-click on it.

Although I have noticed something odd. I currently have three other programs in the autostart directory: tint2 panel, parcellite (a clipboard application) and dropbox. When feh.sh isn't in the directory, they all work fine. However, when I place it in the directory only tint2 autostarts (as does Network Manager, but I don't think the user has control over it). I'm not sure how relevant this is, but it does point to something odd, like a flaw with the script or a bug in LXDE that prevents proper handing of auto-initiating scripts at login.

EDIT:

I tried removing feh from the script and leaving only the conky part.

Code: [Select]
#!/bin/bash
conky -c ~/.conkyrc &
done

The result was the same: no conky, and no autostarting applications beside tint2 and Network manager. The problem likely isn't with feh, then. Maybe LXDE isn't handling scripts correctly?
« Last Edit: July 16, 2010, 02:10:59 PM by stricktoo »

Offline parnote

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 4438
  • The truth is out there ... PCLinuxOS!
Re: Using feh as the Background Manager, Autostart
« Reply #3 on: July 16, 2010, 02:28:38 PM »
Stricktoo,

LXDE only recognizes *.desktop files in the Autostart folder. I would place feh.sh in /usr/bin, then modify the .desktop file for Leafpad to point instead to feh.sh, rename it to feh.desktop, and place it in your Autostart folder. THEN feh should start when LXDE starts.

parnote
PCLinuxOS Magazine Chief Editor

Linux Registered User #485009

In a world without walls, who needs Windows?

PCLinuxOS Wiki: Contribute tips/tricks/how-to's!

Online gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3793
Re: Using feh as the Background Manager, Autostart
« Reply #4 on: July 16, 2010, 02:37:26 PM »
Hey, aren't you the xfce guy?! ;D

Thanks, good information, Parnote!

Galen

Offline stricktoo

  • Hero Member
  • *****
  • Posts: 520
  • Linux - it's elementary
Re: Using feh as the Background Manager, Autostart
« Reply #5 on: July 16, 2010, 02:39:04 PM »
Stricktoo,

LXDE only recognizes *.desktop files in the Autostart folder. I would place feh.sh in /usr/bin, then modify the .desktop file for Leafpad to point instead to feh.sh, rename it to feh.desktop, and place it in your Autostart folder. THEN feh should start when LXDE starts.

parnote

Paul;

Worked like a charm (although I put the script in my own home directory instead of /usr/bin). Thanks!

Offline parnote

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 4438
  • The truth is out there ... PCLinuxOS!
Re: Using feh as the Background Manager, Autostart (SOLVED)
« Reply #6 on: July 16, 2010, 02:43:35 PM »
gseaman,

I learned this one the hard way. I just installed PCLXDE on one of my laptops, to prepare for a series of articles for the mag on LXDE, much as we've done/are doing for KDE 4 and Xfce. I noticed that neither my links, nor my bash scripts, in the $HOME/.config/Autostart folder under LXDE were doing anything, while all the other "things" there were .desktop files.

It sure would be nice if links and bash scripts worked in LXDE's autostart folder, since my links were only 14 bytes in size, hence a lot smaller than the .desktop files placed there.

parnote
PCLinuxOS Magazine Chief Editor

Linux Registered User #485009

In a world without walls, who needs Windows?

PCLinuxOS Wiki: Contribute tips/tricks/how-to's!