[Konsole-devel] Fwd: [dot-notify] Personnal menubar in konsole

Waldo Bastian bastian at kde.org
Fri May 9 20:40:48 UTC 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


- ----------  Forwarded Message  ----------

To: notify at kdenews.org
Subject: Personnal menubar in konsole
From: Berthy <cpjc at free.fr>
Date: Friday 09/May/2003, @17:29

Hi,

I've been using konsole for many year and there is a feature I'm still
 looking for : having my own menu bar to launch unix command/script in the
 terminal or in the background.

Eterm is having part of that feature (menu_bar/button_bar in user.cfg)... but
 it's not really kde hmmm, and it's only a part of what I would like.

The aim is obviously to reduce the keyboard typing and constantly moving the
 hand to the mouse, and back to the keyboard, and back to the mouse...

I put after what could be the config file.

Thanks



Menu "Commands"



SubMenu "ls"                  

MenuItem "simple ls"

termexec(ls);             # command ls sent to the terminal

EndMenuItem



MenuItem "ls -al"

get_selection(%myvar);       # get selection (max 1 line/100 caracters) in
 variable %myvar

termexec(ls -al %myvar);       # %myvar and sent the ls command after
 substitution                  

EndMenuItem



MenuItem "ls -aRl"

get_selection(%myvar);       # get selection in variable %myvar

termexec(ls -aRl %myvar);       # %myvar and sent the ls command after
 substitution                  

EndMenuItem

EndSubMenu



SubMenu "rm"                  

MenuItem "rm"

get_selection(%myvar);       # get selection (max 1 line/100 caracters) in
 variable %myvar

get_confirm("Do you really want to delete %myvar ?", %answer);

if(%answer == true)

termexec(rm); # command ls sent to the terminal

else

message("Removing %myvar cancelled");   # dialog box with OK

show_status("Removing %myvar cancelled"); # or show a message in a status
 line

endif

EndMenuItem



MenuItem "rm -fr"

get_selection(%myvar);       # get selection (max 1 line/100 caracters) in
 variable %myvar

termexec(rm -fr %myvar);       # %myvar and sent the command after
 substitution                  

EndMenuItem      

EndSubMenu



MenuItem "cd"      

get_selection(%myvar);       # get selection (max 1 line/100 caracters) in
 %myvar

termexec(cd %myvar);       # %myvar and sent the command after substitution  
                

EndMenuItem      



MenuItem "man"

get_entry("Which command : ", %entry);       # dialog-box to get user entry
 in %entry

termexec(man %entry);                   # launch man %entry

EndMenuItem



MenuItem "konqueror"

exec(konqueror); # launch konqueror in the background

EndMenuItem



MenuItem "Exit"

exit();                   # internal command exit

EndMenuItem



EndMenu



Menu "Remote"

MenuItem "telnet"

get_choicelist("mickey", "dingo", "michael", %server);       # list of
 servers and pick one

termexec(telnet %server);             # command ls sent to the terminal

EndMenuItem



MenuItem "ssh"

get_choicelist("mickey", "dingo", "michael", %server);       # list of
 servers and pick one

termexec(ssh %server);             # command ls sent to the terminal

EndMenuItem

EndMenu



Menu "Help"       # Menu/button with no item

help();       # Only an internal command showing help

EndMenu

- -------------------------------------------------------

- -- 
bastian at kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian at suse.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+vBJVN4pvrENfboIRAtXuAJ9K6T82LLGhoAeQl3n6jEYgTymFxACfcffF
rLVp4b0e/LPm5nK/692RbHs=
=nn/k
-----END PGP SIGNATURE-----



More information about the konsole-devel mailing list