This is a simple script to change the background of xfce4-terminal to a random image from a directory in a given interval. It can be used to create slideshows in the terminal.
- Clone this repository
- Set the
image_files
variable in thexfce4-term-ss
script to the directory containing the images you want to use - Copy the
xfce4-term-ss
script to a directory in your$PATH
(e.g./usr/local/bin
or~/.local/bin
) - Make the script executable (
chmod +x xfce4-term-ss
) - Add the following code to your
.bashrc
or.zshrc
:
# Run the script to change the Xfce4 Terminal background image
if [ "$(ps -o comm= $PPID)" = "xfce4-terminal" ]; then
pid_file=/tmp/xfce4-term-ss.pid
if ! [ -e $pid_file ] || ! ps -p $(cat $pid_file) > /dev/null 2>&1; then
nohup xfce4-term-ss > /dev/null 2>&1 &
echo $! > $pid_file
fi
fi
The execution is automatically started when you open a new terminal window. The script will change the background image every 60 seconds. You can change the interval in the xfce4-term-ss
script.
The script will also automatically stop when you close the last terminal window.
Note: If you are having issues with the script, try to run it manually in a terminal window to see if there are any errors.à
Note: To force the script to stop, you can run the following command:
kill $(cat /tmp/xfce4-term-ss.pid)
This project is licensed under the MIT License
- xfce4-terminal - The terminal emulator used