Project XYplorer on Linux: 15/03 New Video!

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
40k
Posts: 234
Joined: 09 Dec 2011 21:25

Project XYplorer on Linux: 15/03 New Video!

Post by 40k » 03 Feb 2014 16:15

Chapter 1: Installation


1.1: Getting Linux
Chapter 1 video on Youtube

Testing is currently done on Ubuntu 13.10 destribution.

You can download Ubuntu here:
http://www.ubuntu.com/download/desktop

I'm going to assume a basic knowledge of Linux for this guide.
If you're new to all of this I would recommend running Ubuntu in a virtual machine before deploying to an actual machine.

You can download Oracle Virtual Box (free) here:
https://www.virtualbox.org/wiki/Downloads

1.2: Installing and Configuring Wine
Running a Windows program on a Linux machine requires the WINdows Emulator (WINE). Ubuntu has a stable version of WINE in the standard repository, but there's a few nice new features in the current development branch such as improved font smoothing, so we'll make use of the development branch instead.

To install the latest development version we're going to add it from the official WINE PPA (Personal Package Archive). PPA's are a Ubuntu "feature", so those of you who are on another distro may need to find their specific package or build from source.

Run this code, one line at a time and without the dollar ($) sign, in your terminal:

Code: Select all

$ sudo add-apt-repository ppa:ubuntu-wine/ppa
$ sudo apt-get update
$ sudo apt-get install wine1.7
Your system now has the latest WINE installed.
Now we will set the WINE directory that will house our emulated software. By default WINE will select the following path as WINE directory:

Code: Select all

/home/<username>/.wine
Before starting a program WINE will look for the WINEPREFIX environmental variable. If this variable contains a valid path, WINE will use this path as your WINE directory. This means that you can in fact have multiple WINE directories. This is particularly useful when dealing with software that tends to misbehave since you can simply isolate that particular program to a separate WINE folder.

Code: Select all

export WINEPREFIX=<set your desired WINE path here>
Remember to add the above line at the end of your .bashrc file to have set over multiple sessions
We can now run the WINE initialization command which will populate our WINE folder with the required emulation skeleton

Code: Select all

$ winecfg
If you like you can select your WINE directory on the fly here by running this command:
$ WINEPREFIX=<path to desired winedirectory> winecfg
The final step is to enable VB6 emulation. We can use Winetricks to help us. Winetricks is (simplified) a helper utility for Wine that mainly helps you solve Windows dependencies for the Windows software you are trying to run under WINE. The required file is attached to this post for convenience, otherwise you can download it yourself from the link winetricks will give you.

Code: Select all

$ winetricks vb6run
Now we can install Xyplorer! The installation process is simple. Once WINE starts the installer you will notice everything looks exactly the same as under Windows. Even when you want to select the installation directory it looks like what you are used to with C:\ etc... Remember that you are in fact installing XYplorer in the WINE directory we configured earlier.

Code: Select all

$ wine XYplorer_13.70_Install.exe
Chapter 2: Starting XYplorer

2.1: Doing your first test-run!
You may start a Windows executable by navigating to the install folder and running the .exe file with the wine command. Starting XYplorer on my system looks like this:

Code: Select all

$ wine ~/.wine-xy/drive_c/xy/XYplorer.exe
When you start XYplorer you will be greeted by the error IB@160. It is not yet known what triggers this but testing has shown there is no system impact. You may safely click "Cancel" and XYplorer should function normally thereafter.

Image

The terminal window will display all WINE and XYplorer activities. While this is particularly useful during debugging it looks unsightful. Instead, we're going to make XYplorer launch from an icon in the Ubuntu sidebar exactly the same way it does under Windows

Image

2.2: Adding XYplorer to the sidebar
Ubuntu deals with "shortcuts" in a similar way as Windows. There's 2 steps involved. First we must make an executable shell script, second we must make the launcher file. I recommend reading this Ubuntu Help article before proceeding:
https://help.ubuntu.com/community/Unity ... sktopFiles

STEP 1: Making the shell script
You need to specify the location of your wine folder (the wineprefix) followed by the wine command to launch XYplorer. Here's what that looks like on my system.

Code: Select all

WINEPREFIX=/home/me/.wine-xy wine /home/me/.wine-xy/drive_c/xy/XYplorer.exe
Save that file somewhere in your home folder and make sure it is executable by running this command:

Code: Select all

$ chmod 700 myfile.sh
You can test your shell script by running it from inside a terminal like so:

Code: Select all

$ ./myfile.sh
That should launch XYplorer.

STEP 2: Making the launcher file
If you read the Ubuntu Help article above you should understand how launcher .desktop files work. They are pretty self-explanatory, but remember to ensure your launcher file is executable. You make it executable in the same way as the shell script, using chmod 700. Getting the shell script and launcher file correct can be somewhat tricky so please don't hesitate to contact me or post below with any questions. This is what my .desktop file looks like:

Code: Select all

[Desktop Entry]
Version=1.1
Name=XYplorer
Exec=/home/me/bin/XYplorer/start_xy.sh
Icon=/home/me/bin/XYplorer/icon.png
Terminal=false
Type=Application
Categories=Utility;Application;
Once saved you can drag this file to your sidebar from inside the default Ubuntu file manager.
Image

Image

Chapter 3: Improving the look and feel
Font rendering works differently on Linux compared to Windows. Windows makes use of some particular "cheats" and "tricks" to make TrueType fonts look "good". These are not available or hard to reproduce on Linux. This chapter will deal with how to integrate the way XYplorer looks with the rest of your Linux system.

Obtaining new fonts and a few words on the Infinality patches
As I said earlier my distro of choice is Ubuntu due to it having fairly decent (OSX-styled) font rendering. Other distros may look different. The Infinality patch set aims to improve TrueType rendering by tweaking the font engine. The patch set is beyond the scope of this guide but I highly recommend reading up on them (or even trying it out). You can download the patch sets here. Pre-compiled packages are also available

My font of choice for Wine applications is "Droid Sans". You can download it freely from Google.
https://www.google.com/fonts

Fonts depend on personal taste!
Below are a few examples of what XYplorer will look like on first start. It's hard to post full screen shots, but due to the small size of the fonts used the program looks out of place between other Linux programs.

Image

Image

Image

Image

A couple of small fixes to make Xyplorer fit in
Step 1 is to slightly increase the dpi setting for wine applications. Because each WINEPREFIX folder acts as a wholy-contained Windows emulator you can easily have different dpi settings for different applications.

I have set the dpi from 96 to 100

Code: Select all

$ winecfg
Image

Step 2 is to change the fonts in XYplorer from Tahoma to Droid Sans and also to slightly up the size
Image

The Droid Sans font acts similar to Tahoma and Segoe UI in that it is limited in width more so than Open Sans or Ubuntu. This seems to work better with Windows-style interfaces. Wider fonts often look out of place or text may even fall off the edge of a Label or Button because there is no more space left. Numbers also seem to render much better compared to Tahoma, especially at small sizes (<10)

Image

Image

Image

Image


Chapter 4: Giving XYplorer access to native applications
Because XYplorer runs in a Windows emulator you will run into some not-so-obvious problems when dealing with files on Linux. XYplorer is perfectly capable of browsing and manipulating your file system and acts according to the permissions granted to the user account that launched Wine.

But what happens when you want to play a media file, read a PDF document, or extract an archive? Double-clicking files inside XYplorer on Windows simply starts the program you have designated for that. On Linux, XYplorer can't easily access the native applications on the system. Wine supports linking file extensions to native Linux applications. Unfortunately, the process involves editing entries in the registry.blob of your Wine emulator, which is laborious to say the least.

Introducing: XYassistant(.py)
Once again, XYplorer's rich feature-set comes to the rescue. Custom File Assosciations can be used to launch native Linux applications from inside XYplorer in exactly the same way things work on Windows. To help XYplorer deal with the complexities of launching a native application I have developed a helper script in python. Python comes bundles with any Linux distribution and so it will work out of the box.

You define Custom File Assosciations the same way you do on Windows.
extension;extension;extension > python-location xyassistant-location native-application.

For example:

Code: Select all

jpg;JPG;png>/usr/bin/python /home/me/xyassist.py eog
mp3;mp4;flv>/usr/bin/python /home/me/xyassist.py vlc
html;chm;txt>/usr/bin/python /home/me/xyassist.py sublime_text

Code: Select all

''' Simply save this script and name it xyassistant.py
	
	Open your Custom File assosciations and define a rule according to the example below:
	avi;mp3;mp4>/usr/bin/python /home/<your user name>/xyassistant.py vlc

	You must specify the location of the python interpreter on your system followed by the location of
	xyassistant followed by the executable application of your choice. If you save xyassistant.py outside of your home folder you need to ensure XYplorer has rights to access that location as well.
'''
#/usr/bin/python

import os
import re
import subprocess
import sys

class Assistant(object):
	def __init__(self, executable, windows_path):
		self.executable = executable
		self.windows_path = windows_path

	def translate(self):
		# extract the file name from full windows path
		filename = re.search('(?<=\\\\)[^\\\\]+$', self.windows_path).group(0)

		# join filename to working directory path to create full path
		linux_path = '/'.join([os.getcwd(), filename])
		self.linux_path = linux_path

	def start(self):
		# print([self.executable, self.linux_path])
		subprocess.call([self.executable, self.linux_path])
		

if __name__ == '__main__':
	# ignore first argument as it is path to this script
	assistant = Assistant(sys.argv[1], sys.argv[2])
	assistant.translate()
	assistant.start()
Image

Image

Annex A: Bugtracker
Fixable or workaround exists

Code: Select all

>>> Error 445 for proc IB@160
Appears after starting XYplorer.exe and can be clicked away. Has no known further consequences

>>> Error 13 for pList@21
Has to do with how file sizes are displayed. Often appears when switching file size columns away from default kB. Can be fixed by resetting the column back to kB. May cause WINE crash if allowed to recur multiple times by switching to different folders

>>> Attempting to "search" /root or /proc
May cause prolonged lock-ups. XYplorer should return eventually but may take several minutes

>>> Custom File Assosciations
Domewhat broken. They work by themselves and Xy is able to launch native UNIX applications from their full path (e.g. /usr/bin/vlc) but the file path that is fed to the executable is corrupt (it contains the Windows drive letter which is not accepted in UNIX). In theory, you could write a shell script that regexes out the drive letter to make the path legal. I'm going to explore that more later because it means XYplorer could be used to navigate to a file and then it hands over the file handling (pdf, video, audio, etc...) to the UNIX native program. Native file handling can be done by editing the wine registry but obviously that's a chore compared to our file assosciations

>>> Xycopy.exe dialogues
Actual I/O copy operation works almost up to native speed, Dialogue progress bar sometimes not updated.
Broken

Code: Select all

>>> Unix environment symbolic links are not displayed

>>> From version 13.70.0100 and later changing the column for file size to any other value than KB(rounded) will cause runtime error 97 to occur. This will crash xyplorer beyond recovery
Last edited by 40k on 15 Mar 2014 18:00, edited 7 times in total.
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: Project XYplorer on Linux

Post by 40k » 03 Feb 2014 18:59

reserved
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: Project XYplorer on Linux

Post by 40k » 03 Feb 2014 19:54

reserved
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: Project XYplorer on Linux (Update 15/02) Screenshots!

Post by 40k » 15 Feb 2014 00:00

Updated 15/02/14!
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

admin
Site Admin
Posts: 46920
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Project XYplorer on Linux (Update 15/02) Screenshots!

Post by admin » 15 Feb 2014 07:04

:appl: You really mean it! :appl:

Did you get any response from the Linux crowd yet?

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: Project XYplorer on Linux (Update 15/02) Screenshots!

Post by 40k » 15 Feb 2014 17:07

admin wrote::appl: You really mean it! :appl:

Did you get any response from the Linux crowd yet?
I plan to open an entry in the WineDB. But the best exposure would come from getting found through google. Oddly enough, this thread is currently the second hit on google for the query "xyplorer linux". I'm hoping Google will find this thread and start listing it. Don't know how to optimize that though, perhaps a sticky would help?
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

admin
Site Admin
Posts: 46920
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Project XYplorer on Linux (Update 15/02) Screenshots!

Post by admin » 16 Feb 2014 13:13

I don't think sticky will help. Google needs a while to update. It will work out. It sounds too great not to work out. :biggrin:

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: Project XYplorer on Linux (Update 15/02) Screenshots!

Post by 40k » 22 Feb 2014 18:21

admin wrote:I don't think sticky will help. Google needs a while to update. It will work out. It sounds too great not to work out. :biggrin:
I keep updating in the hope that the mighty Google Bot will be merciful :P
Added a new section on how to add XYplorer to the toolbar the same way it does under Windows.

Some new feature I discovered is the ability to launch a terminal inside the current folder.

Custom File Icons are giving me a headache at the moment. XYplorer will show icons for executables such as wmp.exe or vlc.exe and CFI will use them. But it won't show icons from png, ico or other file formats the way it does on Windows. Interesting.... :?
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

Regmos
Posts: 263
Joined: 22 Dec 2012 07:27
Location: Copenhagen

Re: Project XYplorer on Linux update 22/02

Post by Regmos » 04 Mar 2014 14:46

On Linux Mint 13 Maya (Mate) LTS in the latest Virtualbox

Installed the default Wine (1.6.1) from the Software Manager, and ran Winetricks from the "Startmenu" to configure Wine.

Then I followed Seren dipity's instructions here: http://www.youtube.com/watch?v=fJwCQxIcKR4

Expand the description and follow the links. These are the components to install in Wine.

Image

When you're done installing, rightclick the desktop, "Create launcher", name it and insert he command

Code: Select all

env WINEPREFIX="/home/USER/.wine" wine C:\\Program\ Files\\XYplorer\\XYplorer.exe
Rightclick the launcher, select "Proporties", click the icon and find a nice XYplorer image. Close "Proporties" and doubble click the launcher. Et voila.

Image

You will get the error mentioned above. Click that away, and everything seems to work like a charm.
Kind regards
Regmos

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: Project XYplorer on Linux update 22/02

Post by 40k » 14 Mar 2014 23:21

Regmos wrote: ...
You will get the error mentioned above. Click that away, and everything seems to work like a charm.
Glad to see it's also working on Mint!
I'm happy to report that Xyplorer is now my go-to file manager on Linux. There's only a few features that out-right don't work under Wine but none that make the product unusable.

At the moment Custom File Icons are working but only when the source icon is in the *.exe format. Pointing Xyplorer to a *.png file does not work for example.
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

Marco
Posts: 2256
Joined: 27 Jun 2011 15:20

Re: Project XYplorer on Linux update 22/02

Post by Marco » 15 Mar 2014 00:22

Well, *.png aren't supposed to work on Windows either. Or I'm missing something?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

admin
Site Admin
Posts: 46920
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Project XYplorer on Linux update 22/02

Post by admin » 15 Mar 2014 08:13

Correct: No png support here.

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: Project XYplorer on Linux update 22/02

Post by 40k » 15 Mar 2014 12:16

admin wrote:Correct: No png support here.
Aha so it seems I messed that one up. Here's a bit of a mystery. When i point Custom File Icons to a *.ico file XYplorer does not recognize the file and simply displays the orange warning triangle in the CFI menu. In the file-browser nothing changes.
But when I point CFI to a *.exe XYplorer does take the icon from the *.exe file and uses it successfully in the browser.

I thought *.exe files just embedded a *.ico file?
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

admin
Site Admin
Posts: 46920
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Project XYplorer on Linux update 22/02

Post by admin » 15 Mar 2014 13:30

XY shows the icon that those files show in in the normal file listing. With ICO files this is the icon itself, with EXE an embeded icon (if there is one). In all cases the shell is responsible for extracting the correct icon.

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: Project XYplorer on Linux update 22/02

Post by 40k » 15 Mar 2014 18:01

admin wrote:XY shows the icon that those files show in in the normal file listing. With ICO files this is the icon itself, with EXE an embeded icon (if there is one). In all cases the shell is responsible for extracting the correct icon.
Ok so it is shell related. Interesting.
I've made a video for chapter 1 today! http://youtu.be/BorPg6E-IO8
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

Post Reply