Script kgtk-wrapper doesn't work
sr-tream opened this issue · comments
This script don't start any program
kgtk-wrapper gimp
kgtk-wrapper palemoon
I have to manually specify LD_PRELOAD
Hmm, it work, if I try use kgtk-wrapper gimp gimp
. It a feature?
kgtk-wrapper gimp
works for me. The output of bash -x kgtk-wrapper gimp
could help debug the shell script.
Err, the shebang in kgtk-wrapper
should cause the code to be executed by bash, not zsh.
$ head -n 1 $(which kgtk-wrapper)
#!/bin/bash
$ which bash
/bin/bash
Try the following: Edit the kgtk-wrapper
script (with sudo or as root) and put the following code into the second line (after the shebang):
set -x
Let's see what happens when you execute kgtk-wrapper gimp
then.
~ ❯ bash
[sr-tream@archlinux ~]$ kgtk-wrapper /usr/bin/gimp
+ case "$KDE_SESSION_VERSION" in
+ KRC=kreadconfig5
+ LIBSUFF=.5
++ locale
++ grep LANG=
++ grep -i utf-8
++ wc -l
+ '[' 1 = 0 ']'
++ basename /usr/local/bin/kgtk-wrapper
+ app=kgtk-wrapper
+ useApp=1
+ '[' kgtk-wrapper = kgtk-wrapper ']'
++ basename /usr/bin/gimp
+ app=gimp
+ shift
+ useApp=0
+++ dirname /usr/local/bin/kgtk-wrapper
++ cd /usr/local/bin
++ pwd
+ dir=/usr/local/bin
+ '[' 0 -eq 1 ']'
+ case "$app" in
++ which gimp
+ realApp=/usr/local/bin/gimp
+ '[' -z /usr/local/bin/gimp ']'
+ '[' 0 -eq 1 ']'
++ kreadconfig5 --file kgtkrc --group Apps --key gimp
+ toolkit=
+ '[' '' = '' ']'
+ case $app in
+ toolkit=gtk2
+ '[' gtk2 = '' ']'
+ '[' gtk2 = x ']'
+ '[' '!' -f /usr/local/lib64/kgtk/libkgtk2.so.5 ']'
+ export LD_PRELOAD=/usr/local/lib64/kgtk/libkgtk2.so.5:
+ LD_PRELOAD=/usr/local/lib64/kgtk/libkgtk2.so.5:
+ '[' -n 0 ']'
++ dirname /usr/local/bin/gimp
+ '[' /usr/local/bin '!=' /usr/local/bin ']'
+ exec
This reveals that you specify /usr/bin/gimp
, but the script executes /usr/local/bin/gimp
. This is a bug.
I don't understand the purpose of some lines in kgtk-wrapper
. Well, I've simplified it a bit, and I think I fixed your problem. Could you try it?
but the script executes /usr/local/bin/gimp
err, no. the script executes nothing:
+ '[' /usr/local/bin '!=' /usr/local/bin ']'
+ exec
This is why kgtk-wrapper gimp gimp
(gimp twice) works for you ;)
Now it correctly work