slitaz-tools rev 736
Start to move Yad/box to boxes, up POT (all gtkdialoggui will disapear)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat Apr 28 20:11:25 2012 +0200 (2012-04-28) |
parents | e570520a6e4c |
children | b4c3846a03c1 |
files | Makefile boxes/wifibox po/slitaz-boxes/slitaz-boxes.pot po/slitaz-tools/slitaz-tools.pot po/tazbox/tazbox.pot po/tazdrop/tazdrop.pot po/tazinst/tazinst.pot tazbox/tazbox tinyutils/wifibox |
line diff
1.1 --- a/Makefile Wed Apr 25 22:37:48 2012 +0200 1.2 +++ b/Makefile Sat Apr 28 20:11:25 2012 +0200 1.3 @@ -5,7 +5,7 @@ 1.4 DOCDIR?=/usr/share/doc 1.5 DESTDIR?= 1.6 1.7 -PROJECTS=slitaz-tools slitaz-boxes tazbox tazinst tazdrop 1.8 +PROJECTS=slitaz-tools slitaz-boxes tazbox tazinst tazdrop 1.9 LINGUAS=es_AR fr pt_BR 1.10 1.11 all: msgfmt 1.12 @@ -29,7 +29,7 @@ 1.13 @echo -n "Generating SliTaz Boxes pot file... " 1.14 @xgettext -o po/slitaz-boxes/slitaz-boxes.pot -L Shell \ 1.15 --package-name="SliTaz Boxes" \ 1.16 - ./tinyutils/scpbox 1.17 + ./boxes/wifibox 1.18 @echo "done" 1.19 1.20 tazbox-pot: 1.21 @@ -118,23 +118,26 @@ 1.22 done; 1.23 1.24 install-boxes: 1.25 - install -m 0777 -d $(DESTDIR)/etc/wireless 1.26 + #install -m 0777 -d $(DESTDIR)/etc/wireless 1.27 install -m 0777 -d $(DESTDIR)$(PREFIX)/bin 1.28 install -m 0777 -d $(DESTDIR)$(PREFIX)/lib/slitaz 1.29 install -m 0777 -d $(DESTDIR)$(PREFIX)/share/locale 1.30 install -m 0777 -d $(DESTDIR)$(PREFIX)/share/applications 1.31 install -m 0777 -d $(DESTDIR)$(PREFIX)/share/pixmaps 1.32 install -m 0777 -d $(DESTDIR)$(PREFIX)/share/doc 1.33 - install -m 0755 tinyutils/*box $(DESTDIR)$(PREFIX)/bin 1.34 + install -m 0755 boxes/* $(DESTDIR)$(PREFIX)/bin 1.35 install -m 0755 tazbox/tazbox $(DESTDIR)$(PREFIX)/bin 1.36 + 1.37 # Libs 1.38 install -m 0755 lib/[a-z]* $(DESTDIR)$(PREFIX)/lib/slitaz 1.39 + 1.40 # Desktop files, icons and doc. 1.41 install -m 0644 rootfs/usr/share/applications/* \ 1.42 $(DESTDIR)$(PREFIX)/share/applications 1.43 install -m 0644 rootfs/usr/share/pixmaps/* \ 1.44 $(DESTDIR)$(PREFIX)/share/pixmaps 1.45 cp -a doc $(DESTDIR)$(PREFIX)/share/doc/slitaz-tools 1.46 + 1.47 # i18n. 1.48 for l in $(LINGUAS); \ 1.49 do \ 1.50 @@ -142,10 +145,7 @@ 1.51 install -m 0644 po/mo/$$l/*box* \ 1.52 $(DESTDIR)$(PREFIX)/share/locale/$$l/LC_MESSAGES; \ 1.53 done; 1.54 - # Default English messages (will move to po) 1.55 - install -m 0777 -d $(DESTDIR)$(PREFIX)/share/slitaz/messages/en 1.56 - install -m 0644 messages/en/desktopbox.msg \ 1.57 - $(DESTDIR)$(PREFIX)/share/slitaz/messages/en 1.58 + 1.59 # Gksu fake for pcmanfm. 1.60 cd $(DESTDIR)$(PREFIX)/bin && ln -s subox gksu 1.61
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/boxes/wifibox Sat Apr 28 20:11:25 2012 +0200 2.3 @@ -0,0 +1,154 @@ 2.4 +#!/bin/sh 2.5 +# 2.6 +# Small Wifi utility to quickly connect to a network. Easy network connection is 2.7 +# most important, this tool provides a quick way to connect or change wifi 2.8 +# settings while full network configuration is done in TazPanel. 2.9 +# 2.10 +# Copyright (C) 2012 SliTaz GNU/Linux - GNU gpl v2 2.11 +# 2.12 +# Authors : Christophe Lincoln <pankso@slitaz.org> 2.13 +# 2.14 + 2.15 +# Only for root. 2.16 +if [ $(id -u) != 0 ]; then 2.17 + exec tazbox su $(basename $0) $@ 2.18 + exit 0 2.19 +fi 2.20 + 2.21 +# Internationalization 2.22 +. /usr/bin/gettext.sh 2.23 +TEXTDOMAIN='slitaz-boxes' 2.24 +export TEXTDOMAIN 2.25 + 2.26 +# Start a wifi connection 2.27 +start_wifi() { 2.28 + sed -i \ 2.29 + -e s'/^DHCP=.*/DHCP="yes"/' \ 2.30 + -e s'/^STATIC=.*/STATIC="no"/' \ 2.31 + -e s'/^WIFI=.*/WIFI="yes"/' \ 2.32 + /etc/network.conf 2.33 + ifconfig $WIFI_INTERFACE up 2.34 + iwconfig $WIFI_INTERFACE txpower auto 2.35 + /etc/init.d/network.sh start 2.36 +} 2.37 + 2.38 +# Catch essids and format output for GTK tree. We get the list of 2.39 +# networks by Cell and without spaces. 2.40 +detect_wifi() { 2.41 + if [ -d /sys/class/net/$WIFI_INTERFACE/wireless ]; then 2.42 + ifconfig $WIFI_INTERFACE up 2.43 + echo -e "any\nN/A\nnone\n-" 2.44 + for i in $(iwlist $WIFI_INTERFACE scan | sed s/"Cell "/Cell-/ | grep "Cell-" | awk '{print $1}') 2.45 + do 2.46 + scan=$(iwlist $WIFI_INTERFACE scan last | \ 2.47 + awk '/(Cell|ESS|Qual|Encry|IE: WPA|WPA2)/ {print}' | \ 2.48 + sed s/"Cell "/Cell-/ | grep -A 5 "$i") 2.49 + essid=$(echo $scan | cut -d '"' -f 2) 2.50 + if echo "$scan" | grep -q Quality; then 2.51 + quality=$(echo $scan | sed 's/.*Quality=\([^ ]*\).*/\1/' | sed 's/.*Quality:\([^ ]*\).*/\1/') 2.52 + else 2.53 + quality="-" 2.54 + fi 2.55 + cryto=$(echo $scan | sed 's/.*key:\([^ ]*\).*/\1/') 2.56 + # Check encryption type 2.57 + if echo "$scan" | grep -q WPA*; then 2.58 + cryto="WPA" 2.59 + fi 2.60 + # Connected or not connected... 2.61 + if ifconfig | grep -A 1 $WIFI_INTERFACE | \ 2.62 + grep -q inet && iwconfig $WIFI_INTERFACE | \ 2.63 + grep ESSID | grep -q -w "$essid"; then 2.64 + status=connected 2.65 + else 2.66 + status="-" 2.67 + fi 2.68 + 2.69 + echo -e "$essid\n$quality\n$cryto\n$status" 2.70 + done 2.71 + fi 2.72 +} 2.73 + 2.74 +# Prompt for password or connect 2.75 +connect_main() { 2.76 + case $keytype in 2.77 + WPA|WEP) 2.78 + title=$(gettext "Wifi connection") 2.79 + text=$(gettext "Connection to:") 2.80 + yad --form --width=520 --height=140 \ 2.81 + --center --on-top --window-icon="network-wireless" \ 2.82 + --image="network-wireless" --image-on-top \ 2.83 + --title="$title" --text="$text <b>$essid</b>" \ 2.84 + --field="$keytype $(gettext "Password:"):H" ;; 2.85 + none) continue ;; 2.86 + *) exit 0 ;; 2.87 + esac 2.88 +} 2.89 + 2.90 +connect() { 2.91 + main=$(connect_main) 2.92 + ret=$? 2.93 + # Deal with --button values 2.94 + case $ret in 2.95 + 1) exit 0 ;; 2.96 + *) continue ;; 2.97 + esac 2.98 + /etc/init.d/network.sh stop 2.99 + sleep 1 2.100 + key=$(echo "$main" | cut -d '|' -f 1) 2.101 + sed -i \ 2.102 + -e s"/^WIFI_ESSID=.*/WIFI_ESSID=\"$essid\""/ \ 2.103 + -e s"/^WIFI_KEY=.*/WIFI_KEY=\"$key\"/" \ 2.104 + -e s"/^WIFI_KEY_TYPE=.*/WIFI_KEY_TYPE=\"$keytype\"/" \ 2.105 + /etc/network.conf 2.106 + start_wifi 2.107 +} 2.108 + 2.109 +# Main GUI box function with pure Yad spec 2.110 +wifi_main() { 2.111 + title=$(gettext "Wifi network") 2.112 + text=$(gettext "<b>Connect to a wifi network</b> \(Double click to connect\)") 2.113 + detect_wifi | yad --list --width=520 --height=300 \ 2.114 + --center --on-top --window-icon="network-wireless" \ 2.115 + --image="network-wireless" --image-on-top \ 2.116 + --title="$title" --text="$text" \ 2.117 + --column "$(gettext "ESSID Name")" --column "$(gettext "Quality")" \ 2.118 + --column "$(gettext "Encryption")" --column "$(gettext "Status")" \ 2.119 + --button="Start wifi:4" --button="Stop wifi:3" \ 2.120 + --button="Configuration:2" --button="gtk-close:1" 2.121 +} 2.122 + 2.123 +# Main function 2.124 +wifi() { 2.125 + # Store box results 2.126 + main=$(wifi_main) 2.127 + ret=$? 2.128 + # Deal with --button values 2.129 + case $ret in 2.130 + 1) exit 0 ;; 2.131 + 2) tazweb http://tazpanel:82/network.cgi?wifi && exit 0 ;; 2.132 + 3) /etc/init.d/network.sh stop && exit 0 ;; 2.133 + 3) start_wifi && exit 0 ;; 2.134 + *) continue ;; 2.135 + esac 2.136 + if [ -n "$main" ]; then 2.137 + essid=$(echo "$main" | cut -d "|" -f 1) 2.138 + keytype=$(echo "$main" | cut -d "|" -f 3) 2.139 + connect 2.140 + fi 2.141 +} 2.142 + 2.143 +# 2.144 +# Script commands 2.145 +# 2.146 + 2.147 +case "$1" in 2.148 + usage|help|-*) 2.149 + echo "$(gettext "Usage:") $(basename $0) [interface]" ;; 2.150 + *) 2.151 + . /etc/network.conf 2.152 + [ -n "$1" ] && WIFI_INTERFACE="$1" 2.153 + wifi ;; 2.154 +esac 2.155 + 2.156 +exit 0 2.157 +
3.1 --- a/po/slitaz-boxes/slitaz-boxes.pot Wed Apr 25 22:37:48 2012 +0200 3.2 +++ b/po/slitaz-boxes/slitaz-boxes.pot Sat Apr 28 20:11:25 2012 +0200 3.3 @@ -8,7 +8,7 @@ 3.4 msgstr "" 3.5 "Project-Id-Version: SliTaz Boxes\n" 3.6 "Report-Msgid-Bugs-To: \n" 3.7 -"POT-Creation-Date: 2012-03-24 14:34+0100\n" 3.8 +"POT-Creation-Date: 2012-04-28 20:10+0200\n" 3.9 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 3.10 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 3.11 "Language-Team: LANGUAGE <LL@li.org>\n" 3.12 @@ -17,49 +17,42 @@ 3.13 "Content-Type: text/plain; charset=CHARSET\n" 3.14 "Content-Transfer-Encoding: 8bit\n" 3.15 3.16 -#: tinyutils/scpbox:24 3.17 -msgid "" 3.18 -"\n" 3.19 -"Copy files securely with scp from Dropbear SSH client/server.\n" 3.20 -"\t\t" 3.21 +#: boxes/wifibox:75 3.22 +msgid "Wifi connection" 3.23 msgstr "" 3.24 3.25 -#: tinyutils/scpbox:29 3.26 -msgid "Configuration" 3.27 +#: boxes/wifibox:76 3.28 +msgid "Connection to:" 3.29 msgstr "" 3.30 3.31 -#: tinyutils/scpbox:32 3.32 -msgid "<b>User :</b>" 3.33 +#: boxes/wifibox:81 3.34 +msgid "Password:" 3.35 msgstr "" 3.36 3.37 -#: tinyutils/scpbox:40 3.38 -msgid "<b>Host :</b>" 3.39 +#: boxes/wifibox:108 3.40 +msgid "Wifi network" 3.41 msgstr "" 3.42 3.43 -#: tinyutils/scpbox:48 3.44 -msgid "<b>Options :</b>" 3.45 +#: boxes/wifibox:109 3.46 +msgid "<b>Connect to a wifi network</b> \\(Double click to connect\\)" 3.47 msgstr "" 3.48 3.49 -#: tinyutils/scpbox:57 3.50 -msgid "Paths" 3.51 +#: boxes/wifibox:114 3.52 +msgid "ESSID Name" 3.53 msgstr "" 3.54 3.55 -#: tinyutils/scpbox:60 3.56 -msgid "<b>Local :</b>" 3.57 +#: boxes/wifibox:114 3.58 +msgid "Quality" 3.59 msgstr "" 3.60 3.61 -#: tinyutils/scpbox:73 3.62 -msgid "<b>Remote :</b>" 3.63 +#: boxes/wifibox:115 3.64 +msgid "Encryption" 3.65 msgstr "" 3.66 3.67 -#: tinyutils/scpbox:83 3.68 -msgid "Download" 3.69 +#: boxes/wifibox:115 3.70 +msgid "Status" 3.71 msgstr "" 3.72 3.73 -#: tinyutils/scpbox:88 3.74 -msgid "Upload" 3.75 +#: boxes/wifibox:146 3.76 +msgid "Usage:" 3.77 msgstr "" 3.78 - 3.79 -#: tinyutils/scpbox:93 3.80 -msgid "Exit" 3.81 -msgstr ""
4.1 --- a/po/slitaz-tools/slitaz-tools.pot Wed Apr 25 22:37:48 2012 +0200 4.2 +++ b/po/slitaz-tools/slitaz-tools.pot Sat Apr 28 20:11:25 2012 +0200 4.3 @@ -8,7 +8,7 @@ 4.4 msgstr "" 4.5 "Project-Id-Version: SliTaz Tools\n" 4.6 "Report-Msgid-Bugs-To: \n" 4.7 -"POT-Creation-Date: 2012-03-24 14:34+0100\n" 4.8 +"POT-Creation-Date: 2012-04-28 20:10+0200\n" 4.9 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 4.10 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 4.11 "Language-Team: LANGUAGE <LL@li.org>\n" 4.12 @@ -25,11 +25,11 @@ 4.13 msgid "Type su and root password to become super-user" 4.14 msgstr "" 4.15 4.16 -#: tinyutils/tazlocale:83 4.17 +#: tinyutils/tazlocale:88 4.18 msgid "SliTaz language configuration" 4.19 msgstr "" 4.20 4.21 -#: tinyutils/tazlocale:108 4.22 +#: tinyutils/tazlocale:113 4.23 msgid "" 4.24 "Please logout of your current session and login again to use new locale." 4.25 msgstr "" 4.26 @@ -64,7 +64,7 @@ 4.27 msgstr "" 4.28 4.29 #: tinyutils/tazx:163 4.30 -msgid "Tazx dialog helps you to configure your Xorg sever." 4.31 +msgid "Tazx dialog helps you to configure your Xorg server." 4.32 msgstr "" 4.33 4.34 #: tinyutils/tazx:164
5.1 --- a/po/tazbox/tazbox.pot Wed Apr 25 22:37:48 2012 +0200 5.2 +++ b/po/tazbox/tazbox.pot Sat Apr 28 20:11:25 2012 +0200 5.3 @@ -8,7 +8,7 @@ 5.4 msgstr "" 5.5 "Project-Id-Version: TazBox\n" 5.6 "Report-Msgid-Bugs-To: \n" 5.7 -"POT-Creation-Date: 2012-03-24 14:34+0100\n" 5.8 +"POT-Creation-Date: 2012-04-28 20:10+0200\n" 5.9 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 5.10 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 5.11 "Language-Team: LANGUAGE <LL@li.org>\n"
6.1 --- a/po/tazdrop/tazdrop.pot Wed Apr 25 22:37:48 2012 +0200 6.2 +++ b/po/tazdrop/tazdrop.pot Sat Apr 28 20:11:25 2012 +0200 6.3 @@ -8,7 +8,7 @@ 6.4 msgstr "" 6.5 "Project-Id-Version: TazDrop\n" 6.6 "Report-Msgid-Bugs-To: \n" 6.7 -"POT-Creation-Date: 2012-03-24 14:34+0100\n" 6.8 +"POT-Creation-Date: 2012-04-28 20:10+0200\n" 6.9 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 6.10 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 6.11 "Language-Team: LANGUAGE <LL@li.org>\n"
7.1 --- a/po/tazinst/tazinst.pot Wed Apr 25 22:37:48 2012 +0200 7.2 +++ b/po/tazinst/tazinst.pot Sat Apr 28 20:11:25 2012 +0200 7.3 @@ -8,7 +8,7 @@ 7.4 msgstr "" 7.5 "Project-Id-Version: Tazinst\n" 7.6 "Report-Msgid-Bugs-To: \n" 7.7 -"POT-Creation-Date: 2012-03-24 14:34+0100\n" 7.8 +"POT-Creation-Date: 2012-04-28 20:10+0200\n" 7.9 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 7.10 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 7.11 "Language-Team: LANGUAGE <LL@li.org>\n" 7.12 @@ -188,8 +188,8 @@ 7.13 msgstr "" 7.14 7.15 #: installer/tazinst:483 installer/tazinst:556 installer/tazinst:655 7.16 -#: installer/tazinst:690 installer/tazinst:758 installer/tazinst:999 7.17 -#: installer/tazinst:1091 installer/tazinst:1132 7.18 +#: installer/tazinst:690 installer/tazinst:758 installer/tazinst:1018 7.19 +#: installer/tazinst:1110 installer/tazinst:1151 7.20 msgid "Internal" 7.21 msgstr "" 7.22 7.23 @@ -197,7 +197,7 @@ 7.24 msgid "Invalid source" 7.25 msgstr "" 7.26 7.27 -#: installer/tazinst:506 installer/tazinst:971 7.28 +#: installer/tazinst:506 installer/tazinst:990 7.29 msgid "Partition in use" 7.30 msgstr "" 7.31 7.32 @@ -209,7 +209,7 @@ 7.33 msgid "Formatting /home partition:" 7.34 msgstr "" 7.35 7.36 -#: installer/tazinst:545 installer/tazinst:980 7.37 +#: installer/tazinst:545 installer/tazinst:999 7.38 msgid "Unable to mount partition" 7.39 msgstr "" 7.40 7.41 @@ -221,99 +221,99 @@ 7.42 msgid "Configuring host name:" 7.43 msgstr "" 7.44 7.45 -#: installer/tazinst:794 7.46 +#: installer/tazinst:813 7.47 msgid "No windows partition found. Dual-boot disabled" 7.48 msgstr "" 7.49 7.50 -#: installer/tazinst:850 7.51 +#: installer/tazinst:869 7.52 msgid "Enabling Windows dual-boot" 7.53 msgstr "" 7.54 7.55 -#: installer/tazinst:871 7.56 +#: installer/tazinst:890 7.57 msgid "Installing SliTaz on:" 7.58 msgstr "" 7.59 7.60 -#: installer/tazinst:890 7.61 +#: installer/tazinst:909 7.62 msgid "Configuring root and default user account:" 7.63 msgstr "" 7.64 7.65 -#: installer/tazinst:894 7.66 +#: installer/tazinst:913 7.67 msgid "Configuring partition to be used as /home:" 7.68 msgstr "" 7.69 7.70 -#: installer/tazinst:913 7.71 +#: installer/tazinst:932 7.72 msgid "Running grub-install on:" 7.73 msgstr "" 7.74 7.75 -#: installer/tazinst:927 7.76 +#: installer/tazinst:946 7.77 msgid "Unmounting target partition:" 7.78 msgstr "" 7.79 7.80 -#: installer/tazinst:933 7.81 +#: installer/tazinst:952 7.82 msgid "Unmounting:" 7.83 msgstr "" 7.84 7.85 -#: installer/tazinst:939 7.86 +#: installer/tazinst:958 7.87 msgid "Ejecting cdrom..." 7.88 msgstr "" 7.89 7.90 -#: installer/tazinst:950 7.91 +#: installer/tazinst:969 7.92 msgid "Installation complete. You can now restart (reboot)" 7.93 msgstr "" 7.94 7.95 -#: installer/tazinst:951 installer/tazinst:1167 7.96 +#: installer/tazinst:970 installer/tazinst:1186 7.97 msgid "from your SliTaz GNU/Linux system." 7.98 msgstr "" 7.99 7.100 -#: installer/tazinst:954 7.101 +#: installer/tazinst:973 7.102 msgid "Copying log files" 7.103 msgstr "" 7.104 7.105 -#: installer/tazinst:989 7.106 +#: installer/tazinst:1008 7.107 msgid "Preparing upgrade of SliTaz release:" 7.108 msgstr "" 7.109 7.110 -#: installer/tazinst:991 7.111 +#: installer/tazinst:1010 7.112 msgid "" 7.113 "This partition doesn't appear to contain a valid SliTaz system, the file: /" 7.114 "etc/slitaz-release doesn't exist." 7.115 msgstr "" 7.116 7.117 -#: installer/tazinst:1106 7.118 +#: installer/tazinst:1125 7.119 msgid "" 7.120 "The list of available packages on the mirror could not be downloaded. No " 7.121 "missing packages will be reinstalled now, but you can do so later by looking " 7.122 "at the following list: /var/lib/tazinst/packages-selection.diff" 7.123 msgstr "" 7.124 7.125 -#: installer/tazinst:1119 7.126 +#: installer/tazinst:1138 7.127 msgid "Grub update" 7.128 msgstr "" 7.129 7.130 -#: installer/tazinst:1137 7.131 +#: installer/tazinst:1156 7.132 msgid "Backup /etc, /home and the packages list..." 7.133 msgstr "" 7.134 7.135 -#: installer/tazinst:1140 7.136 +#: installer/tazinst:1159 7.137 msgid "Upgrading SliTaz on:" 7.138 msgstr "" 7.139 7.140 -#: installer/tazinst:1148 7.141 +#: installer/tazinst:1167 7.142 msgid "Restoring configuration files..." 7.143 msgstr "" 7.144 7.145 -#: installer/tazinst:1154 7.146 +#: installer/tazinst:1173 7.147 msgid "Upgrading added packages..." 7.148 msgstr "" 7.149 7.150 -#: installer/tazinst:1166 7.151 +#: installer/tazinst:1185 7.152 msgid "Upgrade finished. You can now restart (reboot)" 7.153 msgstr "" 7.154 7.155 -#: installer/tazinst:1168 7.156 +#: installer/tazinst:1187 7.157 msgid "Packages on the cdrom :" 7.158 msgstr "" 7.159 7.160 -#: installer/tazinst:1169 7.161 +#: installer/tazinst:1188 7.162 msgid "Packages installed from the mirror :" 7.163 msgstr ""
8.1 --- a/tazbox/tazbox Wed Apr 25 22:37:48 2012 +0200 8.2 +++ b/tazbox/tazbox Sat Apr 28 20:11:25 2012 +0200 8.3 @@ -290,16 +290,29 @@ 8.4 echo $main | cut -f 1 -d "|" | su -c "$SU_CMD &" || su_error ;; 8.5 logout) 8.6 # Logout window with actions 8.7 - main=`logout_main` 8.8 + main=$(logout_main) 8.9 # Deal with --button values 8.10 case $? in 8.11 1) exit 0 ;; 8.12 *) continue ;; 8.13 esac 8.14 - # Deal with $main values 8.15 + # DE and WM started with a cistom -session script should export 8.16 + # XDG_CURRENT_DESKTOP 8.17 case "$main" in 8.18 - *exit) openbox --exit || jwm -exit ;; 8.19 - *reboot) reboot ;; 8.20 + *exit) 8.21 + case $XDG_CURRENT_DESKTOP in 8.22 + LXDE) 8.23 + [ "$_LXSESSION_PID" ] && kill $_LXSESSION_PID 8.24 + [ "$DESKTOP_SESSION" == "compiz" ] && \ 8.25 + killall compiz 8.26 + openbox --exit ;; 8.27 + openbox) openbox --exit ;; 8.28 + compiz) killall compiz ;; 8.29 + *) 8.30 + # Try to kill other WM that dont set XDG var. 8.31 + jwm -exit 2>/dev/null ;; 8.32 + esac ;; 8.33 + *reboot) reboot || reboot -f ;; 8.34 *halt) poweroff ;; 8.35 esac ;; 8.36 out)
9.1 --- a/tinyutils/wifibox Wed Apr 25 22:37:48 2012 +0200 9.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 9.3 @@ -1,154 +0,0 @@ 9.4 -#!/bin/sh 9.5 -# 9.6 -# Small Wifi utility to quickly connect to a network. Easy network connection is 9.7 -# most important, this tool provides a quick way to connect or change wifi 9.8 -# settings while full network configuration is done in TazPanel. 9.9 -# 9.10 -# Copyright (C) 2012 SliTaz GNU/Linux - GNU gpl v2 9.11 -# 9.12 -# Authors : Christophe Lincoln <pankso@slitaz.org> 9.13 -# 9.14 - 9.15 -# Only for root. 9.16 -if [ $(id -u) != 0 ]; then 9.17 - exec tazbox su $(basename $0) 9.18 - exit 0 9.19 -fi 9.20 - 9.21 -# Internationalization 9.22 -. /usr/bin/gettext.sh 9.23 -TEXTDOMAIN='wifibox' 9.24 -export TEXTDOMAIN 9.25 - 9.26 -# Start a wifi connection 9.27 -start_wifi() { 9.28 - sed -i \ 9.29 - -e s'/^DHCP=.*/DHCP="yes"/' \ 9.30 - -e s'/^STATIC=.*/STATIC="no"/' \ 9.31 - -e s'/^WIFI=.*/WIFI="yes"/' \ 9.32 - /etc/network.conf 9.33 - ifconfig $WIFI_INTERFACE up 9.34 - iwconfig $WIFI_INTERFACE txpower auto 9.35 - /etc/init.d/network.sh start 9.36 -} 9.37 - 9.38 -# Catch essids and format output for GTK tree. We get the list of 9.39 -# networks by Cell and without spaces. 9.40 -detect_wifi() { 9.41 - if [ -d /sys/class/net/$WIFI_INTERFACE/wireless ]; then 9.42 - ifconfig $WIFI_INTERFACE up 9.43 - echo -e "any\nN/A\nnone\n-" 9.44 - for i in $(iwlist $WIFI_INTERFACE scan | sed s/"Cell "/Cell-/ | grep "Cell-" | awk '{print $1}') 9.45 - do 9.46 - scan=$(iwlist $WIFI_INTERFACE scan last | \ 9.47 - awk '/(Cell|ESS|Qual|Encry|IE: WPA|WPA2)/ {print}' | \ 9.48 - sed s/"Cell "/Cell-/ | grep -A 5 "$i") 9.49 - essid=$(echo $scan | cut -d '"' -f 2) 9.50 - if echo "$scan" | grep -q Quality; then 9.51 - quality=$(echo $scan | sed 's/.*Quality=\([^ ]*\).*/\1/' | sed 's/.*Quality:\([^ ]*\).*/\1/') 9.52 - else 9.53 - quality="-" 9.54 - fi 9.55 - cryto=$(echo $scan | sed 's/.*key:\([^ ]*\).*/\1/') 9.56 - # Check encryption type 9.57 - if echo "$scan" | grep -q WPA*; then 9.58 - cryto="WPA" 9.59 - fi 9.60 - # Connected or not connected... 9.61 - if ifconfig | grep -A 1 $WIFI_INTERFACE | \ 9.62 - grep -q inet && iwconfig $WIFI_INTERFACE | \ 9.63 - grep ESSID | grep -q -w "$essid"; then 9.64 - status=connected 9.65 - else 9.66 - status="-" 9.67 - fi 9.68 - 9.69 - echo -e "$essid\n$quality\n$cryto\n$status" 9.70 - done 9.71 - fi 9.72 -} 9.73 - 9.74 -# Prompt for password or connect 9.75 -connect_main() { 9.76 - case $keytype in 9.77 - WPA|WEP) 9.78 - title=$(gettext "Wifi connection") 9.79 - text=$(gettext "Connection to:") 9.80 - yad --form --width=520 --height=140 \ 9.81 - --center --on-top --window-icon="network-wireless" \ 9.82 - --image="network-wireless" --image-on-top \ 9.83 - --title="$title" --text="$text <b>$essid</b>" \ 9.84 - --field="$keytype $(gettext "Password:"):H" ;; 9.85 - none) continue ;; 9.86 - *) exit 0 ;; 9.87 - esac 9.88 -} 9.89 - 9.90 -connect() { 9.91 - main=$(connect_main) 9.92 - ret=$? 9.93 - # Deal with --button values 9.94 - case $ret in 9.95 - 1) exit 0 ;; 9.96 - *) continue ;; 9.97 - esac 9.98 - /etc/init.d/network.sh stop 9.99 - sleep 1 9.100 - key=$(echo "$main" | cut -d '|' -f 1) 9.101 - sed -i \ 9.102 - -e s"/^WIFI_ESSID=.*/WIFI_ESSID=\"$essid\""/ \ 9.103 - -e s"/^WIFI_KEY=.*/WIFI_KEY=\"$key\"/" \ 9.104 - -e s"/^WIFI_KEY_TYPE=.*/WIFI_KEY_TYPE=\"$keytype\"/" \ 9.105 - /etc/network.conf 9.106 - start_wifi 9.107 -} 9.108 - 9.109 -# Main GUI box function with pure Yad spec 9.110 -wifi_main() { 9.111 - title=$(gettext "Wifi network") 9.112 - text=$(gettext "<b>Connect to a wifi network</b> \(Double click to connect\)") 9.113 - detect_wifi | yad --list --width=520 --height=300 \ 9.114 - --center --on-top --window-icon="network-wireless" \ 9.115 - --image="network-wireless" --image-on-top \ 9.116 - --title="$title" --text="$text" \ 9.117 - --column "$(gettext "essid Name")" --column "$(gettext "Quality")" \ 9.118 - --column "$(gettext "Encryption")" --column "$(gettext "Status")" \ 9.119 - --button="Start wifi:4" --button="Stop wifi:3" \ 9.120 - --button="Configuration:2" --button="gtk-close:1" 9.121 -} 9.122 - 9.123 -# Main function 9.124 -wifi() { 9.125 - # Store box results 9.126 - main=$(wifi_main) 9.127 - ret=$? 9.128 - # Deal with --button values 9.129 - case $ret in 9.130 - 1) exit 0 ;; 9.131 - 2) tazweb http://tazpanel:82/network.cgi?wifi && exit 0 ;; 9.132 - 3) /etc/init.d/network.sh stop && exit 0 ;; 9.133 - 3) start_wifi && exit 0 ;; 9.134 - *) continue ;; 9.135 - esac 9.136 - if [ -n "$main" ]; then 9.137 - essid=$(echo "$main" | cut -d "|" -f 1) 9.138 - keytype=$(echo "$main" | cut -d "|" -f 3) 9.139 - connect 9.140 - fi 9.141 -} 9.142 - 9.143 -# 9.144 -# Script commands 9.145 -# 9.146 - 9.147 -case "$1" in 9.148 - usage|help|-*) 9.149 - echo "$(gettext "Usage:") $(basename $0) [interface]" ;; 9.150 - *) 9.151 - . /etc/network.conf 9.152 - [ -n "$1" ] && WIFI_INTERFACE="$1" 9.153 - wifi ;; 9.154 -esac 9.155 - 9.156 -exit 0 9.157 -