Re: Wireless Network GUI
On Wed, 13 Oct 2010, Christiano F. Haesbaert wrote: From: Christiano F. Haesbaert haesba...@haesbaert.org To: OpenBSD Questions misc@openbsd.org Date: Wed, 13 Oct 2010 17:17:16 Subject: Re: Wireless Network GUI I use this silly script for wireless if someone is interested: http://github.com/haesbaert/scripts/blob/master/wifi Pau Amaro-Seoane's wifiprobe script, posted to this mailing list in 2007, is useful. See: http://marc.info/?l=openbsd-miscm=119442609818795w=2 http://marc.info/?l=openbsd-miscm=119611252029773w=2 Also see the undeadly article from D. Adam Karin: http://undeadly.org/cgi?action=articlesid=20071224164233 which is shows a useful method of connecting to known wireless networks at boot time. Here at work I can often see several available wireless connection points. So I've tweaked the above script to connect to the one with the strongest signal. Here's what I've run on my venerable T23 Thinkpad running OpenBSD4.7. It's a shell archive. Note you'll need to make the /etc/rc.wireless script executable. # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering sh file. Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # netstart.diffs # rc.wireless # rc.wireless.conf # echo x - netstart.diffs sed 's/^X//' netstart.diffs 'END-of-netstart.diffs' X--- netstart.orig Thu Mar 18 02:31:37 2010 X+++ netstart Tue Aug 31 12:42:08 2010 X@@ -174,6 +174,12 @@ X # Re-read /etc/rc.conf X . /etc/rc.conf X X+# Wireless configuration, if present and known. X+if [ -f /etc/rc.wireless -a -x /etc/rc.wireless \ X+ -a X$1 = Xautoboot ] ; then X+ /etc/rc.wireless X+fi X+ X # If we were invoked with a list of interface names, just reconfigure these X # interfaces (or bridges) and return. X if [ $1x = autobootx ]; then END-of-netstart.diffs echo x - rc.wireless sed 's/^X//' rc.wireless 'END-of-rc.wireless' X#!/bin/sh X X# This script is executed by /etc/netstart when booting. It X# does the following: X# X# (1) extracts wifi card DHCP parameters from X# /etc/rc.wireless.conf X# X# (2) Performs a wifi scan looking for available wireless networks X# X# (3) Compares available wireless networks with those preconfigured X# in /etc/rc.wireless.conf X# X# (4) Stores the details for any known network in /etc/hostname.if. X# If there's more than one network, the one with the strongest X# signal is chosen. X# X# This script can also be used in stand-alone mode, X# /etc/rc.wireless followed by sh /etc/netstart {interface-name}. X# So for removable wifi devices this script could form part of a X# hotplugd script to connect to known wifi networks. X XIFS=' X' X X# Commands we'll use. Xcp=/bin/cp Xecho=/bin/echo Xifconfig=/sbin/ifconfig Xmktemp=/usr/bin/mktemp Xrm=/bin/rm Xsed=/usr/bin/sed Xsort=/usr/bin/sort X X# Make sure we have a configuration file... XCONF=/etc/rc.wireless.conf X[ -r $CONF ] || exit 1 X X# ...that contains an interface name... XIFNAME=$($sed -ne 's/^#wifi[[:space:]]IFNAME=\(.*\)$/\1/p' $CONF) X[ -n $IFNAME ] || exit 1 X X# ...that's plugged in. X$ifconfig $IFNAME /dev/null 21 || exit 1 X X# Reset the wifi device if there's a command to do this. XRESET=$($sed -ne 's/^#wifi[[:space:]]RESET=\(.*\)$/\1/p' $CONF) X[ -n $RESET ] { $ifconfig $IFNAME $RESET /dev/null 21; } X X# If present, note the wifi device's MAC address. It isn't crucial X# that we have this. XMAC_ADDR=$($sed -ne 's/^#wifi[[:space:]]MAC_ADDR=\(.*\)$/\1/p' $CONF) X X# Set DHCP parameters. Use default values if nothing is set in our X# configuration file. XDHCP=$($sed -ne 's/^#wifi[[:space:]]DHCP=\(.*\)$/\1/p' $CONF) XDHCP=${DHCP:-dhcp NONE NONE NONE} X X# Delete any existing hostname.if file. XHFILE=/etc/hostname.$IFNAME X$rm -fP $HFILE X X# Temporary file. Note the permissions (-rw---) on this file X# are *exactly* as required. XTFILE=$($mktemp) X X# Wireless scan picking out any access points known to us. X$ifconfig $IFNAME scan | \ X$sed -ne 's/^.*\(..:..:..:..:..:..\) \([0-9]*\).*$/\1 \2/p' | \ Xwhile read MAC STRENGTH Xdo X. $CONF { X XDATA=$STRENGTH X X[ -n $NWID ]DATA=$DATA nwid \$NWID\ X X[ -n $BSSID ] DATA=$DATA bssid $BSSID X X[ -n $CHAN ]DATA=$DATA chan $CHAN X X[ -n $NWKEY ] DATA=$DATA nwkey $NWKEY X X[ -n $WPAKEY ] DATA=$DATA wpa wpask $WPAKEY X X$echo $DATA $TFILE X} Xdone X X# Make sure our temporary file gets deleted. Xtrap $rm -fP $TFILE; trap - EXIT ERR HUP INT TERM X X# Check we have at least one known access point. X[ -s $TFILE ] || exit 0 X X# Pick out the access point with the strongest signal. XDATA=$($sort -n -r $TFILE | $sed -ne 's/^[0-9]* \(.*\)$/\1/p' -e 1q) X X# Finally set up our hostname.if file... X$echo $DHCP $DATA $TFILE X X# ...and copy it to the right place. X[ -s $TFILE ] $cp -p
Re: Wireless Network GUI
I use this silly script for wireless if someone is interested: http://github.com/haesbaert/scripts/blob/master/wifi
Re: Wireless Network GUI
Giving up, my old curses code is too gross... better sent it to /dev/null. The only usable thing would be this piece, wrappers for adding/deleting ipv4/6 addresses. Might be useful even for python people, if they change err() for something they'd like. http://sztorkie.steadynet.org/files/temp/wrapper_to_add_if_addrs.c Examples are down there: ifaces_change_ipv4(vether0, 192.168.192.168, 27, NULL, ADDR_DELETE); ifaces_change_ipv6(em0, dead:beef:cafe::1, 78, 15, 30, ADDR_ADD); Who knows, maybe I'll start to play with some GUI again, but now there are more important things to do. Feel free to comment. -- Martin Pelikan
Re: Wireless Network GUI
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/07/2010 11:58 AM, Edho P Arief wrote: On Thu, Oct 7, 2010 at 9:04 AM, Hugo Osvaldo Barrera h...@osvaldobarrera.com.ar wrote: I want to make a small desktop application (probably GTK+, since I've never done anything in GTK) that shows available wireless networks, signal, and a few buttons to connect to each/configure each. I don't intend to make a huge daemon like the linux's NetworkManager, but, instead, just a simple application you open, connect, and close. Done. B No bloat, and definitely ***NO*** requirement for stuff like HAL. I wanted to get a few pointers before I started: 1) First of all, I want to be sure no one's already working on something like this. wicd is as small as network gui I can find in linux. Also I believe pc-bsd made their own version of network gui. It probably depends on kde or qt though. http://wicd.sourceforge.net/ nope , wicd is actually based on gtk python , also wicd-client for kde available on kde-apps.org. ( written in qt4 ) Haven't tried though on *bsd's. - -- Best Regards, Aaron Lewis - PGP: 0xDFE6C29E Key Server: http://keyserver.veridis.com Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E No HTML shits , thanks. Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJMrW0YAAoJECSSp9Df5sKeDY0QALf2/K1A8/kRVP2+grQqPRHt fE7vdfIbjp4NVakUQDG77+HP0Pk2U/BQFC0UNEumS2v1pG1Z+HgudCqXJ/uqoe2d WFyNdeGlVpJ4ZEen4OpjXRd+ktXUaf6TSmy0b1ya9pvPJ0RrACSzrJl4jxtUfQQi xk0FutLlGXkZv/aTH1zHTMw0vLPdz4eMQNcr2sOHYriNFUjYFgZeomag9dxebViQ hZXTzBtRjYzQLlc8/8oU1o0hiImOToaCB4XSCdCjHGTD4dvlv3qhBA9tZ+Pa2lOw 9TS/2Wyqd4YmpQiOhnICin98HJ5M65W5jUZiFqB1IzUJFuekZixGczv4DXKa7sWx IfQvhDRa9kClKtk3UXP9y2lbHDgxthBo/NTuLBkrNwraTDl/MyO7IqKqKdguTom7 iEkIflSdll6P7ixI40QRRjxOSFbmFYhgS/qcVrWBCKI5E6j0kueQMlU2d1aUGrAr Kt68A5D+fGkx9Wmkq5rVhi1MdpvRjuZmPOaoKnhyI5+BdcvZ3J/Ha9OJEUwzSPAq XAF0mmI/8V3/75l4nuQUNamDBOggCjujYB4ZKpPQQRPq2eO5+NVMf6aFnCQSVB1O /MkzdaXgjOHjJ4M4ciBLwBNb9Wq+Jwr77AiNtDGHoDNuXHLtKTDUXjNDYZH4YJxV mvVPIWuh0WV089ocZk1W =KN8f -END PGP SIGNATURE-
Re: Wireless Network GUI
On Thu, Oct 7, 2010 at 1:47 PM, Aaron Lewis the.warl0ck.1...@gmail.com wrote: nope , wicd is actually based on gtk python , also wicd-client for kde available on kde-apps.org. ( written in qt4 ) Sorry, I didn't properly composed the paragraph. I actually mentioned two network manager gui applications: - wicd - whatever default in PC-BSD (which uses qt or kde) -- O ascii ribbon campaign - stop html mail - www.asciiribbon.org
Re: Wireless Network GUI
On Thu, 7 Oct 2010 14:10:53 +0700, Edho P Arief edhopr...@gmail.com wrote: On Thu, Oct 7, 2010 at 1:47 PM, Aaron Lewis the.warl0ck.1...@gmail.com wrote: nope , wicd is actually based on gtk python , also wicd-client for kde available on kde-apps.org. ( written in qt4 ) Sorry, I didn't properly composed the paragraph. I actually mentioned two network manager gui applications: - wicd - whatever default in PC-BSD (which uses qt or kde) Hi there, I planed to start a tool like that. It's funny because I think to make this in PyGTK 2 ;) In my opinion wicd is only for Linux use, and it's better to start a new project for OpenBSD : 1 - Learn 2 - Put this project in a real license :) (BSD of course, without ads) Question : If the project become stable, it'll be possible to integrate the officials OpenBSD repository (ports and packages) ? Regards, Guillaume.
Re: Wireless Network GUI
2010/10/7 Guillaume Duali g.du...@otasc.org: Hi there, I planed to start a tool like that. It's funny because I think to make this in PyGTK 2 ;) In my opinion wicd is only for Linux use, and it's better to start a new project for OpenBSD : 1 - Learn 2 - Put this project in a real license :) (BSD of course, without ads) Question : If the project become stable, it'll be possible to integrate the officials OpenBSD repository (ports and packages) ? Of course. Start coding this tool and we'll see ;) ciao, david
Re: Wireless Network GUI
2010/10/7 Martin PelikC!n martin.peli...@gmail.com: 2010/10/7, Hugo Osvaldo Barrera h...@osvaldobarrera.com.ar: I don't intend to make a huge daemon like the linux's NetworkManager, but, instead, just a simple application you open, connect, and close. Done. B No bloat, and definitely ***NO*** requirement for stuff like HAL. Amen. I wanted to get a few pointers before I started: 1) First of all, I want to be sure no one's already working on something like this. I occasionaly develop one for ncurses. But don't feel any special need for it, pfctl mostly works just fine. Oh, and it focuses more on pf(4) manupulation rather than wireless (but it's modular). 2) I initially considered just parsing the output of ifconfig . This does seem rather hackish, but would get the job done fast and can still be very maintainable code. B However, what's the proper alternative (just a few pointer to know what to start reading will do) to do this sort of this. man getifaddrs man style Please, do NOT parse ifconfig output and invest the work into proper C code. You'll hopefully learn some stuff at least and you have higher chance you won't write crap. Many people have been there. Just don't. -- Martin Pelikan Thanks, using man getifaddrs, I've managed to find some pretty valuable information (and will probably find most of what I need with enough time). Gotta love OpenBSD's man documentation. Again, thanks :-) @Edho: I don't think wicd would work. It uses wpa_supplicant, and some other linux-only stuff as backend. I haven't been able to find much on PCBSD's doc, it seems their standards for documentation are quite low, for example, see: http://wiki.pcbsd.org/index.php/PC-BSD_FAQS#Networking or http://wiki.pcbsd.org/index.php/Wireless_Settings From what I've seen on just screenshots, It's probably QT based. But I'll download it tonight and take a look, there might be some useful parts, at least for studying. @Guillaume: I was considering Python, but since I need to call system functions, it's either going to be C or Python calling a C module, the latter being more likely, since I could learn more, and still use python for the front-end. Tell me if you're interested on doing something, we might be able to help each other :) -- Hugo Osvaldo Barrera
Re: Wireless Network GUI
On Thu, Oct 7, 2010 at 1:06 PM, Hugo Osvaldo Barrera h...@osvaldobarrera.com.ar wrote: I haven't been able to find much on PCBSD's doc, it seems their standards for documentation are quite low, for example, see: http://wiki.pcbsd.org/index.php/PC-BSD_FAQS#Networking or http://wiki.pcbsd.org/index.php/Wireless_Settings From what I've seen on just screenshots, It's probably QT based. But I'll download it tonight and take a look, there might be some useful parts, at least for studying. http://www.freebsd.org/cgi/cvsweb.cgi/ports/net/pcbsd-netmanager/ It uses kde4 libraries. So, it's a no way for now... ciao, david
Re: Wireless Network GUI
2010/10/7 Martin PelikC!n martin.peli...@gmail.com: 2010/10/7, Hugo Osvaldo Barrera h...@osvaldobarrera.com.ar: I don't intend to make a huge daemon like the linux's NetworkManager, but, instead, just a simple application you open, connect, and close. Done. B No bloat, and definitely ***NO*** requirement for stuff like HAL. Amen. I wanted to get a few pointers before I started: 1) First of all, I want to be sure no one's already working on something like this. I occasionaly develop one for ncurses. But don't feel any special need for it, pfctl mostly works just fine. Oh, and it focuses more on pf(4) manupulation rather than wireless (but it's modular). 2) I initially considered just parsing the output of ifconfig . This does seem rather hackish, but would get the job done fast and can still be very maintainable code. B However, what's the proper alternative (just a few pointer to know what to start reading will do) to do this sort of this. man getifaddrs man style Please, do NOT parse ifconfig output and invest the work into proper C code. You'll hopefully learn some stuff at least and you have higher chance you won't write crap. Many people have been there. Just don't. -- Martin Pelikan Thanks, using man getifaddrs, I've managed to find some pretty valuable information (and will probably find most of what I need with enough time). Gotta love OpenBSD's man documentation. Again, thanks :-) @Edho: I don't think wicd would work. It uses wpa_supplicant, and some other linux-only stuff as backend. I haven't been able to find much on PCBSD's doc, it seems their standards for documentation are quite low, for example, see: http://wiki.pcbsd.org/index.php/PC-BSD_FAQS#Networking or http://wiki.pcbsd.org/index.php/Wireless_Settings From what I've seen on just screenshots, It's probably QT based. But I'll download it tonight and take a look, there might be some useful parts, at least for studying. @Guillaume: I was considering Python, but since I need to call system functions, it's either going to be C or Python calling a C module, the latter being more likely, since I could learn more, and still use python for the front-end. Tell me if you're interested on doing something, we might be able to help each other :) Hi Hugo, If I understand you think to combine C et Python ? Do you think is good to code the tool in C in shell only interface, and add the graphical front-end in Python. In this case Python will call on each clik the C binary with parameter, like : ./assistant --list-wireless-network It's a good idea -- Hugo Osvaldo Barrera
Re: Wireless Network GUI
2010/10/7 Martin PelikC!n martin.peli...@gmail.com: 2010/10/7, Hugo Osvaldo Barrera h...@osvaldobarrera.com.ar: I don't intend to make a huge daemon like the linux's NetworkManager, but, instead, just a simple application you open, connect, and close. Done. B No bloat, and definitely ***NO*** requirement for stuff like HAL. Amen. I wanted to get a few pointers before I started: 1) First of all, I want to be sure no one's already working on something like this. I occasionaly develop one for ncurses. But don't feel any special need for it, pfctl mostly works just fine. Oh, and it focuses more on pf(4) manupulation rather than wireless (but it's modular). 2) I initially considered just parsing the output of ifconfig . This does seem rather hackish, but would get the job done fast and can still be very maintainable code. B However, what's the proper alternative (just a few pointer to know what to start reading will do) to do this sort of this. man getifaddrs man style Please, do NOT parse ifconfig output and invest the work into proper C code. You'll hopefully learn some stuff at least and you have higher chance you won't write crap. Many people have been there. Just don't. -- Martin Pelikan Thanks, using man getifaddrs, I've managed to find some pretty valuable information (and will probably find most of what I need with enough time). Gotta love OpenBSD's man documentation. Again, thanks :-) @Edho: I don't think wicd would work. It uses wpa_supplicant, and some other linux-only stuff as backend. I haven't been able to find much on PCBSD's doc, it seems their standards for documentation are quite low, for example, see: http://wiki.pcbsd.org/index.php/PC-BSD_FAQS#Networking or http://wiki.pcbsd.org/index.php/Wireless_Settings From what I've seen on just screenshots, It's probably QT based. But I'll download it tonight and take a look, there might be some useful parts, at least for studying. @Guillaume: I was considering Python, but since I need to call system functions, it's either going to be C or Python calling a C module, the latter being more likely, since I could learn more, and still use python for the front-end. Tell me if you're interested on doing something, we might be able to help each other :) Hi Hugo, If I understand you think to combine C and Python ? Do you think is good to code the tool in C, with only shell interface, and add the graphical front-end in Python ? In this case Python will call on each click the C binary with parameter, like : ./assistant --list-wireless-network It's a good idea [G! keyboard shortcut :p] So, it's a good idea if we work together on this project if you are ok ? Regards, Guillaume. -- Hugo Osvaldo Barrera
Re: Wireless Network GUI
On Thu, Oct 07, 2010 at 01:34:50PM +0200, g.du...@otasc.org wrote: If I understand you think to combine C and Python ? Do you think is good to code the tool in C, with only shell interface, and add the graphical front-end in Python ? In this case Python will call on each click the C binary with parameter, like : ./assistant --list-wireless-network It's a good idea [G! keyboard shortcut :p] So, it's a good idea if we work together on this project if you are ok ? You *are* aware that you can combine Python and C code fairly easily, right? There is no real need to shell out for every command... Joachim -- TFMotD: perlartistic (1) - the Perl Artistic License http://www.joachimschipper.nl/
Re: Wireless Network GUI
Why not make a curses GUI ? I find it much more useful than gtk/qt (IMHO).
Re: Wireless Network GUI
On Thu, 7 Oct 2010 14:20:31 +0200, Joachim Schipper joac...@joachimschipper.nl wrote: On Thu, Oct 07, 2010 at 01:34:50PM +0200, g.du...@otasc.org wrote: If I understand you think to combine C and Python ? Do you think is good to code the tool in C, with only shell interface, and add the graphical front-end in Python ? In this case Python will call on each click the C binary with parameter, like : ./assistant --list-wireless-network It's a good idea [G! keyboard shortcut :p] So, it's a good idea if we work together on this project if you are ok ? You *are* aware that you can combine Python and C code fairly easily, right? There is no real need to shell out for every command... Joachim Hi, I didn't know it. I will learn :) If you have some interesting links about it, I appreciate. Thanks, Guillaume.
Re: Wireless Network GUI
On Thu, 07 Oct 2010 14:35:43 +0200, Guillaume DualC) g.du...@otasc.org wrote: On Thu, 7 Oct 2010 14:20:31 +0200, Joachim Schipper joac...@joachimschipper.nl wrote: On Thu, Oct 07, 2010 at 01:34:50PM +0200, g.du...@otasc.org wrote: If I understand you think to combine C and Python ? Do you think is good to code the tool in C, with only shell interface, and add the graphical front-end in Python ? In this case Python will call on each click the C binary with parameter, like : ./assistant --list-wireless-network It's a good idea [G! keyboard shortcut :p] So, it's a good idea if we work together on this project if you are ok ? You *are* aware that you can combine Python and C code fairly easily, right? There is no real need to shell out for every command... Joachim Hi, I didn't know it. I will learn :) If you have some interesting links about it, I appreciate. Thanks, Guillaume. Interesting :) http://docs.python.org/extending/index.html#extending-index
Re: Wireless Network GUI
On Thu, 7 Oct 2010 09:33:44 -0300, Christiano F. Haesbaert haesba...@haesbaert.org wrote: Why not make a curses GUI ? I find it much more useful than gtk/qt (IMHO). In my opinion, the aim of this project is to provide a graphical tool, which can be inserted in some WM like XFCE, etc. Guillaume.
Re: Wireless Network GUI
I would also prefer a console based approach. I think it is not a good idea to do it for one single windows manager. Anyway, Arch Linux has a very nice console based network connection manager in case anybody is looking for ideas: http://wiki.archlinux.org/index.php/Netcfg Luis. 2010/10/7 Guillaume Duali g.du...@otasc.org On Thu, 7 Oct 2010 09:33:44 -0300, Christiano F. Haesbaert haesba...@haesbaert.org wrote: Why not make a curses GUI ? I find it much more useful than gtk/qt (IMHO). In my opinion, the aim of this project is to provide a graphical tool, which can be inserted in some WM like XFCE, etc. Guillaume.
Re: Wireless Network GUI
Agree, less deps, more happy people. El 10/07/10 09:33, Christiano F. Haesbaert escribis: Why not make a curses GUI ? I find it much more useful than gtk/qt (IMHO). -- No, I don't have Facefuck
Re: Wireless Network GUI
On Thu, Oct 7, 2010 at 08:27, g.du...@otasc.org wrote: 2010/10/7 Martin PelikC!n martin.peli...@gmail.com: 2010/10/7, Hugo Osvaldo Barrera h...@osvaldobarrera.com.ar: I don't intend to make a huge daemon like the linux's NetworkManager, but, instead, just a simple application you open, connect, and close. Done. B No bloat, and definitely ***NO*** requirement for stuff like HAL. Amen. I wanted to get a few pointers before I started: 1) First of all, I want to be sure no one's already working on something like this. I occasionaly develop one for ncurses. But don't feel any special need for it, pfctl mostly works just fine. Oh, and it focuses more on pf(4) manupulation rather than wireless (but it's modular). 2) I initially considered just parsing the output of ifconfig . This does seem rather hackish, but would get the job done fast and can still be very maintainable code. B However, what's the proper alternative (just a few pointer to know what to start reading will do) to do this sort of this. man getifaddrs man style Please, do NOT parse ifconfig output and invest the work into proper C code. You'll hopefully learn some stuff at least and you have higher chance you won't write crap. Many people have been there. Just don't. -- Martin Pelikan Thanks, using man getifaddrs, I've managed to find some pretty valuable information (and will probably find most of what I need with enough time). Gotta love OpenBSD's man documentation. Again, thanks :-) @Edho: I don't think wicd would work. B It uses wpa_supplicant, and some other linux-only stuff as backend. I haven't been able to find much on PCBSD's doc, it seems their standards for documentation are quite low, for example, see: http://wiki.pcbsd.org/index.php/PC-BSD_FAQS#Networking or http://wiki.pcbsd.org/index.php/Wireless_Settings From what I've seen on just screenshots, It's probably QT based. B But I'll download it tonight and take a look, there might be some useful parts, at least for studying. @Guillaume: I was considering Python, but since I need to call system functions, it's either going to be C or Python calling a C module, the latter being more likely, since I could learn more, and still use python for the front-end. Tell me if you're interested on doing something, we might be able to help each other :) Hi Hugo, If I understand you think to combine C et Python ? Do you think is good to code the tool in C in shell only interface, and add the graphical front-end in Python. In this case Python will call on each clik the C binary with parameter, like : B ./assistant --list-wireless-network It's a good idea It sounds like going back to parsing a string in order to obtain the info. Only that instead of parsing ifconfig, it's some other application that wraps system calls. Calling C code from python seems rather easy, it's the C part that might take some time (reading). If you'd like for us to collaborate on this, e-mail me. The same goes for anyone else who might be interested :-) @david: Oh, ok, a shame really. A few KDE apps would be SO good if they just weren't KDE apps. -- Hugo Osvaldo Barrera -- Hugo Osvaldo Barrera
Re: Wireless Network GUI
On Thu, Oct 7, 2010 at 09:20, Joachim Schipper joac...@joachimschipper.nl wrote: On Thu, Oct 07, 2010 at 01:34:50PM +0200, g.du...@otasc.org wrote: If I understand you think to combine C and Python ? Do you think is good to code the tool in C, with only shell interface, and add the graphical front-end in Python ? In this case Python will call on each click the C binary with parameter, like : B ./assistant --list-wireless-network It's a good idea [G! keyboard shortcut :p] So, it's a good idea if we work together on this project if you are ok ? You *are* aware that you can combine Python and C code fairly easily, right? There is no real need to shell out for every command... B B B B B B B B Joachim -- TFMotD: perlartistic (1) - the Perl Artistic License http://www.joachimschipper.nl/ Yes, this was my initial idea :-) http://docs.python.org/extending/extending.html -- Hugo Osvaldo Barrera
Re: Wireless Network GUI
Guillaume DualC) wrote: On Thu, 7 Oct 2010 09:33:44 -0300, Christiano F. Haesbaert haesba...@haesbaert.org wrote: Why not make a curses GUI ? I find it much more useful than gtk/qt (IMHO). In my opinion, the aim of this project is to provide a graphical tool, which can be inserted in some WM like XFCE, etc. Guillaume. FLTK is in ports. It creates small, fast and portable standalone GUIs. I've used it to make a few simple GUI frontends. I like it better than Python/WxWidgets, or Python/QT, GTK, etc. Brad
Re: Wireless Network GUI
On 2010-10-07, Christiano F. Haesbaert haesba...@haesbaert.org wrote: Why not make a curses GUI ? I find it much more useful than gtk/qt (IMHO). What would be really nice IMHO is to expose an API that gives access to ifconfig functionality so everybody could easily write their own UI. Basically to to write your GUI you need to rewrite part of ifconfig. Also I always wondered whether it is technically possible to scan for APs without losing your connection to your current AP, that would be very handy to implement transparent roaming. Best regards, Jona -- Worse is better Richard P. Gabriel
Re: Wireless Network GUI
2010/10/7, Jona Joachim j...@hcl-club.lu: On 2010-10-07, Christiano F. Haesbaert haesba...@haesbaert.org wrote: Why not make a curses GUI ? I find it much more useful than gtk/qt (IMHO). What would be really nice IMHO is to expose an API that gives access to ifconfig functionality so everybody could easily write their own UI. That API is exposed in getifaddrs(3). If you've read the whole thread... Basically to to write your GUI you need to rewrite part of ifconfig. Basically that is by definition. ifconfig is just another kind of GUI, see? :-) Also I always wondered whether it is technically possible to scan for APs without losing your connection to your current AP, that would be very handy to implement transparent roaming. AFAIK it's not, but one thread could do scanning while another thread could handle user input (like WPA passphrase) I don't see why do so many people want to use Python for this. Its advantages are obvious in complex software with lots of code, but why use it for such a simple and low-level tool? I mean, why don't you use mono then? I'm pretty sure ioctl() looks similar in all of them... GTK/Qt seems like a huge overkill too. Look at its size and look at the benefits from it. Round buttons? Is that what you want? A pop-down new network found window from a corner? Just imagine running PyQt on a Soekris. I'll try to bring myself to post my unfinished curses version. The problem is I don't understand curses enough. Parts of it are too complex and some important parts are missing or malfunctional across multiple systems. But from a simple and easy-to-use point of view, it seems the smallest evil. My app loads bunch of .so's, which create options in left menu (like in Mikrotik Winbox) and if you press the option, a function from that library gets called and gets control over the whole window (and does its stuff). One for ifaces+addresses, one for pf tables and one for pf anchors so far. Any other ideas? -- Martin Pelikan
Re: Wireless Network GUI
2010/10/7 Martin PelikC!n martin.peli...@gmail.com: 2010/10/7, Jona Joachim j...@hcl-club.lu: On 2010-10-07, Christiano F. Haesbaert haesba...@haesbaert.org wrote: Why not make a curses GUI ? I find it much more useful than gtk/qt (IMHO). What would be really nice IMHO is to expose an API that gives access to ifconfig functionality so everybody could easily write their own UI. That API is exposed in getifaddrs(3). If you've read the whole thread... Basically to to write your GUI you need to rewrite part of ifconfig. Basically that is by definition. ifconfig is just another kind of GUI, see? :-) Also I always wondered whether it is technically possible to scan for APs without losing your connection to your current AP, that would be very handy to implement transparent roaming. AFAIK it's not, but one thread could do scanning while another thread could handle user input (like WPA passphrase) I don't see why do so many people want to use Python for this. Its advantages are obvious in complex software with lots of code, but why use it for such a simple and low-level tool? I mean, why don't you use mono then? I'm pretty sure ioctl() looks similar in all of them... GTK/Qt seems like a huge overkill too. Look at its size and look at the benefits from it. Round buttons? Is that what you want? A pop-down new network found window from a corner? Just imagine running PyQt on a Soekris. I'll try to bring myself to post my unfinished curses version. The problem is I don't understand curses enough. Parts of it are too complex and some important parts are missing or malfunctional across multiple systems. But from a simple and easy-to-use point of view, it seems the smallest evil. My app loads bunch of .so's, which create options in left menu (like in Mikrotik Winbox) and if you press the option, a function from that library gets called and gets control over the whole window (and does its stuff). One for ifaces+addresses, one for pf tables and one for pf anchors so far. Any other ideas? -- Martin Pelikan What would you suggest for a GUI? I mean, one that runs as an X application. I don't intend to add any tray notification or anything like that, anyway. To be honest, the reason I picked python is that I've more experience with python than I do with C/C++, so I can produce better quality code in less time. I'd do the C module to load into python because I don't think python can make system function calls. Anyway, how close are you to finishing your curses UI? A great deal of code might be re-usable for an X GUI, if you don't mind :-) As for what others said, I DID say I intend to create a C module to be called from python to use from my python UI. This would then be re-usabe for creating another UI, a text-mode UI, and anything someone would want. -- Hugo Osvaldo Barrera () B ascii ribbon campaign - against html e-mail /\ B www.asciiribbon.org B - against proprietary attachments
Re: Wireless Network GUI
On 8/10/2010, at 1:44 AM, Guillaume Duali wrote: On Thu, 7 Oct 2010 09:33:44 -0300, Christiano F. Haesbaert haesba...@haesbaert.org wrote: Why not make a curses GUI ? I find it much more useful than gtk/qt (IMHO). In my opinion, the aim of this project is to provide a graphical tool, which can be inserted in some WM like XFCE, etc. Guillaume. If the app is properly designed, then switching out for a different UI can be pretty trivial. I tend to construct all my graphical apps this way now, and even went so far as to build multiple UI support into a makefile so I can build different versions simply by typing 'make curses' or 'make fltk'. If you're comfortable with the various components you're working with (ui toolkits, etc), this can be very easy to impliment. (OK, the makefile was lets say - a challenge, but it's in no way essential, just icing on the cake). paulm ps: For most things, I much prefer fltk over other windowing toolkits I've used.
Re: Wireless Network GUI
On Thu, Oct 7, 2010 at 9:04 AM, Hugo Osvaldo Barrera h...@osvaldobarrera.com.ar wrote: I want to make a small desktop application (probably GTK+, since I've never done anything in GTK) that shows available wireless networks, signal, and a few buttons to connect to each/configure each. I don't intend to make a huge daemon like the linux's NetworkManager, but, instead, just a simple application you open, connect, and close. Done. B No bloat, and definitely ***NO*** requirement for stuff like HAL. I wanted to get a few pointers before I started: 1) First of all, I want to be sure no one's already working on something like this. wicd is as small as network gui I can find in linux. Also I believe pc-bsd made their own version of network gui. It probably depends on kde or qt though. http://wicd.sourceforge.net/ -- O ascii ribbon campaign - stop html mail - www.asciiribbon.org