Icewm address bar and a scripting question

Booting, installing, newbie
Post Reply
Message
Author
User avatar
willhunt
Posts: 495
Joined: Wed 05 Oct 2005, 18:19

Icewm address bar and a scripting question

#1 Post by willhunt »

I wanted to use the address bar in Icewm so I found the
file /root/.icewm/preferences
and found the line

Code: Select all

# Use double height task bar (highly recommended)
TaskBarDoubleHeight=0 # 0 / 1 changed to 1
Great now I have a address bar! then I found the part

Code: Select all

#Input selection color (Address bar)
ColorInputSelection="rgb:80/80/80"

# Input selection text color (Address bar)
ColorInputSelectionText="rgb:00/00/00"

# Command to run for address bar entries when [Enter] is pressed on the address bar
AddressBarCommand=""  # I changed it to AddressBarCommand="/usr/local/bin/defaultbrowser"
is there a way to use the address bar as a command line?

How about a script that would check to see if it's a command or web address?
then I would just have to change

AddressBarCommand="/usr/local/bin/defaultbrowser"

to

AddressBarCommand="ScriptFileName"

any help would be great as I am clueless

tis better to remain silent and appear a .....................
Last edited by willhunt on Sat 03 Dec 2005, 18:08, edited 1 time in total.

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#2 Post by GuestToo »

if you press ctrl+alt+<spacebar> when running Icewm, you get an address bar at the bottom (or you can set it to always be visible)

if you type a command in the address bar, it will run the command

if you press ctrl+<enter> instead of <enter>, it will run the command in an rxvt window

in preferences, you can configure it to run a program instead of executing ... for example, you can set it to run it with defaultbrowser, so if you type or paste in a url, it will open the url in your browser

one simple way to do what you want is to have a short easy-to-type script or symlink for the program you want to run ... for example, you could have a script called ff that runs Firefox, something like:

#!/bin/sh
exec defaultbrowser "$@"


then you could type something like
ff http://www.pupweb.org

or something like this should do what you want:

Code: Select all

#!/bin/sh
if echo "$@" | grep '^http://'
then
  exec defaultbrowser "$@"
fi
exec "$@"

Post Reply