discuss.kde.org

e_t_ Admin , to KDE in How to convert xdg/autostart processes to systemd services?

For your unit files, you have Wants in the [Install] section. That is not correct. Wants belong in the [Unit] section. The [Install] section is where you define WantedBys. You may want to read the man page for systemd.unit.

To interact with user services, you do have to always use systemctl --user.

If you put your user unit files in /etc/systemd/user, they're accessible to all users. If a particular user wants to enable the service, they can run systemctl --user enable $service. Defining the unit in ~/.config/systemd will mean only the one user will be able to start the service. Defining the unit in /etc/systemd/system indicates it is not a user service but a system service.

boredsquirrel OP ,

Thanks a lot, I will fix them!

So even though they are placed in /etc/systemd/user every user can enable and disable them? This sounds like a good option for many services.

Do you know if it is possible to for example place them in /etc/systemd/user/kde/ to have them grouped better?

e_t_ Admin ,

Every user can enable services from /etc/systemd/user for their account. If the user doesn't log in, their instance of the service won't start. There is a way to have user services launch without logging in, but that would obviously be nonsensical for desktop services.

I don't think systemd would find units in /etc/systemd/user/KDE. Look at the mess that is /usr/lib/systemd/system. Organization doesn't seem to be a thing.

boredsquirrel OP ,

Thanks!

I am still a bit confused about systemd services, timers, units, targets and whatever but slowly getting there.

Also do you know how dbus activation would make sense, if it is already used in some ways and if it should be?

I think nearly all these services should run as user ones. I will fix their Wants entry and try to enable them again. Then see if some are dependencies of others, and the other way around on what they depend (like graphical.target, network-online.target, network.target etc).

Also I feel something with accessibility can be improved here, as orca and kaccess may be invoked intelligently (and otherwise dont bother users).

e_t_ Admin ,

I really don't understand dbus.

I think systemd targets work opposite to your expectation. The Wants in [unit] define the things that that unit needs to already be available. For instance, you might add Wants=network.target to the unit for nginx so that it won't try to start until the network is available. When I wrote a unit to start my company's application, I also had Wants=postgresql.service to ensure that the database came up before the application. Remember that sysyemd tries to run as many things in parallel as it can. This is one thing that makes it much faster than classic sysvinit which started things sequentially. But it means race conditions can occur. You use Wants to break those races where necessary. The targets that you'd specify in WantedBy in [install] more closely resemble SysV runlevels. You might want to read how runlevels used to work in SysV, in order to understand systemd targets.

boredsquirrel OP ,

Something ChatGPT gave me

Requires vs Wants:

  • Requires: If a unit "requires" another unit, it means that the former cannot function properly without the latter being active. If the required unit fails, the dependent unit will also fail.
  • Wants: As mentioned earlier, "wants" implies a weaker dependency. If a unit wants another unit, it will start if the wanted unit is activated, but it won't fail if the wanted unit fails.

Sounds like most of the services actually have Requires and not Wants.

So Wants is more used to indicate in what "wave" a service should run. Quite nice!

boredsquirrel OP ,

I fixed them and edited the post. There now is a Github repo for the script, and guess what? Most services still run, so there are at least 2 mechanisms to start them. What a mess

VHS , (edited ) to KDE in How to render videos with multiple audio tracks with 2 languages (select between tracks)?
@VHS@hexbear.net avatar

You can just use MKVToolNix to add the second track to the MKV file after rendering, it's still another step but doesn't require re-encoding.

If you're just trying to multiplex tracks and not actually edit the video, I'd recommend doing it entirely with MKVToolNix and skipping Kdenlive for this use. I've done this previously to combine a subbed video and a dubbed one into one file, you can offset or stretch the audio if needed as well.

e0qdk , to KDE in How to render videos with multiple audio tracks with 2 languages (select between tracks)?
@e0qdk@reddthat.com avatar

I don't know how to do it with KDE's tools, but on the command line with ffmpeg you can do something like this:

ffmpeg -i video_track.mp4 -i audio_jp.m4a -i audio_en.m4a -map 0:v -map 1:a -map 2:a -metadata:s:a:0 language=jpn -metadata:s:a:1 language=eng -c:v copy -c:a copy output.mp4

Breaking it down, it:

  • runs ffmpeg
  • with three inputs (-i flag) -- a video file, and two audio files.
  • The streams are explicitly mapped into the result, counting the inputs from 0 -- i.e. -map 0:v maps input 0 (the first file) as video (v) to the output file and -map 1:a maps the next input as audio (a), etc.
  • It sets the metadata for the audio tracks -metadata:s:a:0 language=jpn sets the first audio track (again counting from 0...) to Japanese; the second metadata option sets the next audio track to English.
  • -c:v copy specifies that the video codec should be copied directly (i.e. don't re-encode -- remove this if you DO need to re-encode)
  • -c:a copy specifies that the audio codec should be copied directly (i.e. don't re-encode -- remove this if you DO need to re-encode)
  • output.mp4 -- finally, list the name of the file you want the result written into.

See documentation here: https://ffmpeg.org/ffmpeg.html

If you need another language in the future, I think the language abbreviations are the three letter codes from here: https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes -- but I'm not certain on that.

mox , to KDE in How to render videos with multiple audio tracks with 2 languages (select between tracks)?

Not rendering. Muxing, which is short for multiplexing. Lots of software can do this, including MKVToolNix, ffmpeg, and GPAC/MP4Box. If you're also encoding the video, Handbrake could do the job.

Ephera , to KDE in Plasma and Ansible on enterprise thin clients

I'm not using Ansible myself, but I do use kreadconfig and kwriteconfig, and well, it does just have 4 parameters to identify a setting and its value, so that Ansible module does look like it's sufficient for that.

One tip I have, is that you can figure out which GUI setting corresponds to which config file change, by setting up a Git repo in ~/.config and looking at the diff. So, basically:

cd ~/.config
git init
git add .
git commit -m "original config"
# now change setting in UI
git diff

When you're done transferring that into Ansible, you can commit or stage the changes and tweak another UI setting, or if you're completely done, then just rm ~/.config/.git/.
I guess, you could also use this Git repo to roll back all the settings and see if your Ansible automation works as expected.

boredsquirrel , to KDE in Plasma and Ansible on enterprise thin clients

Kubuntu still uses Plasma 5.27 which has a lot of issues.

Plasma 6 was rock stable, now 6.1 needs some fixing. I wonder when a more stable version comes.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • All magazines