-
Notifications
You must be signed in to change notification settings - Fork 1
/
INSTALLER.txt
126 lines (96 loc) · 11 KB
/
INSTALLER.txt
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
Magick Rotation 1.7 November 30, 2013
SUMMARY
What you are going to do is install gcc, and the libraries libx11-dev and libxrandr-dev, if they aren't already installed. Using gcc and the libraries you will compile a small file of C code called check.c. That will create an executable binary called checkmagic32 or checkmagic64 depending on your system. You will also copy into place 62-magick.rules which contains a udev rule to create a device node for your tablet PC and the symlink 'magick-rotation' at /dev/input for the node. Then to access the new device node you will create a new group called 'magick' and add your username to the group.
You can then either run Magick Rotation out of the magick-rotation folder as is or go on to install additional files into your system directories.
COMPILE CHECKMAGICK
First ensure you have gcc installed (the GNU C compiler) and the needed libraries. Unfortunately the libraries will have slightly different names in different distros. A little detective work is needed using the distro's package manager or google.
Examples:
For Debian, LMDE, and Ubuntu you could check with Synaptic Package Manager (or the Software Center in Ubuntu) or use the command line by opening a terminal and entering:
sudo apt-get install gcc libx11-dev libxrandr-dev
For Linux Mint the command would be:
sudo apt-get install gcc libX11-dev libxrandr-dev
For Fedora look in Add/Remove Software. Using Find you'll discover the libraries' slightly different names, or you could use 'yum search libx11-dev' say. In which case you'd discover the library in Fedora is called 'libX11-devel'. So if you want to install in a terminal instead of using Add/Remove Software:
su - -c "yum install gcc libX11-devel libXrandr-devel"
For OpenSUSE, go into YaST->Software Management and install gcc xorg-x11-libX11-devel xorg-x11-devel. If you want to use the terminal:
su - -c "zypper install gcc +xorg-x11-libX11-devel +xorg-x11-devel"
Open a terminal, if you haven't already, and change directory into the magick-rotation folder. If you extracted the tar onto your Desktop:
cd Desktop/magick-rotation
Next you want to compile check.c. Determine if you have a 32-bit or 64-bit install by entering:
uname -m
Then, if you have a 32-bit install:
gcc check.c -o checkmagick32 -lX11 -lXrandr
Or if you have a 64-bit install:
gcc check.c -o checkmagick64 -lX11 -lXrandr
Verify that either checkmagick32 or checkmagick64 appeared in your magick-rotation folder. At your option you could then go on to move the checkmagic executable binary to /usr/bin, e.g.:
sudo mv checkmagic64 /usr/bin/checkmagick64
UDEV RULES
Now copy (cp) or move (mv) the 62-magick.rules file in the magick-rotation folder to where your distro wants custom udev rules added. Use root/super user priviledges (since you are modifying a system file).
Examples:
For Ubuntu enter:
sudo cp 62-magick.rules /etc/udev/rules.d/62-magick.rules
For Fedora or openSUSE enter:
su - -c "cp /home/yourusername/Desktop/magick-rotation/62-magick.rules /etc/udev/rules.d/62-magick.rules"
Verify that 62-magick.rules is now present in /etc/udev/rules.d.
Next you need to add a new group we'll call 'magick':
sudo groupadd magick
Now add your username to the new group. This command works for Fedora and Ubuntu, e.g. for Ubuntu:
sudo gpasswd -a <your username> magick
For openSUSE to add your username use:
su - -c "usermod -A magick <your username>"
To verify the group 'magick' was added enter:
groups
You should see 'magick' among the groups. To verify your username was added to it enter:
getent group magick
or
cat /etc/group | grep magick
Only your username should ever be in the group.
Once you do that you are done with the minimum needed to run Magick Rotation from its folder, wherever you have choosen to place it in your username directory. Reboot to activate the new udev rules.
UNITY TRAY WHITELIST - deprecated in Raring 13.04 and later Unity Desktop in favor of requiring an Application Indicator
Starting with Ubuntu's Natty Narwhal (11.04) and the introduction of the Unity Desktop a whitelist for application icons in the System tray was added. In order for Magick Rotation's icon to show you now need to add the key value 'magick-rotation' to the key systray-whitelist located at com.canonical.Unity.Panel. Otherwise the Magick Rotation icon will not appear in the System tray. The preferred way is to use gsettings from the command line. First determine the list of applications whose icons are already whitelisted with:
gsettings get com.canonical.Unity.Panel systray-whitelist
In the gsettings enable command add the magick-rotation-extension to the list of currently installed applications like so:
gsettings set com.canonical.Unity.Panel systray-whitelist "['app1', 'app2', 'app3', 'magick-rotation']"
To remove Magick Rotation from the whitelist just delete the 'magick-rotation' key value from the list and run the gsettings set command again. Then run the gsettings get command to verify it was removed.
Another option would be to use the dconf-editor, if installed, by running in a terminal:
dconf-editor
and manually adding the 'magick-rotation' key value to the list in the systray-whitelist key.
NOTE: In Precise (12.04) the key systray-whitelist appears at a new location in dconf-editor: desktop.unity.panel. However the old location is what gsettings uses.
RUNNING MAGICK ROTATION
If using a pre-1.6 version be sure to remove or rename the file 'firstrun' in the magick-rotation folder.
FROM THE FOLDER
If an earlier Magick Rotation is running shut it down by right clicking on it's green rotating arrow icon and clicking on 'Quit'. Drag and drop the magick-rotation folder onto 'yourusername' in the left column of 'Places' (/home/yourusername). If it asks if you want to replace the magick-rotation folder say "Yes to all". To install open the folder and right click on 'magick-rotation' and select 'Properties'. Then click on the 'Permissions' tab. Verify "Allow executing file as a program" is checked, if not check it, and close. Now double click on 'magick-rotation' and choose 'Run'. The applet is installed. Magick Rotation should now be working for you. If the executable flag isn't the problem it is likely an issue with the latest Gnome version of Nautilus. Open Nautilus and click on Files in the top bar and choose Preferences. In the Behavior tab under 'Executable Text Files' change the new default of 'View executable text files when they are opened' back to the old default of 'Ask each time'.
NOTE: In Ubuntu Raring 13.04 and later with the Unity Desktop you can no longer run Magick Rotation from the folder due to the peculiarities of how the App. Indicator API handles icons. You would need to disable the code that changes the icons to reflect if Magick is disabled or touch is off in gui_gtk.py's class ind_gui(). Or else keep the folder in one location (say /home/username/bin) and change the icon paths in the code to the complete new path to the folder's icons.
FROM /USR/SHARE
If you decide on the optional additional file installation below, once that is done, go to the 'magick-rotation' file in /usr/share/magick-rotation and double click on it. Choose 'Run' and the applet is installed. Magick Rotation should now be working for you.
MAGICK ROTATION EXTENSION
This was an optional step with GNOME Shell 3.2 or 3.4, but now with 3.6 and higher Magick Rotation's tray icon touch toggle feature doesn't work correctly in the Message tray. You will want to move it to the System Status Area or Status tray. To do that you need to install the magick-rotation-extension folder to "~/.local/gnome-shell/extensions/magick-rotation-extension" and enable it with gsettings. First determine your version of the gnome-shell:
gnome-shell --version
Then pick the corresponding .js and .json file for that version. The extension.js and metadata.json are for 3.2 and 3.4. For 3.6 use the ones preceeded by 3.6_ and similarly for 3.8 (and higher) use 3.8_. Hopefully the 3.8_ will work with version 3.10. Delete or remove the uneeded .js and .json files and if the ones you select are preceeded by a number and underscore remove them so you are left with just extension.js and metadata.json. Assuming you are in a terminal in the magick-rotation directory:
mv magick-rotation-extension ~/.local/gnome-shell/extensions/magick-rotation-extension
Then find the list of extensions already installed with:
gsettings get org.gnome.shell enabled-extensions
In the gsettings enable command add magick-rotation-extension to the list of currently installed extensions like so:
gsettings set org.gnome.shell enabled-extensions "['extension1', 'extension2', 'magick-rotation-extension']"
If no other extensions are installed just use: "['magick-rotation-extension']". To disable the extension repeat the gsettings set command without 'magick-rotation-extension' in it and verify it has been disabled by running the gsettings get command again.
Another option to enable the extension would be to use the dconf-editor, if installed, by running in a terminal:
dconf-editor
Then manually add the 'magick-rotation-extension' key value to the list in the enabled-extensions key.
If the extension doesn't work it is possible you may need to add your gnome-shell version to the metadata.json. Although 3.2 or 3.6 etc. seems sufficient some folks claim they need the 3rd digit, e.g. 3.6.2. A few have even claimed they required a fourth digit if it was present. It should be obvious in metadata.json how to add your version number.
FURTHER INSTALLATION - OPTIONAL
If you wish to do this you've likely already installed checkmagick into /usr/bin. You need to create a directory called 'magick-rotation' in /usr/share.
sudo mkdir /usr/share/magick-rotation
And a MagickIcons directory in that:
sudo mkdir /usr/share/magick-rotation/MagickIcons
While in the extracted magick-rotation folder copy or move the following files into the magick-rotation directory in /usr/share: ChangeLog, config.py, debug.py, gui_gtk.py, hinge.py, listener.py, magick-rotation, oem_wmi.py (if present), xrotate.py
Example:
sudo mv magick-rotation /usr/share/magick-rotation/magick-rotation
NOTE: make sure that the magick-rotation file is executable before moving it.
Copy or move the following icons into the MagickIcons directory: MagickAbout.png, magick-rotation-disabled.png, magick-rotation-disabled-touchoff.png, magick-rotation-enabled.png, magick-rotation-enabled-touchoff.png
Example:
sudo mv /MagickIcons/MagickAbout.png /usr/share/magick-rotation/MagickIcons/MagickAbout.png
FILES YOU MAY SAFELY DELETE - OPTIONAL
These files are Installer related and so not needed.
In folder magick-rotation: apt_installprogress_gtk.py, apt_pm.py, check.c, firstrun (if present), installer_gtk.py, MAGICK-INSTALL (if present), whitelist.py or gset_addkeyval.py.
In folder magick-rotation/MagickIcons: MagickSplash.png
And of course you can delete any other files left in your original magick-rotation folder if you have installed them elsewhere.
The Installer does a lot, doesn't it? :)