You are not logged in.

#1 2013-11-06 14:30:32

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

KDE - Script acts differently when run from khotkeys

so, i have this little test script:

#!/bin/bash


# SET THIS TO YOUR SSH_SERVER:/PATH
ulhost_vid=proteus:~/public_html/vid


function notify_ul() {
    if [[ -n "$dunst_fg" ]]
        then notify-send -u low -h string:bgcolor:$dunst_bg -h string:fgcolor:$dunst_fg --hint=int:transient:1 -t ${1} "Scrot" "${2}\n$(xclip -o)"
    else
        notify-send -u low --hint=int:transient:1 -t ${1} "Scrot" "${2}\n$(xclip -o)"
    fi
}


# Some variables  -  do not change those for testing
time=3000
url_vid=http://SOME_SERVER    #not important for testing
ul_vid="scp $HOME/bla.file $ulhost_vid && echo -n "$url_vid/$(echo "bla.file")" | xclip"
x_clip="(xclip -o) | xclip -selection clipboard"


# start of script
dd if=/dev/zero of=$HOME/bla.file bs=1k count=500
eval $ul_vid
eval $x_clip
notify_ul ${time} "Screencast uploaded"

of course the $ulhost_vid variable needs to be set. when i run this from a terminal, it will create a file with 500kb, upload it and give me a notitication with text "http://SOME_SERVER/bla.file"
but when i run the same thing with a hotkey via khotkeys, it will only create the file. no upload and the notification will simply show the last active clipboard content.

Any clue what might cause this?


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#2 2013-11-06 15:15:35

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: KDE - Script acts differently when run from khotkeys

ok, i found out, its kdm. it does not see my keychain ssh keys. no clue how to fix this. tried all possible options from archwiki. (~/.kde4/env script does exist)


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

Board footer

Powered by FluxBB