Author Topic: Unix menu program  (Read 3541 times)

Kintaro

  • Member
  • **
  • Posts: 6,545
  • Kudos: 255
  • I want to get the band back together!
    • JohnTate.org
Unix menu program
« on: 28 March 2003, 12:10 »

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
Unix menu program
« Reply #1 on: 28 March 2003, 13:32 »
actually i think it's good! obviously, it's not very complex, but it does the job and that's excellent.

i didn't read the source code yet, but i have a couple of comments regarding usability that may or may not be of interest to you. they are both minor.

1) i installed menu on a system with no 'pine' installed, and of course when i selected pine, it didn't open. however i would like to see an error message be displayed when a program cannot be run. this may not be an issue to you since you know that all those programs are installed on the machine you will have it running on.

2) to exit, i had to type a captial X. with the other menu entries, small letters were okay, but with exit, it had to be a capital. this isn't major, but is an inconsistency with the interface.

also, there's an aesthetic consideration regarding what the entries are called. this one should be really simple to change, all i propose is that the menu entries contain terse description of what the program does and how to get back to the menu. example:

p) pine - mail reader - type 'ctrl-q' to return to menu
l) lynx - browser - type 'q' to return to menu
b) bash - command prompt - type 'exit' to return to menu

that sort of thing. also, if the system uses bash instead of sh or ash, i think the menu should say what shell it actually uses. it is possible that my system just symlinks sh to bash so that's why i got bash instead of sh, as i say i didn't read the code yet so i don't know.

just my thoughts. i might actually use that for my own "desktop", when not using a gui, instead of just having a bash prompt. if i do ever use it and modify it, i'll email you a copy of the new one.

edit: oh yes, btw, maybe 'install' could take some options about where to put the executable, just a thought, i don't know how to code so i don't know how difficult this is, also, it's only two files or something so they would be easy to move after installation, but still...

[ March 28, 2003: Message edited by: Calum: crusader for justice & peace ]

visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism

smokey

  • Member
  • **
  • Posts: 183
  • Kudos: 0
Unix menu program
« Reply #2 on: 28 March 2003, 16:01 »
i tested your app and fixed the bug (exit) which does not really deserve mention but   :D  

Code: [Select]


Info for callum
All it does is accept input with this line

Code: [Select]

the command are run with this command

Code: [Select]

for example to run lynx the code is
Code: [Select]

this function is provided in the standard header stdlib.h

just thought it might help...
a little...
//this is how I was born :)

cat /dev/urandom > /dev/mybrain

Tip for win98 (l)users: type copy /con/con in your command prompt to increase stability


Kintaro

  • Member
  • **
  • Posts: 6,545
  • Kudos: 255
  • I want to get the band back together!
    • JohnTate.org
Unix menu program
« Reply #3 on: 28 March 2003, 17:54 »
Well thanks Calum, and there was a reason why the exit command only worked with a capital X. But fork it all you want as nobody owns it.

I made it because, when I get the wireless networking I will be hosting shell accounts to Melbourne Wireless in the near future.

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
Unix menu program
« Reply #4 on: 28 March 2003, 18:05 »
what's the reason? (for the X)
visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism

Kintaro

  • Member
  • **
  • Posts: 6,545
  • Kudos: 255
  • I want to get the band back together!
    • JohnTate.org
Unix menu program
« Reply #5 on: 28 March 2003, 18:17 »
because somone might press x instead of c (being right next to the x key) so you have to hold shift for it.

flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
Unix menu program
« Reply #6 on: 28 March 2003, 21:06 »
This:

Code: [Select]

would be better written as a for loop:

Code: [Select]

You could do all this more easily as a shell script btw.
"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca


Kintaro

  • Member
  • **
  • Posts: 6,545
  • Kudos: 255
  • I want to get the band back together!
    • JohnTate.org
Unix menu program
« Reply #7 on: 29 March 2003, 10:54 »
I might make a curses port but then I also plan on using it on a line printing terminal.

But I think I'll to a curses port of it.

1 reason why its not a shell script is that if its compiled I can stop users from adding certain things to the menu, and exploiting it as easily.

If I wanted I could take the shell option out and the mc option limiting users ability to fiddle with the system (Windows style security really).

There was a few other reasons, but now I might start work on a curses port.

Kintaro

  • Member
  • **
  • Posts: 6,545
  • Kudos: 255
  • I want to get the band back together!
    • JohnTate.org
Unix menu program
« Reply #8 on: 29 March 2003, 10:57 »
quote:
Source Originally posted by matthew : /dev/urandom:

Code: [Select]
[/b]


Code: [Select]
That would be better.

slave

  • Member
  • **
  • Posts: 1,136
  • Kudos: 0
    • http://www.fuckmicrosoft.com
Unix menu program
« Reply #9 on: 29 March 2003, 21:45 »
http://www.insanebaboon.netfirms.com/cmenu.tgz

I added color and some other junk.

I fixed a bug where calling bash didn't exit curses mode so the bash terminal was kinda funky.  Some silly file stuff too, just for fun.

Download it!!

[ March 29, 2003: Message edited by: Linux User #5225982375 ]


slave

  • Member
  • **
  • Posts: 1,136
  • Kudos: 0
    • http://www.fuckmicrosoft.com
Unix menu program
« Reply #10 on: 29 March 2003, 21:46 »
You know what would be cool is to have an option for the user to set the colors himself, and it saves the option in a file somewhere.

Edit:  oops I see I posted in the wrong thread.

[ March 29, 2003: Message edited by: Linux User #5225982375 ]

[ March 29, 2003: Message edited by: Linux User #5225982375 ]


Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
Unix menu program
« Reply #11 on: 2 April 2003, 16:37 »
i am trying to modify the menu to work exactly how i want it to, but i cannot download the file you linked to above because external linking is not allowed with netfirms. can you embed a link to it in an html page and post the link to the html page please?

thanks.
i will upload my finished version once i have, well, finished it.
visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism

choasforages

  • VIP
  • Member
  • ***
  • Posts: 1,729
  • Kudos: 7
    • http://it died
Unix menu program
« Reply #12 on: 2 April 2003, 16:54 »
what about securing it up a bit and makeing it read a . file in the user homedirectory or a system wide /etc file thus allowing full custimizablilty of the menu and also allow for the system administrator to lock it down and only allow certian apps to be run.
though it looks like something would like to use and ill have to look into what i just said during school, and try to hack it up.
x86: a hack on a hack of a hackway
alpha, hewlett packed it A-way
ppc: the fruity way
mips: the graphical way
sparc: the sunny way
4:20.....forget the DMCA for a while!!!

flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
Unix menu program
« Reply #13 on: 2 April 2003, 18:41 »
quote:
Originally posted by X11:
1 reason why its not a shell script is that if its compiled I can stop users from adding certain things to the menu, and exploiting it as easily.


Surely they won't have write access to it? And it won't be exploitable unless it runs as a different user.
"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca


Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
Unix menu program
« Reply #14 on: 2 April 2003, 19:22 »
you are totally correct about that, i can't think what he means by saying it's more secure if it's not a script.

personally i am totally mr no-clue when it comes to programming, all i will be doing is tightening up the interface and writing better docs for the program, i did already make one based on x11's cmenu.tar.gz which can be found here:

http://www.polytheism.org.uk/files/cmenu-2c.zip
(yes it is a zip file, sorry, i am at work and don't have a tarball capable archive tool here. just use 'unzip' instead of 'tar -xvzf', it won't hurt just this once.  ;)  )

but i wanted to get linux user's one too because i wanted to incorporate his fix for the 'shell' entry not working properly when selected. there's also another bug in my one regarding pico, but see the changelog and the TODO files for that.

[ April 02, 2003: Message edited by: Calum: crusader for peace & freedom ]

visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism