Writing a script to toggle a pointing device in linux
I recently purchased a new laptop, and installed Ubuntu Linux. There’s one major problem with the laptop; the trackpad is too sensitive and resting your palm will click the mouse. The computer includes a shortuct (FN + F9) to disable the trackpad, but natrally from linux this doesn’t work.
Here’s how you can solve this:
- You need to get the name of the pointing device that you wish to disable, so open a terminal and type “xinput list”. (Note: if you have a second pointing device plugged in, unplug it before running this command to prevent confusion.)
Example: The trackpad that I wish to disable is called “PS/2 Logitech Wheel Mouse”
- Create a new empty document someplace where you will remember the location (I recommend placing this in it’s own folder), and both you and whoever else that may use the script has write access to the containing directory. Name the document “togglemouse.sh”. (I like to put helpful scripts within a “scripts” folder in my home directory, but if you have a multi-user machine then you could put it in a shared drive or directory.)
- Open the new document with a text editor, and paste the following script.
#!/bin/bash mouse="/tmp/mymouse" if [ -e $mouse ]; then xinput set-int-prop "PS/2 Logitech Wheel Mouse" "Device Enabled" 8 1 rm /tmp/mymouse else xinput set-int-prop "PS/2 Logitech Wheel Mouse" "Device Enabled" 8 0 echo 1 > /tmp/mymouse fi
- Change where it says “PS/2 Logitech Wheel Mouse”, to the name of the pointing device that you found in step 1. Then save.
- Now to disable the pointing device, you just need to run the script. The script will check the temp directory for a file called mymouse, if the file exists then it will enable the mouse and delete the file, if the file doesn’t exist then it will disable the mouse and create the file.
- If you’re using Ubuntu, you can create a keyboard shortcut to run this script by going to
System > Preferences > Keyboard Shortcuts
Select “Add”, write a descriptive name for the shortcut, place the location of the script in the command, hit ok, click the right column next to the new shortcut and press the keys desired for your new shortcut.
- If you’re using Ubuntu, you can create a keyboard shortcut to run this script by going to
EDIT: Moved the location of the mouse disabled file into the temp directory (/tmp/mymouse), so it goes away on reboot.
- Runs on Android, should run in iOS.
- Screen scales with your browser window.
- Basic alert window
- Basic win condition
- Infinite layers over the map
- Movement authenticated over the server
- Map data received by the server
- Pre-loader and Loading screen
- Basic UI elements
- Being built from the ground up to work for multi-player games.
- The game’s tile set and tile image sizes can be changed by editing a single array.
- Change movement and positioning, so the character can move around freely and isn’t locked to a grid.
- Allow for the user to hold down a button to move. Currently you have to tap the direction to move each block.
- Reduse bandwidth and lag by adjusting how movement is handled in client-server communication.
- Reduce bandwidth and lag by using WebSockets to poll.
- Replace the tileset with a cool custom tileset.
- Map to map teleportation.
- Multi-player functionality.
- Quest System
- Character registration and creation.
- AI systems for guided movement
- AI systems for combat
My First WebGL application
I wrote a PHP class that was a recursive backtracer maze generator (will post regarding this later), so what I did was create a second class that transforms the map data from the recursive backtracer and translate it into a 3D Scene.
So far it’s fairly simple, I have a premade set of prims for each wall, ceiling, and floor. Then I just run through the map cell by cell, cloaning the prims and then just adding the row number and column number to the X and Z positions.
The camera view is first person, but you can still walk through walls I haven’t learned how to keep that from happening yet.
I marked the end of the maze with a gold goblet.
When looking to design a new website, it helps to look at pre-existing work. Here’s some of the websites I like to visit to become inspired.
Nike – http://www.nike.com
Nike looks just as cool being worn, as it does on the internet. Their website sports the same futuristic sporty look that Nike has always been known for. It’s going to be years before this website looks “old”, because besides just looking futuristic it’s very well designed and truthfully very simple. There’s not much maintence and if they want to vastly change the look of any one page, they just have to switch out the background.
Apple – http://www.apple.com/
Apple is well known for easy to use products, and good design. Many of their products actually look like they were designed by Dieter Rams. Their website is a perfect personification of their design principals. Timeless, and minimalistic.
Microsoft – http://www.microsoft.com
Microsoft has to be the most difficult site to design, not because their design is complicated but because their business is so huge. Microsoft has so many diffrent departments, and each one want’s a piece of the home page. Microsoft somehow hit it right, and designed a site that will bring you right to where you need to go with minimal effort or hunting.
Selected Web Design – http://www.selected-webdesign.com/
Selected Web Design is a website full of other very good and interesting designs, they’ve got categorys and other ways to filter the selections and find a site similar to your taste. You can find your own inspirations here.
My business card
I’m a designer, and a programmer so I really wanted something that looked unique yet technical. All I wanted the card for was my name, what I did, and ways to contact me. I went over multiple styles, and with the tips of a few graphic designer friends at Angelworld forums (Vincent Lai, Ikomi, Crays, and McLaranium) I decided that a very simple style is the best.
I finished the design, and my next task was finding a printer. My design is very simple, has a high tolerance for printer issues, and I wasn’t looking for any special effects. Most printers are able to do the job well enough. It ended up at who would provide the best quality paper, at the best price and still have a good rap for decent printing. After reading some reviews online, and consulting with local printers I decided to go with GreatFX.
The work done by GreatFX at GreatFXBusinessCards.com was outstanding and fast. I sent the cards to print on September 7th, and received them in the mail September 14th. The ink didn’t smudge, the lines were crisp, and the fine print was very readable. I’m happy with the work done by GreatFX.
It’s time for me to start handing out my cards!
Dieter Rams 10 Principles of Good Design
From the website http://www.vitsoe.com
“As good design cannot be measured in a finite way he set about expressing the ten most important principles for what he considered was good design.”
1. Good design is innovative.
2. Good design makes a product useful.
3. Good design is aesthetic.
4. Good design makes a product understandable.
5. Good design is unobtrusive.
6. Good design is honest.
7. Good design is long-lasting.
8. Good design is thorough down to the last detail.
9. Good design is environmentally friendly.
10. Good design is as little design as possible.
How to make Lenticular Images in Secondlife
Found an article on Sculpt Blender where the author Murgy has discovered a neat effect in the second life viewer that allows for Lenticular Images (the images that change depending on what angle you view it). He goes into a bit of detail on how he discovered it, I’m going to give you a step by step process and provide you with the sculpted texture.
I’m assuming you understand the basics of creating objects in secondlife.
Step 1 – Creating the prim
Upload this sculpted texture, and name it something useful to you.
Create a new prim, a cube works. Open the object tab, change the building block type to “sculpted”. Select the uploaded texture. Then change the stitching type to “Plane”. Open the texture tab, and change the transparency to 1 or higher.
You now have the basics of a lenticular lens, if you move the viewer from left to right you will see the texture change a little.
Create a texture in photoshop, the maximum height for textures is 1024 in secondlife.
If you want a 4:3 aspect ratio for the images, set width as 341px and height to 1024px .
Is your website too information hungry?
To the average user, registering with a website is annoying. If you’re just trying a new game out, or posting a comment on a blog then it feels like a waste of time that could be spent on typing the comment or playing the game.
To the webmaster, registration may seem necessary to use many features of your site or game. For instance if you run a chess game, you may want users to register for multiplayer features.
As a developer you need to think about how much information you really need. Most web registrations require at least 3 points of information; they are email, a unique username, and a password. However in many cases, you don’t need all three of these let alone even one.
- Email: Besides password resets, and website newsletters, and message replies there’s no reason to require an email. Uniquely identify the user by an incrementing number in the database instead. If the users are expected to pass their account name to other’s in order to play together, be creative and make a unique address system.
- Username: Usernames are great as they can link a user’s online person to their posts or game. However its not necessary and just extra fluff if their just commenting or trying out the game. Let there be Anonymous Cowards. If you run an online game, then give nameless users an automatically generated name. If you want users to have a way of uniquely identifying themselves try making up an address for them, you can theme it to the game (such as: 123 fake st. for a sims game, Quadrant 78.249.34b for a space game).
- Passwords: Truth is that there are many people who only use one computer, and it’s not public. You can always set a cookie, and make a password optional for those who do use multiple computers or don’t want a cookie.
By using these suggestions, your users can spend less time figuring out usernames and passwords and will hopefully find your website more enjoyable and return later.
The underused strength of SecondLife
In case you haven’t heard, SecondLife is a massively multiplayer online environment that consists of a single large world created entirely by it’s players. Any player can create objects, upload sound, and upload images. The players can also program these objects to do whatever they may wish. Players can own bits of land, or even entire regions in this “game.” They can then turn and do whatever they wish with this land, this includes providing for-profit services.
Secondlife also comes with audio/video streaming, voice chat, and text chat room features. Most of the game is considered a public enviroment, similar as to the web. An account with secondlife is free, and the download for the viewer is small. A common website is able to hyper-link to any location within secondlife. It’s these features that make secondlife a prime tool for public-conferences, however I believe this feature is highly underused.
There are serious benefits to hosting a global conference in secondlife as opposed to a standard convention center in a big city. No matter where your attendees are physically in the world, you can easily attend a live event within secondlife. Secondlife offers methods of gathering attendance fees for all participants in your conference. It’s easy to be heard on secondlife, as each player has control over their own audio levels every word said will be heard by everyone. It’s easy to be seen on secondlife, as the players can move their cameras independently from their own characters; this allows people to focus on your slides zooming and getting close. Similar to front row seating for the entire conference, everything is heard everything is seen. Easier to attend for everyone, players who attend the Secondlife conference can be at home laying around in their underwear. Easier access to information, you can shoot everyone a web address or a large text file or images of your presentation subject, no need to print it out on a limited 3 fold or booklets.
However I believe the greatest strength is the ability for attendees to participate. You can create an application that allows attendees to vote on topics and share their ideas in real time. You can allow attendees to stand up, talk, and be heard by everyone. You also have the ability to control the crowd, so the only ones heard are those who are talking.
These are my thoughts about secondlife. Post in comments if you have anything to add, or if you also know of an underutilized/unused possibility of secondlife.
Really awesome art.
Caleb Charland has some really awesome art, give him a look.
Older Posts »