Prevent Sleep for Deluge on Windows

Updated 2013-02-17: “Much Improved”

A few months ago I started using Deluge as my torrent client instead of µTorrent. Whilst overall I feel Deluge is considerably better, one issue I’ve had is that it doesn’t prevent my computer from sleeping, which is an a bit of an issue if the computer is left unattended download something. This script disables sleep when Deluge is active using AutoIt, and resets sleep to the previous value once downloads have finished. For this to work Deluge needs to be in classic mode with show session speed in title bar activated, both of these settings are found under preferences/interface. Also, a word of warning, this may not work on versions of Windows earlier than 8, though you’re welcome to try it, also note its guaranteed not to work on Windows XP and earlier. You can run this without AutoIt just download the executable version.
Something else to keep in mind is that this works using a relatively simple macro which by necessity flashes screens open, changes options and presses buttons. If this kind of behaviour concerns you, you may wish to avoid using the script.

Downloads
Executable
Script (Requires AutoIt 3 to run)

(You may need to right click and select “save as” or whatever variant is in your menu.)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
; A script to toggle sleep off while deluge is downloading files and turn it back on once its finished and vice versa. 
; Created by Furgelnod of furgelnod.com
Global $osValue = ""
Global $sValue = ""
$delugeexe = StringTrimLeft( StringTrimRight( RegRead( "HKEY_CLASSES_ROOT\Deluge\shell\open\command", "" ), 6 ), 1 )
AutoItSetOption ( "WinTitleMatchMode", 2 )
AutoItSetOption ( "TrayAutoPause", 0 )
If Not FileExists ( $delugeexe ) Then
	MsgBox( 16, "", "Deluge is not installed" )
	Exit
EndIf
If Not ProcessExists ( "deluge.exe" ) Then
	run ( $delugeexe )
EndIf
ProcessWait ( "deluge.exe" )
While ProcessExists( "deluge.exe" )
	If WinExists ( " - Deluge" ) and WinExists( "D:0.0" ) and $sValue <> $osValue Then
		$sValue = $osValue
		Call ( "_toggleSleep" )
	EndIf
	If WinExists ( " - Deluge" ) and Not WinExists( "D:0.0" ) and $sValue <> "Never" Then
		$sValue = "Never"
		Call ("_toggleSleep")
	EndIf
	If Not WinExists( " - Deluge" ) and ProcessExists( "deluge.exe" ) Then
		sleep ( 10000 )
		If ProcessExists ( "deluge.exe" ) Then
			run ( $delugeexe )
			WinActivate ( " - Deluge" )
			WinWaitActive ( " - Deluge" )
			WinClose ( " - Deluge" )
		EndIf
	EndIf
	sleep( 10000 )
WEnd
If $osValue = "" Then
	Exit
EndIf
If $sValue = $osValue Then
	Exit
EndIf
$sValue = $osValue
Call ( "_toggleSleep" )
Exit
 
Func _toggleSleep()
	run ( "control.exe /name Microsoft.PowerOptions /page pagePlanSettings" )
	WinActivate ( "Edit Plan Settings" )
	WinWaitActive ( "Edit Plan Settings" )
	If $osValue = "" Then
		$osValue = ControlGetText ( "Edit Plan Settings", "", "[CLASS:ComboBox; INSTANCE:4]" )
	EndIf
	ControlCommand ( "Edit Plan Settings", "", "[CLASS:ComboBox; INSTANCE:4]", "SelectString", $sValue )
	ControlClick ( "Edit Plan Settings", "Save changes", "[CLASS:Button; INSTANCE:1;]" )
	WinWaitActive ( "Power Options" )
	WinClose ( "Power Options" )
EndFunc

Continue Reading →

Tasmanian Holiday Calendar Redux

My original post: Tasmania now has a calendar (2010)

I’ve updated my Tasmanian Holiday Calendar with the statutory holidays for 2013, 2014 and 2015. While going through the Statutory Holidays Act 2000 I’m fairly sure I noticed some changes to the schedules and so was hesitant to update it for the next decade, as I had thought of doing, in case there where any more changes. The link to the calendar is the same as for the original post as I simply added new events to the existing Google calendar. You should be able to use this on any calendar application, independent of what OS/platform you are using.

Note that some holidays are observed only in particular municipalities, these are marked ‘(local)’. Also each item on the calendar lists where it is applicable in the event description.

Click here to subscribe to the calendar
Continue Reading →

Six Line A4 Tab Paper

Well here’s something that could be very uninteresting to most people, however life (or at least time) saving to others. I’ve created, using Microsoft Word, pdf / docx files that are lines spaced about 3 mm apart in groups of six for A4 paper. More importantly this gives instrumentalists using six string fretted instruments (i.e. guitars) an easy way to take notes on the songs they are writing or trying to learn. The paper is aimed particularly for six stringed guitar tablature but I’m sure it may have some uses that I haven’t thought of. Without advertising and other random graphic elements my little template hopefully fills what appears to be a gap in availability particularly for A4 size paper. The files contain two pages to assist in duplex printing.

The Files are here below

6 line A4 tab paper (pdf)
6 line A4 tab paper (docx)

Note (2012-11-25) I had accidentally uploaded the wrong pdf, the incorrect / plagiarised file has now been removed and the link updated to the correct file.

Creative Commons Licence
Six Line A4 Tab Paper by Toby Johnston is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Australia License.

Symbol Macros v2

Symbol macros is a tiny programme that allows you to insert a number of diacritics, ligatures and various other symbols using helpful and obvious keyboard shortcuts. It was created using autohotkey a very useful piece of software for remapping keys and creating macros.

Version 2 adds more symbols making it useful for most European languages and changes the end character to ` instead of tab.

UPDATE 2013-01-29: It’s worth noting that today I found a programme that fills the same function as my Symbol Macros only it works slightly better, covering more characters and being kind of configurable. You’re welcome to continue using my software however I suggest you check out AllChars as well over at allchars.zwolnet.com

Download Links

Installer (installed per user): symbol_macros_setup.exe
Source code: symbol_macros_src.7z

License

Creative Commons Licence
Symbol Macros is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Australia License.
Continue Reading →

A Better Firefox Interface

I just finished up my changes to the user interface of chrome they’re implemented using Stylish but the css could be used in userchrome.css if on so desired, I do not however. There is lots of snippet use from JohnBooty’s Firefox 4 userchrome.css: Flat “Chrome-like” toolbar button, and Wmarcello’s Firefox 4 Nightly – Change App Menu Button Text

Changes include

  • Flatted toolbar and reduced gaps between toolbar icons
  • Changed text of appmenu button
  • Changes the appmenu button size (slightly) and colouring
  • Removed the gaps at the tabs sides

You’re best bet for installation is to wonder over to userstyles.org and install my changes from there via this link http://userstyles.org/styles/59721/firefox-4-ui-slim-lined-and-flattened-plus-more (opens in new tab / window)

Screenshot thumbnails (click to enlarge)
Screenshot 1 Screenshot 2

I’ve include the code on this page if you want to look at it here, you’ll note that I’ve changed the Firefox appmenu button to read “Interwebz” if you search for that phrase to find it then change the text to whatever you like.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
/*Flatten toolbar and reduce gaps between icons*/
#nav-bar .toolbarbutton-1,
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button,
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker,
#nav-bar .toolbarbutton-1 {
        background:none !important;
        border:none !important;
        box-shadow: none !important;   
        opacity: 1 !important;
        padding:0px 2px 0px 2px !important;
        }
 
/* Edit text of appmenu button */
#appmenu-button .button-box .box-inherit:before {
    content: "Interwebz" !important;
}
#appmenu-button .button-box .box-inherit .button-text {
    display: none !important;
} 
/* Removes the gaps at the tabs sides */
#navigator-toolbox[tabsontop="true"] #TabsToolbar {
	padding-left: 0px !important;
	padding-top:0px !important;
	padding-right:0px !important;
}
/* Changes to the hideous Appmenu button*/
#appmenu-button {
	padding: 0px 10px 0px !important;
	margin-top:0px !important;
	background-image: -moz-linear-gradient(rgba(255, 150, 0, 0.5), rgba(150, 70, 0, 0.25) 100%) !important;
	}
#appmenu-button:hover:not(:active):not([open]) {
	background-image: -moz-linear-gradient(rgba(255, 150, 0, 0.9), rgba(150, 70, 0, 0.25) 100%) !important;
}
#appmenu-button, #appmenu-button:hover:not(:active):not([open]) {
	-moz-border-left-colors: rgba(255, 255, 255, 0.5) rgba(6, 28, 83, 0.9) !important;
	-moz-border-bottom-colors: rgba(255, 255, 255, 0.5) rgba(6, 28, 83, 0.9) !important;
	-moz-border-right-colors: rgba(255, 255, 255, 0.5) rgba(6, 28, 83, 0.9) !important;
}
 
/* All the UI changes I've made put together lots of snippet use from
JohnBooty's Firefox 4 userchrome.css: Flat "Chrome-like" toolbar button  http://pastebin.com/LndZhE7y
Wmarcello's Firefox 4 Nightly - Change App Menu Button Text  http://userstyles.org/styles/45158/firefox-4-nightly-change-app-menu-button-text
*/

AOE II Launcher (Age of Empires II Display Fix)

This software is a well-presented automated version of a simple fix, effectively it exits explorer, launches AOE II then reboots explorer once you have exited the game. Now to outline the problem that this fixes.

The classic game, Age of Empires II, has a major issue on Windows Vista and Windows 7 that renders it virtually unusable. The issue is that colours are drawn incorrectly and as far as I can gather this is caused by the 256-colour palette being changed while AOE II is running. The palette references colours to do with the taskbar instead of exclusively AOE’s colours; this causes AOE to display the wrong colours. The solution to this is to disable the taskbar while AOE II is running and this is what my fix does. It is a batch file that quits explorer then starts AOE II. It subsequently restarts explorer when you have closed AOE.

Why use an installer?
The reason this is implemented using an installer is because it makes configuration extremely easy the installer can make both the batch file to suit your system, referencing either the original or expanded version of AOE II, and create shortcuts to the batch file in convenient places.

Installer Notes
Please note you do not need administrator privileges to install this fix, however you will need to install it on each user profile you use AOE II in.

General Notes
Because of the nature of the programme all windows open in explorer will be closed and all explorer related tasks will quit (this includes copying files moving files etc.) when AOE II is running. Make sure to finish anything in explorer before using Age of Empires II through the launcher.

Download Links
Installer: AOE II Launcher for Windows Vista / 7 setup

Source Materials (7z): AOE II Launcher Source (7z)
Pure BAT version (for the suspicious and IT orientated): AOE II Launcher – Pure BAT version (.bat)

Why another?
Whilst my previous fix worked and did help a number of people I felt that that idea needed a refresh so I used similar concepts to put together this self-creating batch file within an installer, named AOE II Launcher as the solution. I’ll make a note here too that I actually finished this shortly after releasing the previous fix but due to laziness never got around to uploading it.

License
AOE II Launcher for Windows Vista/7 by Toby Johnston is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Australia License. This license is available on the internet at http://creativecommons.org/licenses/by-nc-sa/2.5/au/. It is a condition of this license that the programme is provided AS IS without warranties of any kind.

Hiding Period Files on Windows

Please first note that I can only verify this works on Windows 7 as I don’t use any older versions of Windows.

I have noticed a distinct need for someone to comment on an easy method of hiding files that start with a period on Windows and finally have found a solution that I myself find acceptable. You may be wondering why someone might need to do this, being a keen supporter of open-source software yet not wanting to relinquish my ability to play games and run commercial software properly I have throughout  the years stuck with using Windows for my computing. Most open-source software on Windows is usually a port from Linux aimed source code, this means they usually use periods at the beginning of the name to hide a file or directory, and rarely do they modify that file or directory’s attributes. For me and anyone using a Windows version greater than XP this means the home directory becomes littered with files and folders. You might say that you could just hide them manually but some programmes such as the GIMP regenerate the files after each use and in doing so reset the attributes and revealing the file. So there’s that a justification of the need for my script.

My solution is to use a hidden (using vbs) batch script timed to run every fifteen minutes to hide all files beginning with a period. This should for most modern computers have no noticeable effect on performance.

You can either follow my simple instructions below or use the installer I complied that will place the appropriate files in the appropriate places automatically.

Period File Hider Setup (exe)

Manual Instructions (for the untrusting or inquisitive)

First you need to create a vbs file we’ll name it invis.vbs note that this file can be used to run any batch script in the back ground. Its contents follows:

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False

Next we’ll create the batch file which I named hpf.bat. The contents follows:

1
2
3
4
5
6
7
cd %userprofile%
:START
attrib +h .* /S /D /L
attrib -h .htaccess /S
::prevents those files being hidden as usually they are worked on
timeout /T 900 /NOBREAK
goto START

Now we need to create a shortcut which is best placed in the startup folder.

the shortcut should be as follows

wscript "ENTER\PATH\TO\invis.vbs" "ENTER\PATH\TO\hpf.bat"

of course substituting “ENTER\PATH\TO” with the path to the files on my system its wscript “C:\batch\invis.vbs” “C:\batch\hpf.bat” for example.


Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Australia License.

Guild Wars Keymap

A Keymap for Guild Wars

So I got into playing Guild Wars recently and noticed a distinct lack of keymaps that could be scaled and that where suitable for printing in B&W, so being the motivated person I am I went ahead and made one myself, hopefully someone else will find it useful. I made this in Inkscape and the links below go to the source file and to a generic svg file. If  you’re just interested in printing this then open the generic version in you web browser and print it, the other file will only display properly in Inkscape.
Guild Wars® Keymap SVGs
Generic
Inkscape (source)
Comments anyone? Continue Reading →

An open letter to Dell on its designs regarding notebook-cooling systems

To Dell (and all interested parties),

For a long time I have been a user of your hardware. There is one reason for this; they are low cost for the specifications that you get. Being cheap, one may be entailed to accept flaws, but when they are in core system, I personally cannot. Having owned several of your laptops, I cannot understand why it is that your designs still include (in your laptops) air intakes underneath the chassis. On both my present Studio 1536 and my old Inspirion 1150, I have experienced minor issues, such as a loud fan through to major issues such as system spontaneous system shutdown, later noted as caused by the CPU overheating. Both these issues are caused by one simple problem: the air intake depositing fine (and coarse) particles of dust, which have been sucked up by the downward facing fan, on to the heat sink. Not only does dust get all over the heat sink but all through the fans case possibly reducing the effectiveness of the fan. This problem can be resolved by a person such as myself by removing the back of the computer and then the casing for the fan and cleaning the dust from the heat sink, but I must state that this is highly impractical and unlikely to occur to the vast number of users of your laptops. Surely then it is your obligation to those customers to improve the technology to alleviate the problem or at least simplify the process of cleaning.

There are several possibilities to resolve this issue yet none have been implemented in the long period of time I have been a customer. The first of which I can think is that the air intake could be placed in a position other than on the underside of the computer chassis. This is done on various cheap brands of computer one that I will note is my HP Mini netbook that gets its air from the right and passing it out the left hand side. Clearly, this is an option that may require major redesign but seeing as it is possibly on $400 netbooks then I must state it could be done without too much expense on larger laptops. The second is the use of a filter that is simple to remove and clean. This would allow those who have read the basic instruction manual to alleviate the problem easily. However, removing the need for consumers to service the product would be beneficial, by means of reducing requirements on them and on your support staff:  as such, the first proposal really should be the one undertaken. Your third choice and one that require very little effort is to include in your manuals details of how to clean the heat sink and a notice of what symptoms the computer may experience due to overheating. This option however shows that your designs are flawed and would require more effort from the consumer and thus more customer support on your part and so is the least preferable proposal I have.

So, I have provided you with my opinion regarding a design flaw in your notebook systems and now it is up to you to correct it. I hope my advice has been of some worth.

Regards,

Toby

An image of my Dell Studio's dust clogged fan and heat sink.

An image of my Dell Studio's dust clogged fan and heat sink.

Order Poster

Order Poster

Another poster, yay, I hear you say =). From my thoughts at the time I began making it, these thoughts permeate almost everything I do. Also I had to do something relating to my disdain for “freedom” as a concept I can’t possibly take seriously. Any who take what you want from it I had a hoot of a time making the damn thing in spurts over the last month (it was difficult getting all the angles and positioning just right). The same on DeviantArt (opens in new tab).

Oh and here’s a link to the svg in case you want to print it. (hosted on deviantART) click here

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

Page 1 of 3123