Tuesday, 15 October 2019

How to create a desktop menu entry manually in Linux

This is kind of an odd thing to be posting about nowadays with Linux desktops mostly including a menu editor or installable third party packages like menulibre and alacarte being able to achieve the same outcome. However, LXQt does not include a menu editor that is comparable to the above options, and whilst both of the above can be installed in Lubuntu or Debian/LXQt, the results of running them are confusing. It is possible with PCManFM-Qt file manager to edit applications shortcuts directly in a specific area of the standard user interface but that is confusing and difficult to understand. Fortunately the majority of desktop environments support a standard method of creating shortcuts as .desktop files stored in a standard location.

The .desktop files are created in either of the following locations: /usr/share/applications or ~/.local/share/applications. The difference between these is that the former location is computer based and the latter is user based. For this example we have downloaded Firefox Developer and extracted it from the download file. This does not give us that menu shortcut so we have to create it. Typically we will copy the FFDE files to ~/Applications folder and create a local shortcut in ~/.local/share/applications which has a double advantage at reinstallation time that both the application and its shortcut are located in the user profile and therefore do not need to be reinstalled when the operating system is.

The typical format of the .desktop file looks like the following (in this case the actual parameters used to start Firefox Developer from where we installed it):

[Desktop Entry]
Categories=Internet
Comment=Firefox Aurora with Developer tools
Exec=/home/patrick/Applications/firefox-dev/firefox %u
Icon=/home/patrick/Applications/firefox-dev/browser/chrome/icons/default/default128.png
Name=Firefox Developer Edition
NoDisplay=false
StartupNotify=true
Terminal=0
TerminalOptions=
Type=Application
Version=1.0
 
Some of the above might not be needed.

The key issue, however, is that LXQt (at least on Lubuntu, but probably also on Debian) does not seem to recognise user specific icons as part of its menu. When one was created like the above, it ended up being put into the Other submenu rather than the Internet submenu. Likewise one could be created with menulibre and would be created in the same location by default (~/.local/share/applications) but ran into the same issue that LXQt would push it into the Other section of the menu. I am still experimenting to see how this can be overcome but for now, either method is possible but if both are creating the same outcome then using menulibre is obviously preferred as a GUI.

Friday, 4 October 2019

Arlec Plug In Heater Controls [1]

Arlec is an old established Australian brand of electrical products (such as extension cords and plugboxes, timers etc) that has been available in NZ for many years - at least 40 to my recollection, their innovative designs and features continue to the present day.

With plug in electric heaters sometimes certain desirable features that would be easy to fit for a wired in heater, such as a time delay switchoff or a thermostat, are not always easy to find. I can recall various brands having come and gone, for example countdown timers from BenQ and HPM come to mind. Likewise various brands of plug in thermostat. Arlec is now making both types of product and selling them through Bunnings. (I also remember Kambrook plug in timers with some affection from my youth but they have diversified more into household appliances nowadays). I do have still a Honeywell plug in timer fitted with a cord and interrupted phase tapon plug which can be mounted on a wall some distance from the heater and this is still going strong more than 30 years later.

The Arlec PC900 plug in countdown timer is a mechanical timer giving 2 hours delay and simply plugs into a 3 pin outlet and the heater or other device plugs into it. 

The timer appears to do what is expected of it. However due to its design, it will block an adjacent outlet in a plugbox or multi outlet wallplate. This appears to be a design factor with Arlec products in this range (several different types of timer including the PC697 digital 7 day timer).

Newly available from Bunnings is the THP401 which is clumsily described as a "temperature controlled programmable timer". 

So far as I can ascertain (it wasn't on the shelf at the Bunnings store I visited today) this should really be described as a digital plug in thermostat. Because Arlec do not appear to have added this model to their website yet and because there was not one on the shelf at Bunnings I was unable to verify the description of the unit.




Wednesday, 2 October 2019

Using a Windows 10 computer as a media player

UPDATE 19-10-7: Due to cost the Win10PC was put into an old obsolete chassis and parked in a corner of the room so it can be used when needed but it will not sit on my desk and will hardly ever be used. This was accomplished using an identical spare G-E350 WIN8 mainboard and the boot disk removed from the Mini-ITX chassis and it works fine. The Mini-ITX chassis was then set up with Lubuntu using the 500 GB HDD that was in it for a data disk for Win10PC.  x11vnc has been installed to enable remote control for maintenance purposes and with Kodi it works a lot better than when it was running Windows 10.

UPDATE 19-10-6: Whilst this computer will do for now I am looking at replacing it when I have the resources with a new Raspberry Pi (the new RPI 4B has a significant performance improvement over the 3B that I already have) or NUC running Linux just because it is getting a bit long in the tooth with performance issues, but in reality most of these issues are related to Windows 10's excessive resource demands on it. The other option being to put the Windows 10 computer into another chassis and release this chassis for the spare board of the same type and run that on Linux so I will consider the options for that.

UPDATE 19-10-3: After the heap finally managed to update itself to Windows 10 release 1903 (a whole drama and story in itself, which has taken months of failing to install the update, and me deciding I just could not be bothered troubleshooting, then finally it managed to install itself successfully last night), Kodi started having playback problems only with videos, every few seconds the audio would drop out momentarily. The solution I found that worked was to go into Settings, Player Settings, Videos, change the rendering method to DXVA and turn off DXVA hardware acceleration.

Back in December 2014 I got an Antec Mini-ITX chassis to use with a Gigabyte GA-E350 WIN8 board that I had purchased. I actually had two of these boards (the other one is stored as a spare). Given it's almost five years I'll elaborate that I originally got these boards, which were very cheap since they were designed for low power compact computers needing a power supply of less than 50 watts and have an integrated AMD E350 CPU. These photos were taken at the time I built the system and are missing from the article that is on the blog and I need to put them back in it sometime.

The bare chassis looking through the grille on one side which is for cooling, through the I/O plate on the back.
 The partly assembled system. The board is installed and screwed in place and the internal cables (mainly front panel USB / switch / LED) are just loose waiting to be plugged into the board. You certainly need the low profile cooler on this board because a full size one would have trouble fitting inside.

 The system assembled and running, with the display showing a setup screen. The extra cables that weren't in the previous picture are for the hard drives.
 On the back of the chassis under a blank panel is the mounting plate for the 2.5" hard disks (there is room for two of them). You can see one is installed here with the power cable hanging loose in the 2nd mounting position. Behind the HDD is the bottom of the motherboard. The mounting plate is detachable because the disks sit on the inside of it and there are insulating pieces supplied to prevent the HDDs from shorting out on the metal mount plate.
Looking inside the complete system installing Windows. The cables have been tied back in place ready for the lid to be put on. The power input cable, which is for 19VDC from an external power supply that is supplied with the system, can be seen upper right. There is a small power supply board inside the chassis that generates the usual voltages (+/-12V +/-5V +3.3V etc) at up to 60 watts for the system with the usual ATX power connector.
Anyway if you followed this blog you'd know that this system has ended up as my one and only Windows computer and now has 10 Home running on it, and until recently was hardly ever used. But now I want to get some use out of it so I've been setting it up as a media player computer for bedside use, which means mostly playing music or playing videos with the screen turned off. The main issue with an older system like this one is the CPU won't have the codecs built in for playing a lot of video which means it can't handle the higher resolution or high bit rate videos well, since video playback on most operating system these days depends on the CPU doing hardware decoding, a key reason why I upgraded a Sandy Bridge system last year because it had trouble playing back WEBM videos. In this case for the use this system is being put to, that isn't a problem, and Youtube videos that stutter can be changed to a lower bit rate in the browser.

So what software do we want to use compared to what we can use in Linux? Kodi is available on Windows and it worked fine this time. I had trouble with it on a previous Windows installation where there was no sound. Windows Media Player has been out of Windows for so long that I have almost forgotten what it was like, and the alternative app built into 10 is nowhere near as good as Kodi. The other main application needed is a sync tool to sync the video and music libraries from another computer. Since I use NFS for my day to day networking stuff in Linux and MS doesn't make their NFS networking stuff available to Home Editions I had to set up a Samba share on the mediapc and network using the built in SMB/CIFS support for Windows. Karen's Replicator is the ideal program for syncing. I used to use this to back up my Windows computers back in the day and it does everything needed to get a full mirror that also replicates deletions on the source.