
Various KDE 1.-4. Improvements
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
This is a simple script to bind F4 (open terminal) to Yakuake (http://www.kde-look.org/content/show.php?content=29153), it slides out Yakuake, creates a new tab in Yakuake and changes to the current dir for the focused Konqueror window.
You'll need to have Yakuake installed before you can use this script.
Supported KIO-slaves
file:// (/ that is)
fish://
How to install
- Put the yakuake-F4 in your $PATH, I've put mine in ~/bin for example.
For kcontrol users (debian for example)
1.a - Make a keyboard shortcut to handle this. You'll find it in Kcontrol->Regional & Accessibility->KHotKeys.
For system settings users (kubuntu for example)
1.b - Make a keyboard shortcut to handle this. You'll find it in system settings->Accessibility->Input Actions
2 - Click "New action" and choose F4 as keyboard shortcut and choose the yakuake-F4-script (where you have put it) under command/url.
TODO
Rename tabs properly
Move to the right dir with fish:// as well
Use Kwallet to pick up passwords (if someone knows how to handle qbytearrays in bash just shout it out=)
15 years ago
0.2.5
Cleaned up the code quite a bit, fixed a miss with sed and spaces (thanks laszlok2).
0.2.4
Added some kind of support for fish://, you get hooked up to the right host but nothing more.
0.2.2
Just adds new tab when dealing with local urls (thanks Marco).
0.2
Check with dcop if Yakuake already runs (thanks laszlok2 and ZeeD).
Don't add new tab if yakuake isn't running when pressing F4.
15 years ago
0.2.5
Cleaned up the code quite a bit, fixed a miss with sed and spaces (thanks laszlok2).
0.2.4
Added some kind of support for fish://, you get hooked up to the right host but nothing more.
0.2.2
Just adds new tab when dealing with local urls (thanks Marco).
0.2
Check with dcop if Yakuake already runs (thanks laszlok2 and ZeeD).
Don't add new tab if yakuake isn't running when pressing F4.
RazZziel
12 years ago
http://rafb.net/p/ltwmoA91.html
Report
Alteran
12 years ago
great work though, just dont like konqueror
Report
noyso
13 years ago
any ideas?
(kubuntu 7.10 + kde 3.5.8 + yakuake 2.8)
Report
noyso
13 years ago
Report
RazZziel
13 years ago
I modified the script:
- Crippled sessions fixed (at least in my yakuake)
- Console is cleared after a local `cd`
- If we are not in a fish:// session. I use simply `pwd` to check the actual directory. It works well even in URLs like media://something (I think the old script didn't work in theese cases, but I haven't tested it.
- Simpler code to extract the fish url, user, host and port (I use only bash built-in variable modifiers)
- Sorry about my poor english
- SSH connections now support directory changes. I did it with "bash -i", but if someone knows a better way to do it, please give feedback
- SHH connections also support port change
- I don't know if this happens in the old version (I suppose it does), but if we don't "cd ~" before opening a new yakuake, all the tabs opened in that yakuake instance will be opened by default in the directory we are browsing in konqueror
- URLs with spaces solved with scaping the double quotes instead of the spaces
I think that the best way to install it is putting it in a directory under the $PATH (like /usr/bin, my ~/.bin didn't work) and set it as the KDE Component for Terminal Emulator, so I added the "-e" switch so it can execute arbitrary commands
TODO:
- Make it compatible with komqueror "Minimize Memory Usage: Always" mode (yeah, I have the code, but don't feel like testing it right now :P)
Script URL: http://raziel.freehostia.com/yakuake-F4
Report
RazZziel
13 years ago
- The "-e" switch works running anything that comes after the "-e". for example, "yakuake-F4 -e ls -la" will open a yakuake and execute "ls -la".
I have selected the script as prefered terminal emulator, and does the work (but you will only notice it if the application you are using tries to use the default kde terminal emulator. I only know two apps that use it: konqueror and kdevelop).
For example, in kdevelop I have configured aterm as default terminal, so when I want to run a project, kdevelop executes "aterm -e /bin/sh -c '/home/raziel/Projects/sc_pong/build/src/sc_pong ; echo "Press Enter to continue!";read dummy'". I've tried to switch in kdevelop to the default KDE terminal (I mean, the one configured in KDE Components, in kcontrol: yakuake-F4 in my system), and it works well (except for the fact that kdevelop echoes a "!", and bash doesn't like it and says "bash: !": event not found" (normal terminals, when running with -e, runs the specified command instead of a shell, and we run the command inside bash))
By the way, I have just realiced that doing
>> tab=`dcop yakuake DCOPInterface selectedSession`
>> dcop yakuake DCOPInterface slotRunCommandInSession $tab "$*"
is the same as doing
>> dcop yakuake DCOPInterface slotRunCommandInSession "$*"
(I mean, if we remove the $tab, yakuake selects the active tab by default)
- The `pwd` works well for me in konqueror. Konqueror, when pressing F4, doesn't give the terminal any parameter. The terminal will be executed in the actual konqueror directory (it's like if you, in an aterm, cd to a directory and then open another aterm from the first aterm, without additional parameters). Yakuake works in the same way, and that's why I have to "cd ~" if a new yakuake is run, and then force a "cd `pwd`"
I tried to print the output of `pwd` before the call to "show_yakuake "cd \"`pwd`\" && clear"", and it works well in my system. Are you sure you have tried it in konqueror, or in any other terminal?
Report
peppelorum
13 years ago
- This "-e"-flag, hos does that work? Can I just switch from Konsole to the script as prefered terminal program or do I have to do something else? Cause when I change nothing happens as far I can tell.
- The show_yakuake "cd \"`pwd`\" && clear"
doesn't work for me at all since `pwd` doesn't return anything in the script for some reason, you can debug with kdialog --msgbox $url for example.
Report
jayenell
14 years ago
Report
itayf
14 years ago
Report
vanaedium
14 years ago
when i push f4 button, the console opens in the right position but normal console and not yakuake.
What I have to do?
I use yakuake kubuntu breezy new package
thanx
Report
rgfree
15 years ago
that this requires a very recent
Yakuake with proper DCOP support.
You will have to compile Yakuake
yourself.
Furthermore: I added a ";clear"
behind the cd statement in order
to have a clean screen and not
a confusing cd statement at the top.
SSH still has some problems here.
It doesnt change into the proper
directory and :22 isnt removed like
in fish://bla.org:22/usr/local
The ":22" is introduced by KDE when
you use the remote places functionality.
The script should remove this but
I'm no sed-expert and my attempts to
fix this were futile.
The SSH support would be great if it
worked. Ive been missing this for
ages in KDE. I'd like to switch
from Konqueror right into the
right folder, already logged in.
Report
jipumarino
15 years ago
for i in $konq; do
windows=`dcop $konq default getWindows|wc -l`
for ((win=1; win
Report
laszlok2
15 years ago
1. The $url2 should pipe the text into sed 's/ /\\ /g' because the g makes sure that all the spaces are escaped -- useful for when the filename has more than one space.
2. Because of the issue with space, in the final if statement:
if [ $url2 ];
this should be instead:
if [ "$url2" ];
so that it isn't false when there is a \ and a space in the string.
Keep up the good work!
Report
peppelorum
15 years ago
//Peppe
Report
vanaedium
15 years ago
any suggestions?
Report
thoand
15 years ago
Report
fungs
15 years ago
I have done so and it works just fine in konqueror.
I don't know where else it is used in kde, but just adding an -e switch to the script would make it compatible to most virtual terminal calls. So this should work quite genericly.
Report
thoand
15 years ago
Report
peppelorum
15 years ago
Report
EazyVG
15 years ago
I would really love this on my desktop.
Thanks.
Report
peppelorum
15 years ago
Report
Ekardnam
15 years ago
Report
laszlok2
15 years ago
Report
laszlok2
15 years ago
if [ "`dcop yakuake yakuake-mainwindow#1 hidden`" != "true" -a "`dcop yakuake yakuake-mainwindow#1 hidden`" != "false" ]; then
yakuake
fi
Report
ZeeD
15 years ago
if `! dcop yakuake >/dev/null 2>/dev/null`; then
yakuake
fi
Report