This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to start kate with options by clicking a desktop file

Tags: None
(comma "," separated)
User avatar
jcdole
Registered Member
Posts
49
Karma
0
OS
hello.
I would like to start kate from a desktop file using qt5 options :
-qwindowtitle title
-qwindowgeometry geometry ( or -geometry geometry )

The desktop file start a script '$USB_ROOT_DIR/00_MAKE_INSTALL/edit_make_install_edit.sh' that build a list of file to edit.
Code: Select all
[Desktop Entry]
Comment[en_US]=edit make install edit
Comment=edit make install edit
Exec=if [ -d /media/NEW_INSTALL_LINUX_USB ] ; then export USB_ROOT_DIR=/media/NEW_INSTALL_LINUX_USB ;  elif  [ -d /run/media/$(logname)/NEW_INSTALL_LINUX_USB ] ; then  export USB_ROOT_DIR=/run/media/$(logname)/NEW_INSTALL_LINUX_USB ;  else  kdialog --sorry "USB seems not to be mounted"  ;  fi  ;  $USB_ROOT_DIR/00_MAKE_INSTALL/edit_make_install_edit.sh
GenericName[en_US]=edit make install edit
GenericName=edit make install edit
Icon=author
MimeType=
Name[en_US]=edit make install edit
Name=edit make install edit
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=


Ounce the list is built, kate is started with the command :

Code: Select all
.....
......
.......
THE_LIST="$LIST_1A""$LIST_1B""$LIST_1C""$LIST_3""$LIST_4""$LIST_5""$LIST_6""$LIST_13""$LIST_14"

xdg-su -c "kate $THE_LIST"


I made a test with a direct command in the exec parameter, but unable to set the size of the window :
Code: Select all
[Desktop Entry]
Comment[en_US]=TEST GEOMETRY 4
Comment=TEST GEOMETRY 4
Exec=kate -geometry 1600x150+100+100 ~/test_001.sh
GenericName[en_US]=TEST GEOMETRY 4
GenericName=TEST GEOMETRY 4
Icon=system-run
MimeType=
Name[en_US]=TEST GEOMETRY 4
Name=TEST GEOMETRY 4
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

But only the position is taken into account.
The size is the size of the previously open window.

Any help is welcome.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
Hi!

No idea what you try to do, but kate has no option "-geometry", at least not in my installation. There is
Code: Select all
kate --qwindowgeometry 1600x150+100+100
which works as expected.

Next: running kate as root is error prone and not supported (as Qt does not support running GUI-stuff as root). Open the file as user and enter your password on saving. This requires the KatePart.policy available in PolicyKit or the usermode-workaround in RedHat-based distros.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell