How to find and use a linux program's executable file?

Hello World,

I need to have a program launch at a specific time(not at startup!) and after a bit of googling I decided the best/easiest GUI option for me would be Kcron.

I installed it and now in my system settings I have this

Now if I click “Add” the first step is to choose a program,

and if I click on the little “Browse the program” button a search window opens that normally, in win :poop: system, you would point to the program’s .exe file.

But we are on Linux of course, so after more googling I found something stated here on the forum according to a mr. @paidhi

The Exec= from my program’s .desktop file says /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=yuki-iptv io.github.yuki_iptv.yuki-iptv

I figured simply pointing it at the /usr/bin/flatpak file would not be a good idea so instead I decided to copy the entire thing above and paste it in the command box from the picture above, but I just get a python error when it tries to launch it.

This is where I am currently stuck. Any suggestions how I can find out what is the actual “.exe” for the yuki-iptv program and how I’m supposed to use it in the scheduler?

Thank you.

P.S. On a related note am I at least correct in understanding that for regular nonflatpak programs the Linux equivalent of .exe is .sh and for appimages it’s .appimage? Or do I have that wrong too?

On unix systems there is a execute attribute that must be set on a file for it to be runnable.

You can use this when you do an ls -l /usr/bin.
For example I see:

$ ls -l /usr/bin/h*
lrwxrwxrwx. 1 root root     16 Dec 17 00:00 /usr/bin/halt -> ../bin/systemctl*
-rwxr-xr-x. 1 root root  49160 Dec 15 00:00 /usr/bin/hardlink*
-rwxr-xr-x. 1 root root     32 Jul 23 01:00 /usr/bin/hash*
-rwxr-xr-x. 1 root root  49176 Sep 29 01:00 /usr/bin/head*
-rwxr-xr-x. 1 root root  19872 Nov 21 00:00 /usr/bin/hex2hcd*
-rwxr-xr-x. 1 root root  48960 Dec 15 00:00 /usr/bin/hexdump*
-rwxr-xr-x. 1 root root 206544 Dec 17 00:00 /usr/bin/homectl*
-rwxr-xr-x. 1 root root 119832 Oct 31 00:00 /usr/bin/host*
-rwxr-xr-x. 1 root root  32632 Sep 29 01:00 /usr/bin/hostid*
-rwxr-xr-x. 1 root root  19984 Jul 24 01:00 /usr/bin/hostname*
-rwxr-xr-x. 1 root root  36680 Dec 17 00:00 /usr/bin/hostnamectl*

The x in the permission is the eXecute permission.

A shell script may have a .sh extension, but its not required.
File types are not used to figure out is a file is executable.

You can simply launch the desktop file by its name/path:

Sigh, that makes everything just so much more confusing… :face_with_spiral_eyes:
But thank you for the info anyway.

Tried that, didn’t work, nothing happened.

Then I read those links and while

gtk-launch io.github.yuki_iptv.yuki-iptv.desktop does work when I type it in the console I can’t use neither it nor kioclient exec file:/var/lib/flatpak/exports/share/applications/\n with the scheduler because it’s still asking me to choose a program, so I can’t apply the changes. :frowning:

Try this:

kstart --application org.kde.konsole
kstart --application io.github.yuki_iptv.yuki-iptv

Nope, doesn’t work. That command field really wants me to select a file, maybe more arguments could be at the end, no idea, but first I have to select something…:pleading_face:

Try using full paths:

/usr/bin/gtk-launch org.kde.konsole
/usr/bin/gtk-launch io.github.yuki_iptv.yuki-iptv

/usr/bin/kstart --application org.kde.konsole
/usr/bin/kstart --application io.github.yuki_iptv.yuki-iptv

It may also need to symlink or install the launcher to a better location:

ln -s /var/lib/flatpak/exports/share/applications/\
io.github.yuki_iptv.yuki-iptv.desktop ~/.local/share/applications

desktop-file-install --dir=${HOME}/.local/share/applications \
/var/lib/flatpak/exports/share/applications/io.github.yuki_iptv.yuki-iptv.desktop

Still trying different permutations, nothing has worked so far, including the symlink stuff(by this I mean they worked in the console, and the correct files were created, but Kcron still won’t open it).

LE: Well I tried all the different combos I could think of, either nothing happens or it just trows up one of those python errors. :sob:
I never imagined simply trying to open a program could be this complicated, looool… :clown_face:

LLE: Ok, here’s another weird thing, after I create the rule if I click the little run button the console opens then the iptv program launches and works fine. But it never opens automatically on schedule like it’s supposed to, it just gives that python error.

Here’s the console ouput if I hit the button:


(gtk-launch:40931): GLib-GIO-CRITICAL **: 16:25:33.608: g_dbus_connection_call_sync_internal: assertion 'object_path != NULL && g_variant_is_object_path (object_path)' failed
-------------------------------------------------------------------------
End of script execution. Type Enter or Ctrl+C to exit.
-------------------------------------------------------------------------
Qt: Session management error: Could not open network socket
16:25:34.922 yuki-iptv INFO: Version: 0.0.19
16:25:34.922 yuki-iptv INFO: Python 3.13.9 (main, Nov 10 2011, 15:00:00) [GCC 15.2.0]
16:25:34.922 yuki-iptv INFO: Qt 6.10.1 (xcb)
16:25:35.047 yuki_iptv.playlist INFO: Loading playlist...
16:25:35.047 yuki_iptv.playlist INFO: Playlist is remote URL
16:25:35.047 yuki_iptv.playlist INFO: Loading playlist with headers {"User-Agent": "Mozilla/5.0"}
16:25:35.448 yuki_iptv.playlist INFO: Status code: 200
16:25:35.448 yuki_iptv.playlist INFO: 2490108 bytes
16:25:35.597 yuki_iptv.playlist INFO: 10750 channels, 151 groups, 0 movies, 0 series
16:25:35.597 yuki_iptv.playlist INFO: Sorting playlist...
16:25:35.598 yuki_iptv.playlist INFO: Playling loading done!
16:25:35.618 yuki-iptv INFO: Default user agent: Mozilla/5.0
16:25:35.618 yuki-iptv INFO: Default HTTP referer: (empty)
16:25:35.716 yuki_iptv.mpv_options INFO: Testing custom libmpv options...
16:25:35.716 yuki_iptv.mpv_options INFO: {}
16:25:35.735 yuki_iptv.mpv_options INFO: libmpv options OK
16:25:35.735 yuki-iptv INFO: Using libmpv options: {"vo": "gpu-next,gpu,x11", "hwdec": "no", "force-window": true}
16:25:35.739 yuki-iptv INFO: catchup-days = 7
16:25:35.742 yuki-iptv INFO: No hotkeys.json found, using default hotkeys
16:25:35.776 yuki-iptv INFO: Using libmpv v0.40.0
16:25:35.777 yuki-iptv INFO: Demuxer cache set to 60s
16:25:35.777 yuki-iptv INFO: Cache set to 60s
16:25:35.777 yuki-iptv INFO: No HTTP referer set up
16:25:35.930 yuki-iptv INFO: Set volume to 0
16:25:35.941 yuki-iptv INFO: 
16:25:35.941 yuki-iptv INFO: Playing 'Digi 24 (720p)' ('https://edge-ar.rcs-rds.ro/digi24ar/index.m3u8')
16:25:35.945 yuki-iptv INFO: Using User-Agent: Mozilla/5.0
16:25:35.945 yuki-iptv INFO: Using HTTP Referer: (empty)
16:25:35.945 yuki_iptv.catchup INFO: 
16:25:35.945 yuki_iptv.catchup INFO: orig spec url: https://edge-ar.rcs-rds.ro/digi24ar/index.m3u8
16:25:35.945 yuki_iptv.catchup INFO: after spec url: https://edge-ar.rcs-rds.ro/digi24ar/index.m3u8
16:25:35.945 yuki_iptv.catchup INFO: 
16:25:35.957 yuki-iptv INFO: setPlayerSettings waiting for channel load...
16:25:36.053 yuki-iptv INFO: Playing last channel, splash turned off
16:25:36.154 yuki-iptv INFO: Connection loss detector enabled
16:25:38.305 libmpv WARNING: [warn] demux: Not seekable, but enabling seeking on user request.
16:25:38.305 libmpv INFO: [info] cplayer: ● Video  --vid=1  (h264 1280x720 25 fps 3128 kbps)
16:25:38.305 libmpv INFO: [info] cplayer: ○ Video  --vid=2  (h264 720x576 25 fps 2128 kbps)
16:25:38.305 libmpv INFO: [info] cplayer: ○ Video  --vid=3  (h264 320x180 25 fps 2128 kbps)
16:25:38.305 libmpv INFO: [info] cplayer: ○ Video  --vid=4  (h264 640x360 25 fps 2128 kbps)
16:25:38.305 libmpv INFO: [info] cplayer: ● Audio  --aid=1  (aac 2ch 48000 Hz 3128 kbps)
16:25:38.305 libmpv INFO: [info] cplayer: ○ Audio  --aid=2  (aac 2ch 48000 Hz 2128 kbps)
16:25:38.305 libmpv INFO: [info] cplayer: ○ Audio  --aid=3  (aac 2ch 48000 Hz 2128 kbps)
16:25:38.305 libmpv INFO: [info] cplayer: ○ Audio  --aid=4  (aac 2ch 48000 Hz 2128 kbps)
16:25:38.312 yuki_iptv.menubar INFO: Sending mpv command: "af add \"lavfi=[acompressor]\""
16:25:38.362 libmpv INFO: [info] cplayer: AO: [pulse] 48000Hz stereo 2ch float
16:25:38.364 libmpv INFO: [info] cplayer: VO: [gpu-next] 1280x720 yuv420p
16:25:38.523 yuki-iptv INFO: setPlayerSettings 'Digi 24 (720p)'
16:25:38.525 yuki-iptv INFO: Deinterlace: disabled
16:25:38.525 yuki-iptv INFO: Contrast: 0.0
16:25:38.525 yuki-iptv INFO: Brightness: 0.0
16:25:38.525 yuki-iptv INFO: Hue: 0.0
16:25:38.525 yuki-iptv INFO: Saturation: 0.0
16:25:38.525 yuki-iptv INFO: Gamma: 0.0
16:25:38.525 yuki-iptv INFO: Video aspect: -1.0
16:25:38.525 yuki-iptv INFO: Zoom: 0.0
16:25:38.525 yuki-iptv INFO: Panscan: 0.0
16:25:38.525 yuki-iptv INFO: Restoring last video track: '1'
16:25:38.526 libmpv INFO: [info] cplayer: Track switched:
16:25:38.526 libmpv INFO: [info] cplayer:  ● Video  --vid=1  (h264 [High] 1280x720 25 fps 3128 kbps)
16:25:38.526 libmpv INFO: [info] cplayer:  ○ Video  --vid=2  (h264 720x576 25 fps 2128 kbps)
16:25:38.526 libmpv INFO: [info] cplayer:  ○ Video  --vid=3  (h264 320x180 25 fps 2128 kbps)
16:25:38.526 libmpv INFO: [info] cplayer:  ○ Video  --vid=4  (h264 640x360 25 fps 2128 kbps)
16:25:38.526 libmpv INFO: [info] cplayer:  ● Audio  --aid=1  (aac [LC] 2ch 48000 Hz 3128 kbps)
16:25:38.526 libmpv INFO: [info] cplayer:  ○ Audio  --aid=2  (aac 2ch 48000 Hz 2128 kbps)
16:25:38.526 libmpv INFO: [info] cplayer:  ○ Audio  --aid=3  (aac 2ch 48000 Hz 2128 kbps)
16:25:38.526 libmpv INFO: [info] cplayer:  ○ Audio  --aid=4  (aac 2ch 48000 Hz 2128 kbps)
16:25:38.538 libmpv WARNING: [warn] vd: Setting video-aspect-override to -1 is deprecated.
16:25:38.538 libmpv WARNING: [warn] vd: Use --video-aspect-override=no --video-aspect-mode=container instead.
16:26:00.900 libmpv WARNING: [warn] vd: Setting video-aspect-override to -1 is deprecated.
16:26:00.900 libmpv WARNING: [warn] vd: Use --video-aspect-override=no --video-aspect-mode=container instead.
16:26:00.908 yuki-iptv INFO: Exiting
16:26:00.914 libmpv WARNING: [warn] vd: Setting video-aspect-override to -1 is deprecated.
16:26:00.914 libmpv WARNING: [warn] vd: Use --video-aspect-override=no --video-aspect-mode=container instead.
16:26:00.916 libmpv INFO: [info] cplayer: VO: [null] 1280x720 yuv420p

The full rules of what it takes to be a Windows executable are complex and surprising. Its not just .exe that can be run…

1 Like

Out of curiosity does:
/usr/bin/bash -c "/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=yuki-iptv io.github.yuki_iptv.yuki-iptv"

work

This is where I am currently stuck. Any suggestions how I can find out what is the actual “.exe” for the yuki-iptv program and how I’m supposed to use it in the scheduler?

I suggest using the command line (Konsole) and the “exec” portion of your .desktop file to see what will actually start up ‘yuki-iptv’ properly.

Once you’ve done so, open ‘Dolphin’, right-click and select ‘new’ and create a new text file. When the file name pops up, use a descriptive name (perhaps ‘start-yuki-iptv’ or similar), double-click on the new file and add the working command line as the contents of the file.

Save the file and then right-click on the file icon and select ‘properties’. Select the ‘permissions’ tab and click the check box next to ‘Execute’ and click OK.

You can then use that file as the “command” requested by the task scheduler.

Unfortunately, I don’t know anything about yuki-iptv so I can’t help with the appropriate contents of the above file. Perhaps someone else with knowledge of the application can help with that.

Good luck!

An aside:

Eventually you’ll realise that it makes it easier! Just remember that linux is case sensitive, and that a file can be called anything you like - there’s no need to have am mp3 file actually have a .mp3 on the end, or an executable to be named “something.exe”. It CAN have that extension if you like, but it’s not required.

If you want to really find out what the system thinks a file is, you can call file on it.

└─➜ file dupehunter                                                               22:46 Thu 25-Dec
dupehunter: SQLite 3.x database, last written using SQLite version 3051000, file counter 1, database pages 2, cookie 0x1, schema 4, UTF-8, version-valid-for 1

└─➜ file *                                                                                                                                                          22:51 Thu 25-Dec
enterprise-numbers: Unicode text, UTF-8 text
hddtemp.db:         ASCII text
magic:              magic text fragment for file(1) cmd, 2nd line "#------------------------------------------------------------------------------", 3rd line "# $File: acorn,v 1.9 2024/08/30 17:29:28 christos Exp $", 4th line "# acorn:  file(1) magic for files found on Acorn systems", 5th line "#"
magic.mgc:          magic binary file for file(1) cmd (version 20) (little endian)

Far more flexible one would argue - been around since the 70’s.

@vikings
No idea if this is still possible but if it is can you change the name of the used program from Kcorn to Kcron in your first post. I started looking for Kcorn and found nothing, till I realized it should be Kcron because of cron as in crontab.
Thanks.

1 Like

Morning all:

Suppose that’s true, you also have things like .bat, but it still doesn’t compare to Linux imo.

Sadly it doesn’t, still spits out a “python3.13 has crashed” error. :sob: Any other suggestions please?

All that seems a bit more involved, gimme a few hours to wake up then I’ll give it a shot. :wink:

I totally agree that it makes it way more flexible and/or powerful, I would not use the word “easier” however. :thinking: Least not yet, gimme a few more years under Linux and we’ll talk and see. Like you said, “eventually”, maybe… :wink:

Done, thanks for letting me know. :+1:

I don’t see anywhere that you have told us what version of fedora you are using.

If you are using f42 which actually has python 3.13 installed then this seems problematic for the system.

If you have upgraded to f43 the system should now have python 3.14 installed and if the flatpak is depending upon the system providing python 3.13 to function this would seem to indicate an error in the flatpak app and not for fedora.

Please show us the output of python -V.
On my system with a fully updated f43 OS I get this.

$ python -V
Python 3.14.2

I am indeed running Fedora 43 updated to the day and my python -V output is the same as yours @computersavvy :worried:
Let me know what other info you need please, I’ve never been very good at knowing what I should provide from the start.

Ok I had time to try all that and it doesn’t work, when I add the file it doesn’t care, it’s still asking me to add a program. :man_facepalming: I tried leaving it with .txt, tried with .sh, treid without any termination whatsoever, etc.

This is what the file’s property window shows, I think I did everything correct, and it’s located in my home folder if that matters.

LE: And ignore the front . in the screenshot, I obviously tried it without making the file hidden(I would just like/hope to have it hidden in the end for aestethic purposes), it didn’t care.

LLE: Not sure if it helps but one more thing, which granted I probably should have done from the start/my bad, I tried copy&pasting the exec= lines from some of the other programs to see if those worked.
Flacon and keepassxc just gave some generic “sorry it looks like program xxxxxx has crashed” notifications and steam gave the error below.
Is it possible that Kcron itself doesn’t even work at all or am I confusing things again?!?! :scream:

This worked in a vm …
/usr/bin/systemd-run --user /usr/bin/flatpak run io.github.yuki_iptv.yuki-iptv

1 Like

Wooow, that worked, holy crap, yaaay!! :grin: Thank you mate.
Would explaining why your command worked when the others didn’t be easy-ish or would it go way above my head anyway and thus you shouldn’t really bother?

I’ll mark your post as solution tomorrow, but I’d like to leave one final question before I go to bed. This yuki-iptv program doesn’t seem to save the recording schedule when I close it.
I am wondering if this is due to flatpak persmissions since I already had to add an extra rule for the /home/VIKINGS/Videos folder so it can write the recordings it creates to it.

But I am usure what permission to give it so that that extra function it has works properly. It seems to be differrent then the programs “normal” settings from the settings window which do save…
Should I just checkmark “all systems configuration” and switch it to read/write or is there some better permission?

Unfortunately it’s not much of an explanation, I was messing around with doing a systemd service and got it to work using systemd-run. I was able to get another flatpak (gnome-mpv) to start normally.

I wasn’t able to get a guide to load and it would crash each time I edited a playlist. So I can’t provide much help here.

Oh, ok, guess I’ll keep trying to track down the author then. See if he/she has any advice.
Well, thanks again.