Wifi Config GUI for the Zipit
I started working on a gui interface to configure wireless on the Zipit and got something that works, but is still very rough. I decided to post it and see if anyone else could lend a few keystrokes. :) The script can be downloaded from HERE and the connection template from HERE.
I tried to put as many comments throughout to make it a bit easier to understand what's going on. Here's a brief rundown of how it works. There's some variables at the beginning that set some options and tell the script where to save/read files (connection templates).
When run (as root), the script checks if it's supposed to auto-connect. If so, it runs the startup function which scans and connects to a network that already has a save file or lists the available networks for you to choose. If auto connect is disabled, the script displays a tray icon (using Zenity) that when clicked will display a dialog with options (connect, disconnect, etc). Currently, the options in the dialog do nothing. I'm mostly using this as an auto-connect script on startup.
My future plan is to use Xdialog instead of zenity. I think Xdialog will run a little faster than Zenity, although Xdialog does not have a tray icon feature so Zenity will still be required for that. Only WEP works for now, but I have put in some preparations/ideas for WPA in the comments. The connection template contains a line that syncs your zipit time with time.nist.gov. This works, but you will need to setup your local timezone for it to be correct.
Please post any changes/suggestions/ideas/code in the comments.
LCD and Keyboard Brightness on the Zipit
I created a couple of scripts to easily change the LCD and Keyboard brightness from the command line. They unfortunately need to be run as root, but with the rootnexus image, we can do some modifications to get it working as a regular user.
Gain root access from the command line:
op shell
Change directory:
cd /usr/bin
Then download the scripts:
wget http://www.mozzwald.com/sites/default/files/lcd
wget http://www.mozzwald.com/sites/default/files/keys
Make them executable:
chmod +x keys lcd
Now we need to edit the "op" config file and allow it to run as normal user:
nano /etc/op/op.conf
Add the following to the end of the file:
lcd /bin/sh -c "/usr/bin/lcd $1";
users=PRIVILEGED
environment
#
keys /bin/sh -c "/usr/bin/keys $1";
users=PRIVILEGED
environment
Press CTRL-X to save the file and quit nano. Type "exit" to quit root access. Now try it out like this:
op lcd high
op keys med
The scripts accept max, high, med, low, or a number from 1-255. You can edit the scripts to change max, high, med, and low to your preferred setting.
Zipit YouTube Refined
JAGSPH has created a nice script for the userland to load up the youtube videos. Also, I have since formatted my search page to fit a little better on the zipit screen and moved the search page to http://www.mozzwald.com/yt. The old script is set up as a redirect to the new one so it shouldn't affect users. The php source code can be downloaded from here. Most of the code I used was borrowed from here.
YouTube on the Zipit
Soundguy has released his new Zipit userland image which is quite amazing. It keeps getting better everyday. He found a way to play YouTube videos via the command line with the help of mplayer and a python script called youtube-dl. The interface wasn't very user friendly though as you had to copy a youtube link from the browser to the command line to run it. I've come up with a way around that. You can now search and play youtube videos from the links2 browser.
It works by creating a new MIME type named 'application/zyt' which we tell links2 to open with my playtube script. Then, using the php search I created here, the youtube url you click on is sent to your zipit in a text file with the 'zyt' extension. This tells links2 to run playtube and in turn the video.
To install it, get the following required files:
youtube-dl
My "PlayTube" Script
My Links2 Config File
Copy playtube and youtube-dl to /usr/bin and make them executable with 'chmod +x /usr/bin/youtube-dl /usr/bin/playtube'. Then make sure it can be run by all users with 'chmod 755 /usr/bin/youtube-dl /usr/bin/playtube'.
Copy my Links2 config file to '~/.links2'.
Point your browser to href="http://www.mozzwald.com/ytsearch.php and do a search. Click on a thumbnail or link and wait for the video to play. It may take a bit for the video to load on the zipit, but it works.
I still need to format the video descriptions on my search page to hopefully fit on the zipit screen better. Please post any suggestions in the comments section. Happy YouTubing on your Zipit!
LXPanel on the Zipit
LXPanel is a lightweight menu/taskbar/tray for linux. I've been running it on my netbook along with the Openbox window manager for some time now and thought it would run well on the Zipit. With the Debian image it's easy to install with apt.
apt-get install lxpanel openbox
If I remember correctly it will by default install a couple other dependencies (like LXNM which I was unable to get working properly). LXPanel assumes you have LXSession installed (even though it's not a dependency) which has scripts for the shutdown menu. The taskbar also has some icons for desktop switching, browser, and others that just clutter up the bar on the Zipit's small screen.
To fix all this I first created a shutdown script called z2logout that will pop up an xmessage window with shutdown options and placed it in the /usr/bin directory. Don't forget to make it executable with "chmod +x /usr/bin/z2logout" (no quotes).
Z2 LXPanel Shutdown
z2logout script
#!/bin/bash
#Shows shutdown options on the Zipit Z2
#running lxpanel in openbox
answer=$(xmessage -print -center -buttons Shutdown:off,QuitX:quit,Cancel:cancel "Z2 Shutdown")
if [ $answer = "Shutdown" ]; then
shutdown -h now
fi
if [ $answer = "QuitX" ]; then
`openbox --exit`
fi
Next, we need to modify the LXPanel "panel" file to remove the stuff we don't want and add what we do. This file is located at "~/.config/lxpanel/default/panels/panel". You can replace this file with mine:
# lxpanel config file. Manually editing is not recommended.
# Use preference dialog in lxpanel to adjust config when you can.
Global {
edge=bottom
allign=left
margin=0
widthtype=percent
width=100
height=18
transparent=0
tintcolor=#000000
alpha=0
Zipit Z2 Wireless Messenger + Debian = Super Ultra Portable Linux
I managed to get my hands on a Zipit Z2 Wireless Messenger after seeing blog posts about putting a full(er) featured linux distro on it. Many people were getting them from Target at discounted/clearance prices. Unfortunately my local Target did not have them so I picked one up on eBay for $50 shipped.
Before I even turned it on I got my Mini SD card ready with the autoflasher and had the Debian image next in line. It was extremely simple thanks to the work of many people. The Debian image comes with fluxbox and some basic apps pre-installed. Not content with fluxbox, I decided to try out OpenBox and some of the LXDE applications. OpenBox was an easy install with apt-get and worked out of the box (some config file options have since been changed to remove "decorations").
LXPanel
LXPanel needed some tweaking to get the Logout option changed. LXNM so far has given no love. It doesn't show any wireless networks or allow connecting, but does show status of the current connection. The battery status for LXPanel does not work since only APM (not ACPI) is available for the Zipit. I do have xbattbar installed, but it also has issues reading the correct battery percentage remaining, but you get a good estimate of battery life. I assume there are issues with the APM kernel driver.

RSS Feed