How do I get KDEConnect to autostart in MX 21 Fluxbox  [Solved]

Help for MX Fluxbox
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
User avatar
mowest
Posts: 119
Joined: Mon Jul 06, 2020 4:08 pm

How do I get KDEConnect to autostart in MX 21 Fluxbox

#1 Post by mowest »

I've been using stock MX 21 Fluxbox Edition since the week it was released on my main workstation at work, without changing the Tint2 bar, the dock, the icons, Conky, or wallpaper. The defaults in this release have been so good, I haven't found a reason to change them. I have found KDEConnect useful at home, so I wanted it at work too, but I'm having issues getting KDEConnect to autostart, and I was wondering if someone has been successful in doing this on MX21 Fluxbox.

Here is the command I tried using in:

Code: Select all

~/.fluxbox/startup

# if kdeconnect is installed, start the kdeconnet-indicator
if [ -x /usr/bin/kdeconnect-indicator ]; then
   kdeconnect-indicator &
fi

# I also tried the following variations, all of which failed to get the kdeconnect-indicator in the taskbar.

if [ -x /usr/bin/kdeconnect-indicator ]; then
   kdeconnect-app && kdeconnect-indicator &
fi

if [ -x /usr/bin/kdeconnect-indicator ]; then
   kdeconnect-app && kdeconnect-indicator
fi

# The last one was a disaster without the "&" at the end it prevented Fluxbox from fully loading.
I have KDEConnect working. If I reboot and use ROFI to start kdeconnect-indicator after the system is booted it comes up in the taskbar, I'm just hoping for a solution that would get it running automatically in the taskbar when I login to Fluxbox. I have installed KDEConnect from the MX Testing Repo using the MX Package Installer.
https://discoverfoss.com
Home Desktop = HP Envy - i7 with 16GB - Fedora 38
Home Laptop = HP Pavilion dv4 - AMD Turion II M520 with 4GB - MX-21 Fluxbox
Work Desktop = Acer M11AA - i5-3340s with 8GB - MX-21 Fluxbox

User avatar
Jerry3904
Administrator
Posts: 23044
Joined: Wed Jul 19, 2006 6:13 am

Re: How do I get KDEConnect to autostart in MX 21 Fluxbox

#2 Post by Jerry3904 »

Can't be of any help here I'm afraid, but I AM DELIGHTED that you are using MX-21 Fluxbox and have adopted the tint2 panel! Makes my heart all a-flutter...

:parrot2:
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

User avatar
Jerry3904
Administrator
Posts: 23044
Joined: Wed Jul 19, 2006 6:13 am

Re: How do I get KDEConnect to autostart in MX 21 Fluxbox

#3 Post by Jerry3904 »

Unfortunately, I don't have KDEConnect installed and have never used it, so I'm striking out blindly here:

Did you check preferences or run kdeconnect --help to see if there is a way to start the app minimized?
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

User avatar
ceeslans
Posts: 811
Joined: Sun Apr 14, 2019 3:48 am

Re: How do I get KDEConnect to autostart in MX 21 Fluxbox  [Solved]

#4 Post by ceeslans »

Like Jerry, I dont have any kde components installed, so not really in a position to check it. But since you are able to start the 'kdeconnect-indicator' running with rofi after system boot (and logout/in?), you probably need to add a specific 'sleep' value to startup command.
This may best be written in a small script, something like:

Code: Select all

#!/bin/bash

# if kdeconnect is installed, start the kdeconnect-indicator
if [ -x /usr/bin/kdeconnect-indicator ]; then
   sleep 3s ; bash -c 'kdeconnect-indicator'
fi
(I assume that rofi is using "kdeconnect-indicator" as command to start the application?)

Name the script something like 'kdeconnect-start' - and save it in your path (e.g. ~/bin) and make it executable.
Then call that script by adding a line to ~/.fluxbox/startup :

Code: Select all

# if kdeconnect is installed, start the kdeconnect-indicator
~/bin/kdeconnect-start &
if that works, you can finetune the 'sleep' time, if needed
Sony Vaio VPCF23P (2011), Intel Core i7-2670, 6gb RAM, 240gb SSD, MX-Linux 23 based Fluxbox v/1.3.7+
Lenovo Thinkpad L560 (2016), Intel Core i5-6200, 16gb RAM, 240gb SSD, Devuan Daedalus based Fluxbox v/1.3.7+

User avatar
mowest
Posts: 119
Joined: Mon Jul 06, 2020 4:08 pm

Re: How do I get KDEConnect to autostart in MX 21 Fluxbox

#5 Post by mowest »

Thank you @ceeslans. I got back from our family vacation, and back onto my workstation at work, and was able to try out your suggestion. I did exactly what you suggested, and created the separate bash script in my ~/bin folder, made it executable, and then added the call back to it in the ~/.fluxbox/startup file. I used a sleep 10s command just to be sure that everything had time to start up before calling kdeconnect-indicator. Now I get the kdeconnect icon in my tint2 tray, and it connects to my cell, and everything starts working as expected. Thanks for your help.

One question. What is the benefit of putting the this in a separate bash script verses just putting it directly into the startup file?

Code: Select all

if [ -x /usr/bin/kdeconnect-indicator ]; then
   sleep 10s ; bash -c 'kdeconnect-indicator'
fi
I really appreciate all of the great scripts and ideas you continue to bring to the MX Fluxbox community. Take care.
https://discoverfoss.com
Home Desktop = HP Envy - i7 with 16GB - Fedora 38
Home Laptop = HP Pavilion dv4 - AMD Turion II M520 with 4GB - MX-21 Fluxbox
Work Desktop = Acer M11AA - i5-3340s with 8GB - MX-21 Fluxbox

User avatar
ceeslans
Posts: 811
Joined: Sun Apr 14, 2019 3:48 am

Re: How do I get KDEConnect to autostart in MX 21 Fluxbox

#6 Post by ceeslans »

mowest wrote: Wed Aug 03, 2022 9:00 pm<snip>
One question. What is the benefit of putting the this in a separate bash script verses just putting it directly into the startup file?
<snip>
Because you want the sleep+bash command execution to finish after fluxbox session has actually started (which it will when executing the ~/bin script file).
If you would put the command directly in the startup file, then fluxbox waits for the sleep command to finish first...
Sony Vaio VPCF23P (2011), Intel Core i7-2670, 6gb RAM, 240gb SSD, MX-Linux 23 based Fluxbox v/1.3.7+
Lenovo Thinkpad L560 (2016), Intel Core i5-6200, 16gb RAM, 240gb SSD, Devuan Daedalus based Fluxbox v/1.3.7+

User avatar
mowest
Posts: 119
Joined: Mon Jul 06, 2020 4:08 pm

Re: How do I get KDEConnect to autostart in MX 21 Fluxbox

#7 Post by mowest »

ceeslans wrote: Thu Aug 04, 2022 4:41 am Because you want the sleep+bash command execution to finish after fluxbox session has actually started (which it will when executing the ~/bin script file).
If you would put the command directly in the startup file, then fluxbox waits for the sleep command to finish first...
Ok, thanks for that explanation. That makes sense now that you pointed that out. I'm still rather clueless about bash scripting after all of my years of Linux experience.
https://discoverfoss.com
Home Desktop = HP Envy - i7 with 16GB - Fedora 38
Home Laptop = HP Pavilion dv4 - AMD Turion II M520 with 4GB - MX-21 Fluxbox
Work Desktop = Acer M11AA - i5-3340s with 8GB - MX-21 Fluxbox

User avatar
mowest
Posts: 119
Joined: Mon Jul 06, 2020 4:08 pm

Re: How do I get KDEConnect to autostart in MX 21 Fluxbox

#8 Post by mowest »

@ceeslans I thought your solution was the fix, but I can't get kdeconnect-indicator to start after rebooting. It stopped working after I added a systemd service to set the wakeonlan bit on my ethernet card to the correct setting so I could wake my MX Fluxbox desktop remotely. Here is where that issue is discussed:

https://forum.mxlinux.org/viewtopic.php ... 41#p691441

I have no idea why making this change (the only change I've made to my system besides "apt upgrades") would impact the startup script for kdeconnect, and perhaps it isn't related. I have set the sleep function to 60s and it still never starts kdeconnect-indicator after Fluxbox comes up. If you have further ideas let me know.
https://discoverfoss.com
Home Desktop = HP Envy - i7 with 16GB - Fedora 38
Home Laptop = HP Pavilion dv4 - AMD Turion II M520 with 4GB - MX-21 Fluxbox
Work Desktop = Acer M11AA - i5-3340s with 8GB - MX-21 Fluxbox

User avatar
ceeslans
Posts: 811
Joined: Sun Apr 14, 2019 3:48 am

Re: How do I get KDEConnect to autostart in MX 21 Fluxbox

#9 Post by ceeslans »

Sorry, wayyy over my head... I guess the 'wake' and 'sleep' actions don't play nice - but I really can't make any sensible judgement about it.

Anyway, Hope that a 'kdeconnect-indicator' command still initializes the icon in the systemtray, when executed after fluxbox startup?
Sony Vaio VPCF23P (2011), Intel Core i7-2670, 6gb RAM, 240gb SSD, MX-Linux 23 based Fluxbox v/1.3.7+
Lenovo Thinkpad L560 (2016), Intel Core i5-6200, 16gb RAM, 240gb SSD, Devuan Daedalus based Fluxbox v/1.3.7+

User avatar
mowest
Posts: 119
Joined: Mon Jul 06, 2020 4:08 pm

Re: How do I get KDEConnect to autostart in MX 21 Fluxbox

#10 Post by mowest »

ceeslans wrote: Tue Aug 09, 2022 4:29 pm Anyway, Hope that a 'kdeconnect-indicator' command still initializes the icon in the systemtray, when executed after fluxbox startup?
Yes, it does. I can get kdeconnect-indicator to launch and show up in the system tray by using ROFI to launch it. Wait a minute.....

:bagoverhead:

I didn't check the obvious. I moved the kdeconnect_start bash script from my ~/bin/ directory to ~/.fluxbox/scripts directory to make things cleaner for my dotfile manager that is already backing all of my dotfiles and everything in .fluxbox to a git repo server. But I failed to change my startup script for fluxbox to point to the correct directory. Its working fine now when fluxbox restarts. Sorry, I'm going to mark this solved again.
:p
https://discoverfoss.com
Home Desktop = HP Envy - i7 with 16GB - Fedora 38
Home Laptop = HP Pavilion dv4 - AMD Turion II M520 with 4GB - MX-21 Fluxbox
Work Desktop = Acer M11AA - i5-3340s with 8GB - MX-21 Fluxbox

Post Reply

Return to “MX Fluxbox Official Release”