Xfce Forum

Sub domains
 

You are not logged in.

#1 2026-10-09 10:40:09

unni
Member
Registered: 2018-01-17
Posts: 27
LinuxFirefox 157.0

[SOLVED]Show terminal window while executing script on shutdown

Hello.

I've set up rclone to automatically sync dropbox on login using the following simple script:

#!/bin/bash
printf "Sync from remote to local dropbox directory\n\n"
rclone sync -v --dropbox-batch-mode sync --transfers 32 dropbox: ~/Documents/dropbox/  
sleep 2

I then run it on startup by creating an entry on applications autostart (on login):

xfce4-terminal --geometry 210x40+0+0 --command=/home/user/sync_from_dropbox.sh

It works splendidly. It syncs and shows the output on terminal for 2 additional seconds, so that I know that it worked.

I would like to do the same on logout, synchronizing from my local dir to dropbox.
I've setup everything in reverse, using another script:

#!/bin/bash
printf "Sync from local dropbox directory to remote\n\n"
rclone sync -v --dropbox-batch-mode sync --transfers 32 ~/Documents/dropbox/ dropbox: 
sleep 2

And also using application autostart (on logout):

xfce4-terminal --geometry 210x40+0+0 --command=/home/user/sync_to_dropbox.sh

But this time the terminal window doesn't show up and the session simply ends.

How can I make the script run on logout, displaying the xfce4-terminal window before logging out effectively?

Thank you

Last edited by unni (2026-10-09 13:30:12)

Offline

#2 2026-10-09 12:50:50

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 12,720
LinuxFirefox 156.0

Re: [SOLVED]Show terminal window while executing script on shutdown

Unfortunately, xfce4-session does not have this level of graceful logout - it basically will kill the X session which will kill any running X app. Here is a thread that talks about a potential workaround.

Another potential option would be to drop the X app output (have it redirect to some sort of log file that you can check) and enable systemd/logind linger to have the process continue though the logout process. Check the log file to see the outcome.


Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2026-10-09 13:29:47

unni
Member
Registered: 2018-01-17
Posts: 27
LinuxFirefox 157.0

Re: [SOLVED]Show terminal window while executing script on shutdown

Thank you for the reply.

I've managed to work around the problem by creating a separate script file that calls the rclone script and then calls xfce4-session-logout.
It looks like this:

#!/bin/bash
xfce4-terminal --geometry 210x40+0+0 --command=/home/user/sync_to_dropbox.sh
xfce4-session-logout

Then I made a .desktop file that calls that script and replaced the logout actions buttons with that .desktop file.

It calls the rclone script before calling the logout dialog box.

It's not a very refined solution but it works for my intended use case.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.012 seconds, 7 queries executed - Memory usage: 534.64 KiB (Peak: 536.05 KiB) ]