How to run 'feh' in the background of a script?

joe at actionline.com joe at actionline.com
Tue Oct 2 11:27:25 MST 2012


Thanks Matt.

I like to use 'feh' rather than 'display' because 'feh -x -g' gives
a borderless image with no title bar and with a specified image size.

feh -x -g 400x400 & kwrite textfile.txt <ENTER> (this worked)

Is there also a way to execute both parts so that when I quit/close
the text file, the image also closes rather than having to close it
separately?


----------
Matt wrote:
> Something like this:
>
> #!/bin/bash
> display image.jpg &
> kwrite textfile.txt
> # end of script
>
> ...in bash, putting an & at the end of a line tells the shell "run this
> process in the background".  You can see this working in the old-school
> .xinitrc files that would start various X clients with & before starting
> the window manager without &.
>
> The snippet above will display image.jpg , but when you quit kwrite, the
> script will reach its end and exit.  The background processes that the
> script started will receive a HUP when the script exits.  So when you
> quit kwrite, the display process will get HUPped and exit too.




More information about the PLUG-discuss mailing list