You are not logged in.

#26 2017-03-19 11:37

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,594
Website

Re: how to organize kde-servicemenus?

I have updated slightly the "kim_pelemele" file and have tested creating html gallery which works as expected, here is version 2.


Attachments:
gz kim_V2.tar.gz, Size: 51.42 KiB, Downloads: 36

Offline

#27 2017-03-19 13:48

michaelk
Member
Registered: 2017-03-16
Posts: 55

Re: how to organize kde-servicemenus?

Unfortunately it did not work either, as root!

„./install.sh: Zeile 20: tde-config: Kommando nicht gefunden. (command not found)

<Most likely the first line in the installation skript should be: „tdeinstdir=`~/.trinity/`“ - right?>
                                                           
cp: das angegebene Ziel „/share/apps/konqueror/servicemenus/“ ist kein Verzeichnis

<Of course: there is no „/share/apps/konqueror/servicemenus/“ but there is a „~/.trinity/share/apps/konqueror/servicemenus/“ directory>

So I must not cite the rest of the error messages.
                                                             

I translated from German language some posts before. The first error is „tde-config“ not found.
On the other hand: with the manual installation KIM works. I just will need to adjust the PATH variable as for the slide show /home/user/.trinity/bin must be in the user PATH.
How to do that without disturbing the TDE-configuration?

Last edited by michaelk (2017-03-19 13:53)

Offline

#28 2017-03-19 13:53

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,594
Website

Re: how to organize kde-servicemenus?

@michaelk
Are you running a normal desktop/laptop or a pi?

If a normal machine cut/paste this (when in the extracted folder)

sudo ./install.sh

Offline

#29 2017-03-19 14:05

michaelk
Member
Registered: 2017-03-16
Posts: 55

Re: how to organize kde-servicemenus?

I am on a normal Desktop-PC. I got to be root with „sudo su“ and moved the Konsole into the KIM directory and then typed „./install.sh“.
It simply did not make use of „tde-config“.

KIM runs, as said before, as I did this manually as a user but it sits now in ~/.trinity/. I guess that this „~/.trinity/bin/“ directory must be in the $PATH now.

Last edited by michaelk (2017-03-19 14:05)

Offline

#30 2017-03-19 14:13

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,594
Website

Re: how to organize kde-servicemenus?

I'm not sure what is going on with your set-up but I am thinking all those ",," might have something to do with it...
I am currently working on the html gallery script and uninstalling and installing after every edit and it works flawlessly on my machine...

Offline

#31 2017-03-19 14:45

michaelk
Member
Registered: 2017-03-16
Posts: 55

Re: how to organize kde-servicemenus?

@Dai_trying

Misunderstanding: this „...“ is just the German way of quoting. Has not been when working here. The commands I used are between those symbols.
On purpose I opted for using KIM only in userspace.
So I added these lines to my ~/.profile file:

fi

# set PATH so it includes ~/.trinity/bin
if [ -d "$HOME/.trinity/bin" ] ; then
    PATH="$HOME/.trinity/bin:$PATH"
fi

The slide show functions now.

PS. I found the mistake now: in the install.sh line 20 should be like

tdeinstdir=/opt/trinity/

- then it works like a charme:
„root@q4os-desktop:/home/user/Schreibtisch/kim_V2/kim# ./install.sh

Installation completed. Good bye.

Last edited by michaelk (2017-03-19 15:13)

Offline

#32 2017-03-19 20:20

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,594
Website

Re: how to organize kde-servicemenus?

I have made some changes to make the html gallery and photo montage work correctly, also the annotation wasn't working so fixed that as well, if there is anything else not working (as expected) please let me know and I will take a look.


Attachments:
gz kim_V3.tar.gz, Size: 51.14 KiB, Downloads: 38

Offline

#33 2017-03-19 21:14

michaelk
Member
Registered: 2017-03-16
Posts: 55

Re: how to organize kde-servicemenus?

May I dare to add a question to some more experienced users here?
This already mentioned *.desktop file that now works here in Q4OS (KDE3) does not work on my Desktop PC on a KDE4-Debian 8 installation:

michaelk wrote:

root@koek2:/home/michael/.kde/share/apps/konqueror/servicemenus# cat maketree.desktop
[Desktop Entry]
Actions=directoryTree;allFiles;fullPath
Encoding=UTF-8
ServiceTypes=inode/directory
X-KDE-Submenu=Make Tree

[Desktop Action directoryTree]
Name=Directories Only
Icon=kwrite
Exec=tree -ad %f | kwrite --stdin

[Desktop Action allFiles]
Name=All Files
Icon=kwrite
Exec=tree -a %f | kwrite --stdin

[Desktop Action fullPath]
Name=All Files w/Full Path
Icon=kwrite
Exec=tree -af %f | kwrite --stdin

Anybody to suggest a solution? KIM works on this installation, though!

Offline

#34 2017-03-19 22:29

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,594
Website

Re: how to organize kde-servicemenus?

I don't have any other KDE images to be able to test this, but I noticed yo are using root to show this, if you are running the script as root you might need to put full paths to all applications (kwrite,tree), but if you are running it as user I can't see anything obvious sorry...

Offline

#35 2017-03-19 22:42

michaelk
Member
Registered: 2017-03-16
Posts: 55

Re: how to organize kde-servicemenus?

Thanks for the effort, @Dai_trying! This is another chance: to add the full pathname of kwrite to it. But unfortunately it does not work either. - No, I just the root konsole only for „cat“, to display the content of that maketree.desktop-file. It is owned by user and sits in /home/user/.kde/share/kde4/services/ServiceMenus.

In my experience such minor detail configuration problems cost the most time in case something does not work like intended under Linux. Does not happen often! ;-)

Last edited by michaelk (2017-03-19 22:51)

Offline

#36 2017-03-20 14:00

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,594
Website

Re: how to organize kde-servicemenus?

@michaelk
I booted Debian Kde in a VM to test this as I was curious and here is what worked for me.

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=inode/directory
Actions=directoryTree;allFiles;fullPath
Encoding=UTF-8
X-KDE-Submenu=Make Tree

[Desktop Action directoryTree]
Name=Directories Only
Icon=kwrite
Exec=tree -ad %f | kwrite --stdin

[Desktop Action allFiles]
Name=All Files
Icon=kwrite
Exec=tree -a %f | kwrite --stdin

[Desktop Action fullPath]
Name=All Files w/Full Path
Icon=kwrite
Exec=tree -af %f | kwrite --stdin

I just looked at the other servicemenu entries to get the configuration. cool

Offline

#37 2017-03-20 15:54

michaelk
Member
Registered: 2017-03-16
Posts: 55

Re: how to organize kde-servicemenus?

@Dai_trying

Hey, is this magic? It works! ;-)

One notice to you: I tried to install your kim_V3 on another installation. With me, using a root konsole, the installation did not work. Until I replaced the line "tde-config --prefux" with "/opt/trinity" in the install.sh/script. Then it worked.

So thanks a lot for your help!

Offline

#38 2017-03-20 16:06

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,594
Website

Re: how to organize kde-servicemenus?

I can't figure out why you can't use tde-config, I can use it from the command-line too without issue, it's location is (or should be) /opt/trinity/bin/ so maybe you have removed that from your $PATH. I'm pretty sure it is installed with the base installation as I think it is a core component... but so long as you got it all working everything is good. smile

Offline

#39 2017-03-20 16:41

michaelk
Member
Registered: 2017-03-16
Posts: 55

Re: how to organize kde-servicemenus?

I do not know it either. it is shown with a root konsole. Thanks for the tip for looking again in $PATH for it.

As Linux is a cooperative thing I had as well looked for the KDE4 problem in a KDE forum. You can see it here:

https://forum.kde.org/viewtopic.php?f=1 … 31#p373731

In this way other people may use it as well. I fnd this maketree-thing really handy.

Offline

#40 2017-03-20 21:00

michaelk
Member
Registered: 2017-03-16
Posts: 55

Re: how to organize kde-servicemenus?

Ok, done. But not permanently:

root@q4os-desktop:/home/user/Schreibtisch# export PATH=$PATH:/opt/trinity/bin
root@q4os-desktop:/home/user/Schreibtisch# $PATH
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/trinity/bin: Datei oder Verzeichnis nicht gefunden

After the next login it will be gone. But for the installation of KIM it seems to be necessary. Right?

Offline

#41 2017-03-20 21:13

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,594
Website

Re: how to organize kde-servicemenus?

If you look into your /opt/trinity/bin folder you will notice many files all of which will be unavailable from the command-line (unless you type the full path) if you omit this folder from your $PATH, although If you do not use the terminal much then this should not cause too many issues.

Can I ask why you removed this from your $PATH in the first place?

Offline

#42 2017-03-20 21:48

michaelk
Member
Registered: 2017-03-16
Posts: 55

Re: how to organize kde-servicemenus?

No, believe me please: I did not remove it. I first recognized the problem when I wanted to install KIM from a root konsole.
In my user konsole /opt/trinity/bin is in the $PATH:

bash: /usr/local/bin:/opt/trinity/bin:/usr/bin:/bin:/usr/local/games:/opt/trinity/games:/usr/games: Datei oder Verzeichnis nicht gefunden

But /home/user/.trinity/bin is not in the user PATH as you see. Should it be there? Those kim_* files are there as well. (= as in /opt/trinity/bin).

Last edited by michaelk (2017-03-20 22:09)

Offline

#43 2017-03-20 22:17

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,594
Website

Re: how to organize kde-servicemenus?

I think your problems seem to stem from using a root console instead of simply typing sudo when you need to raise privileges, there are obviously some differences between the two and I think that is why you cannot access tde-config from the install script.

michaelk wrote:

But /home/user/.trinity/bin is not in the user PATH as you see. Should it be there? Those kim_* files are there as well.

You added the folder manually and earlier told us how you added it to your path, so "Should it be there?" is a question I cannot answer, all I can say is that $HOME/.trinity/bin doesn't exist on my system and the kim_* files are in /opt/trinity/bin, it is up to you how you decide to manage your system, you just have to remember the changes if you have to re-install or set-up a new machine. smile

Offline

#44 2017-03-21 10:15

michaelk
Member
Registered: 2017-03-16
Posts: 55

Re: how to organize kde-servicemenus?

Yes, you are right. It have been the easiest way just to execute the first install with a konsole and just type „sudo ./install.sh“

But now things work as they should and I am quite happy to be able to work with a KDE3 Desktop on a modern foundation. With Debian Lenny I have been happy many years ago but from safety considerations it is out now. At least when connected to the Internet. This Q4OS works nice and I will recommend it in our local Linux user group! Thanks a lot for your effort!

Offline

#45 2017-03-24 15:03

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,594
Website

Re: how to organize kde-servicemenus?

JimW wrote:

Sigh....
Now if they just had it for video!
But, I manage...
I convert my 4:3 aspect game camera avi's to 16:9 aspect mp4's for youtube without loosing too much quality. Managed to do it with ffmpeg. Thing is, I wanted to keep the bottom of the game camera picture where the date/time information was, so I had to crop the top (which was just tree tops and sky anyway). Most examples have the cropping of the 4:3 aspect ratio to get 16:9 aspect radio to do the cropping evenly from top and bottom.

Sorry this took some time but I might have something for you, I have created a servicemenu that will give you a "Crop Video File" option when you right click any video file (determined by mime-type), then you are asked for the dimensions you want (width,height, pixels to crop from left, pixels to crop from top), next you have the option to preview the settings before committing to write them. After previewing you are asked to confirm the settings are ok and if you answer yes it will write the file with a prefix "cropped_", if you answer no it will show you the settings you tested and exit the script. If you decline the preview it proceeds to crop the video.

This script relies upon having ffmpeg,ffplay and kdialog available.

If there is anything wrong with it or you want something changing/adding/removing just let me know. smile

Only two files are needed, the first is the script to do the converting, this should ba saved to /opt/trinity/bin/ffcrop_for_JimW and make it executable with "sudo chmod +x /opt/trinity/bin/ffcrop_for_JimW"

file ffcrop_for_JimW

#!/bin/bash

fileinput=$1

justname=`basename "$fileinput"`
justpath=${fileinput%/*}

varW=`kdialog --inputbox "What width do you want?"`
varH=`kdialog --inputbox "What height do you want?"`
varLM=`kdialog --inputbox "How many pixels to crop from left"`
varTM=`kdialog --inputbox "How many pixels to crop from top?"`

if [ "$varW" == "" ] || [ "$varH" == "" ] ||[ "$varLM" == "" ] ||[ "$varTM" == "" ]; then
    kdialog --sorry "You must enter a value for all dimensions\nEnter 0 for no value" &
    exit
fi

kdialog --yesno "Do you want to play video to check size?"
if [ "$?" = 0 ]; then
    ffplay -i "${fileinput}" -vf "crop=$varW:$varH:$varLM:$varTM"

    kdialog --yesno "Do you want to convert that to a file?"
    if [ "$?" = 0 ]; then
        continue
    else
        kdialog --msgbox "Please try again.\nSettings used this time were:\nWidth = $varW\nHeight = $varH\nCrop from left = $varLM\nCrop from top = $varTM" &
        exit
    fi
elif [ "$?" = 1 ];  then
    kdialog --msgbox "Skipping preview..."
else
    kdialog --error "ERROR";
fi;

kdialog --passivepopup "Converting video
Please be patient" &
ffmpeg -i "$fileinput" -filter:v "crop=$varW:$varH:$varLM:$varTM" -c:a copy "${justpath}/cropped_${justname}"
kdialog --msgbox "Created $varW x $varH video\ncropped $varLM pixels from left and $varTM pixels from the top.\nUsing file $fileinput To ${justpath}/cropped_${justname}"

The second file is the servicemenu file and should be saved to "/opt/trinity/share/apps/konqueror/servicemenus/JimW_Ffmpeg_crop.desktop"

file: JimW_Ffmpeg_crop.desktop

[Desktop Action cropvid]
Exec=ffcrop_for_JimW %u
Icon=
Name=Crop Video File

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
Actions=cropvid
Encoding=UTF-8
X-TDE-ServiceTypes=video/*
Icon=

I have attached the files for easy download, let me know if it might be useful. smile

Last edited by Dai_trying (2017-03-24 15:03)


Attachments:
desktop JimW_Ffmpeg_crop.desktop, Size: 204 B, Downloads: 36
ffcrop_for_JimW, Size: 1.36 KiB, Downloads: 34

Offline

#46 2017-03-25 02:49

JimW
Member
Registered: 2015-12-08
Posts: 202

Re: how to organize kde-servicemenus?

It works.....kinda smile
It suffers the same problem I had the first time I tried with ffmpeg. The quality goes down hill pretty quickly. I found I had to first enlarge it using a q:v 2 quality (which makes an enormous file) then crop it. This kept the resulting quality near the original. But, like I said, it does work!
Thanks for the time you put into it!

Offline

#47 2017-03-25 09:43

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,594
Website

Re: how to organize kde-servicemenus?

No problem JimW I will look at it again and incorporate the quality option (hopefully).

Offline

#48 2017-03-25 10:23

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,594
Website

Re: how to organize kde-servicemenus?

Attached is V2 of the file, it was just a matter of putting the quality option into the ffmpeg command, Looks ok on my system hope it will work for you too. smile


Attachments:
ffcrop_for_JimW, Size: 1.37 KiB, Downloads: 37

Offline

#49 2017-03-25 13:50

JimW
Member
Registered: 2015-12-08
Posts: 202

Re: how to organize kde-servicemenus?

Looks great Dia!
Again, thank you for all the work!

This will save me a lot of time, once I get started putting my game camera videos back up on YouTube again. smile

Offline

#50 2017-03-25 15:08

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,594
Website

Re: how to organize kde-servicemenus?

You're welcome smile and it really wasn't much work.

Offline

Board footer

Powered by FluxBB