sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Steps for Configuring Mate Desktop on 4GB Raspberry Pi 4B - (Rev.7)

Fri Jan 03, 2020 6:03 am

With the release of the 4GB Raspberry Pi 4B, there's finally a powerful enough Raspberry Pi to become a desktop replacement that can serve basic home and school computing needs without having to purchase a much more expensive computer. I must say that I would not recommend the 1 GB or the 2GB RAM versions of the Raspberry Pi 4B to be used as a desktop replacement running the Mate desktop environment (DE), so if you decide to use these instructions to install Mate on the 1 GB or 2GB RAM versions of the Raspberry Pi 4B, you will be doing it at your own risk.

The 4GB Raspberry Pi 4B purchased as barebones, a power supply, a 32 GB SD card, and a good Raspberry Pi 4B aluminum case that includes both passive and active cooling run under $100 combined in the US, excluding sales tax. You can purchase a 4GB Raspberry Pi at Microcenter for $50.00 plus tax (without the SD card). I recommend the SanDisk Extreme PRO microSDHC Memory Card Class 10, U3, V30, A1 - 32GB (Part Number SDSQXCG-032G) available on Amazon for $13.22 plus tax. I also recommend the Argon One case for Raspberry Pi 4B, which is available on Amazon for $25 plus tax without a power supply or for $35 plus tax with an Argon power supply.

I purchased my first Raspberry Pi (4GB Raspberry Pi 4B) about two weeks ago, and I really liked the hardware. However, I didn't care much at all for the look and feel of the standard Raspbian UI, which, IMHO is too unpolished and childish looking. Even though the current (at the time of this writing) standard Raspbian image (Buster) works well with the Raspberry Pi 4B, it just doesn't feel like something I would want to use daily. Even my wife, who is not very technical, when tried the standard Raspbian UI (based on the LXDE desktop environment), immediately commented that the experience was inferior to any OS she has used in the past.

So, I decided to put in a few days worth of research over the holidays and convert the Raspbian UI (aka Desktop Environment - DE) into something that is more polished. Additionally, the standard Raspbian installation lacks (at the time of this writing) a GUI-based printer configuration utility. It appears that a lot of Raspberry Pi veterans do not think that printing is important from a Raspberry Pi. It may have been the case in the past when the Raspberry Pi hardware wasn't powerful enough to replace a desktop computer, but with the 4GB Raspberry PI 4, it's now important to be able to print from the Raspberry Pi, and the GUI pinter configuration goes a long way to make the installation of a printer in the OS streamlined.
Note: Upon my appeal to Raspbian developers, the GUI-based printer configuration utility became part of the standard Raspbian distribution as of January 2020.

If anyone with the Raspbian Foundation is reading this post, I would recommend that you guys look into releasing an official Rasbpian OS distribution with the Mate DE, perhaps only for the 4GB Rasbperry Pi 4B and for more powerful hardware that you will be releasing in the future. I can vouch for the fact that Mate runs really well and smoothly on the 4GB Raspbian Pi 4B.
******************************************************************************
Now on to the instructions.
Note: If you follow these instructions closely, it should take you two hours or so to complete all the steps.
1. Insert the SD card with the standard image of the Raspbian Buster with desktop and recommended software installation and perform the following steps:
a. Run the application and OS updates as follows (don't forget to press Enter after each line):

Code: Select all

sudo apt update
sudo apt full-upgrade
b. Connect an SD reader to a USB3 port on the 4GB Raspberry Pi 4's (blue USB port) and back up your current Raspbian OS running the standard desktop Environment (DE) onto another SD card inserted into the external SD reader. Use the Raspbian application SD Card Copier, which comes preinstalled with the Raspbian Buster with desktop and recommended software image. I recommend using at least a 32 GB SD card in the external SD card reader to copy the Raspbian Buster with desktop and recommended software image to.

c. Shut down the 4GB Raspberry Pi 4B, remove the original SD card, and insert the one to which you have just backed up your Raspbian OS installation.

d. Power up your 4GB Raspbian Pi 4B, open Terminal in Raspbian and perform the following steps:
- Open Terminal, type in the following command, and press Enter on the keyboard:

Code: Select all

sudo raspi-config
- In the Raspberry Pi Software Configuration Tool window that opens, use the Arrow Down key on the keyboard to highlight Advanced Options and press Enter on the keyboard
- Use the Arrow Down key on the keyboard to highlight Memory Split and press Enter on the keyboard
- Use the keyboard to change the default amount of memory given to GPU to 256
- Use the Tab key on the keyboard to highlight the OK button and press Enter on the keyboard.
- Use the Tab key on the keyboard to highlight the Finish button and press Enter on the keyboard.
- When asked, "Would you like to reboot now," highlight Yes and press Enter on the keyboard.
- Raspberry Pi will reboot with the new settings of 256 GB reserved for the GPU (Graphics Processing Unit, aka "video card").

2. (Note: This step may no longer be necessary, as Raspbian Buster now pushes the installation of this package when the OS upgrade is run - as of January, 2020).
Whether or not you will end up keeping Mate on your 4GB Raspberry Pi4, you will benefit from a GUI network configuration utility that works both in the standard Raspberry Pi UI (LXDE) as well as in the Mate desktop environment (aka Mate Desktop). To install this utility called system-config-printer, using the following command:

Code: Select all

sudo apt install cups cups-ipp-utils system-config-printer printer-driver-cups-pdf
Note: Along with system-config-printer, this command also installs CUPS (Common Unix Printing System), IPP utilities for CUPS, and a driver that prints to PDF.
Thanks for this tip go to the forum member scruss.


3. Make sure that you have configured Wi-Fi in the Raspbian UI, your Raspberry Pi 4B is connected to a 2.4 GHz Wi-Fi network, and it can access the Internet.
Note: This step is not necessary if your Raspberry Pi is connected to the network via wired Ethernet. The reason that you should connect to a 2.4 GHz network and not to a 5 GHz network in this step is the fact that after switching the DE to Mate, the connection to the 5 GHz Wi- Fi network will not be able to authenticate properly until additional software is loaded (see below).

4. Open Terminal in Raspbian and type the following command to download Mate DE:

Code: Select all

sudo apt-get install mate-core mate-desktop-environment
5. While still in Terminal, type the following command:

Code: Select all

sudo update-alternatives --config x-session-manager
Note: This command will display a list of available Desktop Environments (DEs), including the newly downloaded Mate. Type in the number that corresponds to Mate and press Enter.

6. In Terminal, type in the following command:

Code: Select all

reboot
7. Your Raspberry Pi 4B will reboot and load into Mate.

8. Mate doesn't come with a preinstalled GUI Network utility, so we need to install it. If you have configured Wi-Fi in the standard Raspbian DE (LXDE) to connect to a 2.4 GHz SSID before switching the DE to Mate, your Wi-Fi should automatically connect to the same 2.4 GHz SSID in Mate (using dhcpcd), and you should be able to access the Internet. Make sure you can get to the internet by starting the Chromium browser (navigate to Applications > Internet > Chromium Web Browser) and try to access a web site. You will need the Internet connection in order to download some additional Linux packages. If you can't access the Internet via Wi-Fi in Mate, connect the Raspberry Pi 4B to the network with an Ethernet cable.

9. Open Terminal in Mate (click on the Applications menu in the upper left corner, and select System Tools > Mate Terminal). We will use this Terminal application several times in the steps below. Paste the following commands in the Terminal window and press Enter after each command:

Code: Select all

sudo apt install network-manager-gnome 
sudo systemctl disable dhcpcd
sudo /etc/init.d/dhcpcd stop
reboot
Note: The first command downloads the Network GUI utility and installs it in the System Tray (located in the upper right corner of the Mate desktop). The second command disables the dhcpcd daemon. The third command stops the dhcpcd service. The reason we need to disable the dhcpcd daemon is the fact that this daemon is used by the Network utility installed in the standard Raspbian DE (LXDE), and this daemon prevents other network configuration utilities from running.


10. Once dhcpcd is disabled and the Raspberry Pi is rebooted, you will notice a new icon in the System Tray area of the Mate desktop (upper right corner).
a. Click on this icon, and you should see Wi-Fi networks discovered by your Raspberry Pi. If you select the 2.4 GHz Wi-Fi network, you will be asked for the password, and once you supply the password, the Raspberry Pi will connect to the 2.4 GHz network.

b. If you also have a 5 GHz Wi-Fi network with an SSID that differs from the 2.4 GHz Wi-Fi network SSID, try to connect to your 5 GHz Wi-Fi network. In my case, the Network Manager GUI utility would try to connect to the 5 GHz Wi-Fi network for some time but then would pop up the window with the Wi-Fi password again, thus failing to authenticate to the 5 GHz SSID. Even though the 5 GHz network could be discovered by the Network Manager GUI utility by scanning the radio spectrum, the Network Manager GUI utility couldn't properly authenticate to my Wi-Fi Access Point (Ubiquiti UAP-AC-HD). If you are having the same problem of not being able to connect to the 5 GHz Wi-Fi network, then open Terminal in Mate and type in the following command:

Code: Select all

sudo iw reg get 
In the output of this command, look for the string that starts with country, like in the output below:

Code: Select all

global
country 00: DFS-UNSET
	(2402 - 2472 @ 40), (N/A, 20), (N/A)
	(2457 - 2482 @ 20), (N/A, 20), (N/A), AUTO-BW, NO-IR
	(2474 - 2494 @ 20), (N/A, 20), (N/A), NO-OFDM, NO-IR
	(5170 - 5250 @ 80), (N/A, 20), (N/A), AUTO-BW, NO-IR
	(5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, AUTO-BW, NO-IR
	(5490 - 5730 @ 160), (N/A, 20), (0 ms), DFS, NO-IR
	(5735 - 5835 @ 80), (N/A, 20), (N/A), NO-IR
	(57240 - 63720 @ 2160), (N/A, 0), (N/A)
If the output of this command shows country 00: DFS-UNSET, you need to assign the Wi-Fi region (aka Wi-Fi country) before you can connect to the 5GHz network. This can be done in the raspi-config utility by navigating to Localisation Options > Change Wi-Fi Country. Alternatively, you can open Terminal and use the following command:

Code: Select all

sudo iw reg set US
Note: If you live in a country other than the US, try to use your country acronym instead of US in this step.

Now issue the following command again to verify that the country was changed from automatic (00) to US.

Code: Select all

sudo iw reg get 
and make sure that the output of the command has the following output, specifically focusing on the country code US listed in the string that starts with country:

Code: Select all

country US: DFS-FCC
	(2402 - 2472 @ 40), (N/A, 30), (N/A)
	(5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
	(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
	(5490 - 5730 @ 160), (N/A, 23), (0 ms), DFS
	(5735 - 5835 @ 80), (N/A, 30), (N/A)
	(57240 - 63720 @ 2160), (N/A, 40), (N/A)
Now try to connect to the 5 GHz SSID, using the Network Manager GUI utility. This time, you should be able to connect within a few seconds without any problems.

11. If in the previous step you were having problems connecting to the 5 GHz SSID, and you changed the region, you now need to make this change persistent across Raspberry Pi reboots.
Note: Unfortunately, even the raspi-config utility doesn't make the Wi-Fi Country setting persistent across the reboots.

Use your favorite text editor either in Terminal (nano, emacs, vim) or in GUI (Applications > Accessories > Pluma Text Editor) and edit the following file:

Code: Select all

/etc/default/crda
In this file, add the region code to the following string:

Code: Select all

REGDOMAIN=
So, the string should look like this:

Code: Select all

REGDOMAIN=US
Save the file after you have edited it and reboot your Raspberry Pi 4B. You can reboot it from Terminal by typing the following command:

Code: Select all

reboot
Alternatively, you can navigate to System > Shutdown, and select Restart

12. Once Raspberry Pi reboots, it will connect either to the 2.4 GHz network or to the 5 GHz network. To make one or the other to be a preferred connection by the Gnome Network Manager utility, right-click on the utility's icon in System Tray, select Edit Connections, then highlight the connection that you want to be preferred over other(s), click on the *gear* button at the bottom of the Network Connections window, select the General tab, make sure that the Connect Automatically with Priority check box is enabled, and set the priority of this connection. The default priority is 0 for all connections. A connection assigned a higher priority (higher number) will be preferred over a connection with a lower priority (lower number) when both connections are available.

To verify that the Regulatory Domain set to US in Step 11 did take effect, open Terminal in Mate and use the following command:

Code: Select all

sudo iw reg get
You should see that the following output:

Code: Select all

country US: DFS-FCC
	(2402 - 2472 @ 40), (N/A, 30), (N/A)
	(5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
	(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
	(5490 - 5730 @ 160), (N/A, 23), (0 ms), DFS
	(5735 - 5835 @ 80), (N/A, 30), (N/A)
	(57240 - 63720 @ 2160), (N/A, 40), (N/A)
If you reboot the Raspberry Pi 4B now, the Network Manager utility in Mate should automatically connect to the network for which you configured a higher priority.

13. The newly installed Network Manager utility can also be used to create and configure VPN connections. However, you will need to install VPN plugins for the Network Manager utility if you are planning to use VPN.
Note: This step (Step 10b) is not mandatory if you are not planning to use VPN.

If you think you will use VPN now or in the future, then you may consider installing VPN plugins now. Open Terminal in Mate and enter the following commands one by one. Don't forget to press Enter after each command:

Code: Select all

sudo apt install network-manager-vpnc
sudo apt install network-manager-fortisslvpn
sudo apt install network-manager-l2tp-gnome
sudo apt install network-manager-openconnect-gnome
sudo apt install network-manager-openvpn-gnome
sudo apt install network-manager-pptp-gnome
sudo apt install network-manager-ssh-gnome
sudo apt install network-manager-strongswan
Now you can click on the Network Manager icon in the System Tray (upper left corner of the Mate Desktop) and select VPN Connections > Add VPN Connection. A new window will open, where you will be able to select the type of the VPN connection that you want to create.

14. Raspbian Buster with the standard Raspbian PIXEL desktop environment (based on LXDE) comes without PulseAudio installed. The Raspbian Foundation decided not to use PulseAudio anymore but use ALSA directly. Therefore, they had to write their own System Tray plugin for lxpanel to switch from the on-board audio adapter to Bluetooth audio and back.This lxpanel System Tray plugin doesn't work under Mate DE because Mate has its own System Tray, so the lxpanel's System Tray conflicts with Mate's system tray. Without utilizing the Raspbian Foundation's lxpanel System Tray plugin for switching from on-board analog audio adapter to Bluetooth audio devices and back, either analog audio or Bluetooth audio are disabled in Mate. Therefore, we must rely on PulseAudio and audio output device switchers that work with PulseAudio to be able to play sound to either a pair of speakers connected to the analog audio jack on Raspberry Pi or to a connected Bluetooth audio device.

a. Install the pulseaudio package:

Code: Select all

sudo apt install pulseaudio
b. Use your favorite text editor to open the following file:

Code: Select all

/usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf
and comment out (insert the semicolon in front of) the following lines:

Code: Select all

;[Mapping analog-mono]
;device-strings = hw:%f
;channel-map = mono
;paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono
;paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headset-mic
;priority = 7
c. Save the file in your text editor.

d. Reboot the Raspberry Pi.

15. When Raspberry Pi 4B reboots, go to Youtube and play a stereo audio test. You should notice that now when the video says that the audio is coming out of the left speaker, there is no sound coming out of the right speaker, and vice versa. This means that the sound output by the Raspberry Pi 4B is now in stereo.

16. You may have noticed that there is no Bluetooth icon in the Mate's System Tray. We need to download the package that installs the Bluetooth drivers and the Bluetooth GUI utility in System Tray. Open Terminal in Mate and issue the following commands (don't forget to press Enter after each command):

Code: Select all

sudo apt install blueman
reboot
17. Once Raspberry Pi 4B reboots, you will notice a new Bluetooth icon in Mate's System Tray. You can click on this icon to see the options available in the Blueman GUI utility, and if you right-click on this icon, you can turn Bluetooth off and on.

If the Bluetooth icon doesn't show in Mate's System Tray, verify that the pi-bluetooth package is installed:

Code: Select all

sudo apt list pi-bluetooth
If the pi-bluetooth package is not installed, then use the following command to install it:

Code: Select all

sudo apt install pi-bluetooth
18. You can download an optional utility called Mate Tweak by using the following command in Terminal:

Code: Select all

sudo apt install mate-tweak
Note: This utility, which installs in System > Control Center, has some extra features that can be added to the Mate desktop. One of the useful features that this utility provides is the ability to enable HiDPI as the window scaling factor. This would make a tremendous improvement on a 4K monitor if you want to "double-pixel" the 4K resolution to make the screen elements be the size as they would be on a 2K display. This will give you larger screen elements drawn at a double resolution compared to running the same size monitor at the 2K resolution, so your fonts and icons will be much sharper.

19. Now it's time to overclock Raspberry Pi to improve its performance. However, before you perform this step, I suggest that you purchase a metal case for your Raspberry Pi 4B that provides both passive cooling (via heat dissipation using the case itself) as well as active cooling (via an internal fan). I recommend the Argon One case (see the beginning of this post). This case requires minimum assembly (the only tool you would need is a small, actually very small, Phillips-head screwdriver). This case also comes with a power button and it can take the standard Raspberry Pi power supply; alternatively, you can buy this case with an Argon power supply, or you can even buy this case as part of the 4GB Raspberry Pi 4B kit. Once you install your Raspberry Pi 4B into the Argon One case, you will need to run one line of script in the Mate Terminal, following the instructions that come with the Argon One case. This script will download and install the software that will allow you to properly shut down your Raspberry PI 4B from the desktop (be it Raspbian DE or Mate DE) so that the Raspberry Pi 4B shuts down completely and turns power off. Additionally, this script allows you to properly shut down the Raspberry PI 4B, using the physical power button on the Argon One case itself.

20. Now that you have purchased a metal case with passive and active cooling and installed your Raspberry Pi 4B into the case, it's time to overclock your Raspberry Pi, using the following steps:
a. Edit the following file, using your favorite text editor:

Code: Select all

/boot/config.txt
b. Find the section of the file that starts with [pi4] and paste the following commands:

Code: Select all

over_voltage=6
arm_freq=2000
gpu_freq=750
c. Save the file.
d. Reboot Raspberry Pi either from Terminal:

Code: Select all

reboot
or navigate to System -> Shutdown and select Restart
Note: Do not use a value higher than 6 for the over-voltage parameter because doing so will void your warranty. You can increase the arm_freq parameter to the maximum value of 2147 (2.147 GHz), but I decided to limit my overclocking to 2000 (2.0 GHz) to prevent Raspberry PI 4 from generating too much heat.

21. Once Raspberry Pi reboots, right click on the menu panel running across the top of the Mate desktop, select Add to Panel and scroll down to CPU Frequency Scaling Monitor, select it, and click Add. This plugin will show the current CPU frequency.

22. Open the Chromium web browser in Mate by navigating to Applications > Internet > Chromium Web Browser and browse to some content-rich web site like CNN. Look at the CPU Frequency Scaling Monitor plugin that you added to the menu bar. You will see that the CPU frequency goes up to 2 GHz before it scales down to 600 MHz. This proves that you have overclocked the Raspberry Pi 4B CPU from the standard 1.5 GHz to 2 GHz.

23. Congratulations! You now have a beautiful desktop running on your 4GB Raspberry Pi 4B.

24. You may notice that there are some applications in the Applications menu of the Mate desktop that perform similar functions. For example, there are two File Mangers (Caja and File Manager PCManFM), there are two terminal applications (Mate Terminal and LXTerminal), there are two text editors (Pluma Text Editor and Mousepad), etc. The reason there are two versions of these applications visible in Mate is the fact that one version came from the standard Raspbian DE (LXDE) while the other version was installed with Mate. Once you compare the functionalities between the two variants of each application, you can remove the one that you like less. You can use the Add / Remove Software applet that can be found in Mate by navigating to System > Administration. For example, if you want to remove the Mouspad text editor, in the Add / Remove Software applet, search for mousepad, clear the checkbox next to it, and click Apply. The Mousepad text editor will be uninstalled and removed from the Applications > Accessories menu of the Mate desktop.

***********************************************************************************************

Once you have used your Raspberry Pi 4B with the Mate desktop environment, and if you have decided that you prefer it to the standard Raspbian desktop environment (based on LXDE), you can uninstall the standard desktop environment by pasting the following command in Terminal:

Code: Select all

sudo apt remove lxde* --purge
Certain GUI desktop features configured in the Raspbian Desktop Environment (LXDE) are controlled by additional utilities that do not do anything in the Mate Desktop Environment (where other utilities perform similar functions). If you are getting rid of the standard Raspbian Desktop Environment (based on LXDE), you may as well remove these additional utilities used with LXDE in Raspbian. Paste the following commands in Terminal.

1. Remove the utility Appearance Settings. This utility manages screen elements in Raspbian's LXDE desktop environment and is listed in the Mate's Control Center, but it does nothing in the Mate desktop environment.

Code: Select all

sudo apt remove pipanel --purge
Note: In Mate, the applet Appearance performs functions similar to this applet.

2. Remove the LXDE panel. Mate desktop environment comes with its own panel, so there is no reason to keep the LXDE panel:

Code: Select all

sudo apt remove lxpanel --purge


3. Remove the OpenBox Display Manager. OpenBox is another (very basic) desktop environment that comes installed with the standard Raspbian distribution.

Code: Select all

sudo apt remove openbox* --purge
4. Remove the utility Open Box Configuration Manager. This utility manages screen elements in the OpenBox desktop environment and is listed in the Mate's Control Center, but it does nothing in the Mate desktop environment.

Code: Select all

sudo apt remove obconf --purge
5. Remove the packages that no longer have dependencies after the aforementioned package were removed:

Code: Select all

sudo apt autoremove
Last edited by sirozha on Thu Feb 06, 2020 6:33 pm, edited 63 times in total.

cjan
Posts: 769
Joined: Sun May 06, 2012 12:00 am

Re: Steps for Configuring Mate on 4GB Raspberry Pi 4B

Sat Jan 04, 2020 7:54 am

you should start from scratch, raspbian lite.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Why I started with the complete Raspbian Buster Installation Package

Sun Jan 05, 2020 5:31 pm

There are a lot of packages that come with the Raspbian installation that make the GPIO and other magic work. That’s why I started with the complete Raspbian installation.

I would love to build the system starting with the Raspbian Lite, so please post instructions for building the complete system running Mate and having all programming and other software packages that make it possible to do all sorts of projects, including GPIO, connecting remotely to the Raspberry Pi 4, doing remote GPIO, etc.
Last edited by sirozha on Wed Jan 15, 2020 6:11 pm, edited 1 time in total.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Installing and using a French keyboard layout in Raspbian running Mate Desktop

Mon Jan 06, 2020 6:51 pm

I've created instructions on how to use a standard US keyboard to type French diacritics, French ligatures, and other symbols, using a French keyboard layout under the Mate desktop. The French keyboard layout that is most compatible with the location of characters on the standard English (US) keyboard is French (Canada) Canadian Multilingual. The instructions can be found here.
Last edited by sirozha on Thu Jan 09, 2020 10:23 pm, edited 1 time in total.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Installing and configuring a macOS-type dock in Mate desktop

Tue Jan 07, 2020 3:21 pm

You can configure a macOS-like dock in Mate by installing the following package:

Code: Select all

sudo apt install mate-dock-applet
Once installed, create a new Mate panel (by right-clicking on an existing Mate panel and choosing New Panel). Now right click on the new Mate panel, select Add to panel and add the Dock applet. In the Mate panel's Properties (right-click on the Mate panel), you can specify the position of the panel on the desktop (top, bottom, left, or right) as well as the size of the panel (you will need to increase the size to make it look like a macOS dock). When you right-click on the dock, you can select Dock Preferences then click on the Panel Options tab and place the check marks next to the Change panel colour to match wallpaper as well as the Change colour of dock's panel only to match the color or the dock to the desktop's background but prevent other panels from changing their color. Finally, select the Appearance[ tab, for Theme select Custom and for Indicator Type select Circle. These settings will make the dock in Mate look like the dock in macOS.

When you open an application, it will appear in the dock. If you hover your mouse over the application's icon in the dock, a pop-up window will appear in which you can pin the application to the dock so that the application icon doesn't disappear from the dock when you close the application. You can now launch the application from the dock.
Last edited by sirozha on Thu Jan 09, 2020 10:24 pm, edited 1 time in total.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Configuring Samba and File Sharing in Raspbian Buster running Mate Desktop

Wed Jan 08, 2020 9:57 pm

This is how you can enable file sharing in Raspberry Pi 4B running the Mate desktop environment.

1. Open Terminal and paste this command followed by the Enter key:

Code: Select all

sudo apt install samba samba-common-bin smbclient cifs-utils
2. Download the plugin for the Caja file manager that integrates into the right-click contextual menu and allows you to share files directly from Caja. Paste the following commands (each followed by the Enter key) into Terminal:

Code: Select all

sudo apt install caja-share
reboot
3. When the Raspberry Pi 4B reboots, open Terminal and paste the following command followed by the Enter key:

Code: Select all

sudo mkdir -p /var/lib/samba/usershares/
Note: This command creates a new directory useshares where the information about the network shares will be stored.

4. Paste the following command (followed by the Enter key) in Terminal:

Code: Select all

sudo chmod 1775 /var/lib/samba/usershares
Note: This command changes permissions on the directory usershares. The permissions cannot be 777 or 1777 because you won't be able to authenticate with Samba when you try to connect to the shares. Samba requires that the sticky bit is set and that everyone doesn't have the write permissions. If you don't understand any of that, just paste the command, press Enter, and move on.

5. Paste the following command (followed by the Enter key) in Terminal:

Code: Select all

sudo chown root:users /var/lib/samba/usershares
Note: This command changes the group ownership of the directory usershares from root to users. The reason we need to do this is that the caja-share plugin writes files as the user who is logged in. The user who is logged in (by default) is pi, and this user belongs to multiple groups, including the group users. We can't change the user ownership of this directory because Samba requires that its owner be the user root. So, we must change the group ownership of this directory in order for the caja-share utiltiy to be able to create files inside of this directory.

6. Now we need to adjust some Samba settings. By default, when you connect to this share and authenticate , the home folder shows up and you can actually browse through it. There are different use cases for enabling home sharing in Raspberry Pi, so there are many opinions of what a user should see when he/she connects to Raspberry Pi via Samba. However, for my use case, I don't want the home folder to be visible; I only want the folders that are explicitly shared to be visible. This step achieves just that.
a. Open the following file with your favorite text editor. The text editor should be launched with the sudo command:

Code: Select all

/etc/samba/smb.conf
Note: It's not a bad idea to make a backup of this file before you edit it.
b. Comment out the following lines in the smb.conf file by placing semicolons in front of each line, as follows:

Code: Select all

;[homes]
;   comment = Home Directories
;   browseable = 
Note: Commenting out these strings prevents the home directory (in this case it's the pi folder) from appearing among the folders explicitly shared from the Raspberry Pi. If you want the home directory to appear among the folders explicitly shared from the Raspberry Pi, then disregard the steps (b) and (c).
c. Change the following string in the file smb.conf

Code: Select all

valid users = $S
to this this string:

Code: Select all

invalid users = $S
Note: This command works in tandem with the previous step.
d. Change the following strings in the file smb.conf (located immediately below the [homes] section):

Code: Select all

create mask = 0700
directory mask = 0700
to

Code: Select all

create mask = 0770
directory mask = 0770
Note: These settings determine the Linux/Unix permissions with which files and folders will be created in the Raspberry PI's shares by other computers.
e. Change the following string:

Code: Select all

unix password sync=yes
to

Code: Select all

unix password sync=no
Note: This setting prevents a change of the Samba password from changing the Raspberry Pi's password.

f. Add the following lines under the [global] section of the file smb.conf to improve compatibility with computers running MacOS.
Note: These strings can be added below the string in the previous step.

Code: Select all

vfs objects = catia fruit streams_xattr
fruit:encoding = native
fruit:model = Macmini
Note 1: The string fruit.mode = defines the icon that appears in macOS Finder for the Raspberry Pi. The name that follows the = sign is case-sensitive. Some other options are: Xserve, MacPro, iMac, MacBook. If you want to experiment with other icons, you must save the smb.conf file, restart the smbd service (See Step 8), and relaunch Finder in macOS (Command+Option+Esc, locate Finder, and click Relaunch).
Note 2: If from a macOS computer the browsing of the Raspberry Pi's shares containing a lot of files is too slow, then add the following string below the ones listed in this step: fruit:metadata = stream. Don't forget to save the smb.conf file and restart the smbd service if you add this string.
g. Save the file smb.conf.

7. Create a Samba user that will be authenticated by Samba when the user tries to connect to the Raspberry Pi 4B over the network. Open Terminal and paste this command followed by the Enter key:

Code: Select all

sudo smbpasswd -a pi
You will be prompted for the password for the Samba user pi
Note: I am suggesting here to create the Samba username and the password that match your login username an password in Raspberry Pi. This will make it easier to log in remotely to the shares defined in Raspberry Pi 4B.

8. Restart the smbd service. Open Terminal and paste this command followed by the Enter key:

Code: Select all

sudo service smbd restart
********************************************************************************************
Now you are ready to share a folder in Caja (Mate's default file manager).

a. Open Caja.

b. Right-click on a folder

c. Select Sharing Option

d. Select the check box Share this folder

e. Select the check box Allow others to create and delete files in this folder

f. Click the Create Share button
Note: You should see a hand on top of the folder's icon.

g. Now go to your Windows or Mac computer, open Windows Explorer or Finder, click Network (or similar), find the hostname of your Raspberry Pi in the list of network servers, click on the hostname of the Raspberry Pi, select the share and (on the Mac) click the Connect as button in the upper right corner of the Finder window. When presented with a Window requesting credentials, type the Samba name and password created in Step 7.

h. You should see the folder that you've shared from Caja. You can create a file in this folder from a Windows or Mac computer. You can also create a subfolder in this folder, you can delete a file, and you can delete the folder inside of the shared folder.
Note: You cannot delete the shared folder itself from a Windows or Mac computer connecting to the Raspberry Pi via the Samba protocol. If you want to delete the folder that you shared from Caja on Raspberry Pi, you should do it on the Raspberry Pi itself. First, open Caja, right-click on the shared folder, select Sharing Option, and deselect the Share this folder check box; then delete the folder itself.

****************************************************************************************************
I don't claim that this is the best way to enable Samba file sharing in Raspbian running the Mate desktop, and neither do I claim that this method provides enough security. These instructions are provided in order to enable simple file sharing from Raspberry Pi in Raspbian running the Mate desktop for a very simple environment, such as a home network. In my use case, the Raspberry Pi 4B will be used by my 9-year-old son for his schoolwork, and the file sharing will be used in order to be able to move files to and from the Raspberry Pi by my wife and me, as well as to be able to read the files that my son creates on the Raspberry Pi, such as homework assignments, etc. Because I consider my home network well secured, there were no security considerations given to the way Samba sharing is configured based on these instructions. In my use case, simplicity trumps security.
Last edited by sirozha on Fri Jan 10, 2020 4:47 pm, edited 3 times in total.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Installing a CPU temperature indicator in a panel in Mate Desktop

Thu Jan 09, 2020 9:40 pm

These instructions are on installing a CPU temperature indicator in a panel in the Mate desktop environment:

1. Open a text editor of your choice (Pluma works fine) and paste the following script)
#!/bin/bash
Temp=$(cat /sys/class/thermal/thermal_zone0/temp)
echo $(( $Temp / 1000))"°"
2. Save the file with the name cputemp.sh in your home folder (your home folder is probably pi)

3. Change the permission on this file to executable as follows:
a. Open the Caja file manager.
b. Right-click on the file cputemp.sh
c. Click the tab Permissions
d. Select the check box that says Allow executing file as program
Note: Alternatively, you can open Terminal and type the following command sudo chmod +x ~/cputemp.sh

4. Right-click a panel in Mate and from the contextual menu select Add to Panel

5. From the list of available items, choose Command

6. You will see that a clock will be added to the panel in Mate. Right click on the clock and select Preferences

7. Populate the following strings:
Command: /home/pi/cputemp.sh
Interval (seconds): 5
Note: This 5-second interval is my personal choice, as it works fine without overtaxing the Raspberry Pi).
Maximum width (chars): leave this at the default value

You now have a CPU temperature indicator, which updates its readings every 5 seconds.
Last edited by sirozha on Thu Jan 09, 2020 10:25 pm, edited 1 time in total.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Integrating Raspberry Pi 4B running Mate with iCloud Email, Calendar, and Contacts

Thu Jan 09, 2020 10:03 pm

It's easy to integrate the Raspberry Pi 4B with the iCloud Email, Calendar, and Contacts.

1. Install Evolution (the email, calendar, and contacts) client as follows:

Code: Select all

sudo apt install evolution
Note: In the Mate desktop environment, Evolution shows up in Applications > Office

2. Integrate Evolution with iCloud Email

3. Integrate Evolution with iCloud Calendar

4. Integrate Evolution with iCloud Contacts

5. Evolution will ask you to unlock the gnome keyring every time you open Evolution because that's where it stores its passwords. You can disable Auto Login, which means that every time you turn on your Raspberry Pi, you will be presented with a login window, where you will have to enter your Linux password. Navigate to System > Control Center , select the Raspberry Pi Configuration applet and on the System tab uncheck Auto Login. Next time you reboot your Raspberry Pi, you will be presented with a login window requesting your Linux password. Once you enter the password, you will be logged in to the Mate desktop, and the keyring will be automatically unlocked, so Evolution will be able to use the password it stores in keyring without prompting you for the keyring password.

Evolution is very light on the CPU resources. Calendar in Evolution syncs with iCloud both ways, which means that you can create a calendar entry in Evolution, and your iCloud calendar will be updated with that event, as well as vice versa, any event created in iCloud will sync to the calendar in Evolution.

The Claws email client, which ships with Raspbian Buster, lacks the calendar. There's a calendar plugin for Claws (claws-mail-vcalendar-plugin), but it cannot create events in the iCloud calendar. Therefore, we can safely uninstall the Claws email client as follows:

Code: Select all

sudo apt remove claws-mail --purge
Last edited by sirozha on Tue Jan 14, 2020 2:01 am, edited 4 times in total.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Showing POSIX paths in Caja

Thu Jan 09, 2020 10:41 pm

In order to show and copy the POSIX path of a file or folder in Caja file manager, highlight the file or folder and press Ctrl+l (l for location). Not only can you see the POSIX path with this keyboard shortcut, but you can also copy it from there.
Note: There's also an button next to the paths panel that changes the path panel to the POSIX format; however, by default, POSIX paths are not displayed.
Last edited by sirozha on Fri Jan 10, 2020 1:25 pm, edited 1 time in total.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Using familiar macOS-based keyboard shortcuts in Mate Desktop

Fri Jan 10, 2020 12:19 am

If you have been using Macs exclusively for a while now, it's hard to go back and forth between using the Windows/Unix/Linux Ctrl+c, Ctrl+v, etc. key combinations and the macOS Command+c, Command+v, etc.

If you are using a non-Mac keyboard with the Raspberry Pi, the Ctrl key is located at the left edge of the bottom row of keys, whereas the Alt key is located to the left of the space bar. In macOS, the key located to the left of the space bar is the Command key. Therefore, those of us who have been using Macs for a long time have muscle memory to hit the key to the left of the space bar with the left thumb and hit the second key in each key combination with the left index finger. That's quite a change from hitting the Ctrl key with the left pinkie in the Windows/Unix/Linux world.

These instructions are on swapping out the Left Ctrl with the Left Alt key. This would allow Mac users to continue to utilize their muscle memory for common shortcuts.

1. In Mate desktop, navigate to System -> Control Center and double-click the Keyboard applet.

2. In the Keyboard Preferences window, click the Layouts tab and then click the Options button.

3. In the Keyboard Layout Options window, expand the Ctrl position menu item.

4. Select the Swap Left Alt with Left Ctrl check box.

5. Click Close to close the window.

We also need to change how the application window switcher shortcut works in Mate. Before we swapped out the Left Alt with the Left Ctrl, the application window switcher shortcut involved pressing the key left of the space bar and the Tab key. Switching applications use the same muscle memory in Windows/Unix/Linux and in macOS because in macOS the shortcut for switching application windows is Command+Tab, and the Command button is located left of the space bar on the Mac keyboard, whereas on a non-Mac keyboard, the Alt key is located there.

5. In Mate desktop, navigate to System -> Control Center and double-click the Keyboard Shortcuts applet.

6. Scroll down to the Window Management section and expand it.

7. Click the Move between windows, using a popup window string.

8. Double-click the current shortcut listed next to this string (Alt+Tab), press and hold the key left of the space bar (formerly Alt and now Ctrl) followed by the Tab key. The shortcut Ctrl+Tab will appear there.

9. Click Close to close the window.

Now you can use the familiar (to both Mac and non-Mac users) muscle memory to use the application window switcher.
Last edited by sirozha on Wed Jan 15, 2020 6:09 pm, edited 1 time in total.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Changing Display Manager's Greeter / Changing Display Managers

Fri Jan 10, 2020 6:32 pm

If you followed my instructions on installing Evolution above, you remember that Evolution stores its passwords in the gnome keyring, which either requires the user to unlock the keyring when Evolution launches or, as the alternative solution, the Auto Login can disabled, so that when the Raspberry Pi first boots up, a login screen is presented where the user must supply the Linux password in order to log in to Mate. Once the user logs in, the keyring is automatically unlocked, so Evolution (and any other applications that use the keyring for password storage) can access the keyring without prompting the user to unlock it.

The default login window that comes up when the user turns on the Raspberry Pi is the highly customized login window with the Raspberry Pi logo in it. There is nothing wrong with the logo, but the window interface itself is very crude and unappealing (IMHO). So, whereas we have changed the default Raspbian Desktop Environment to Mate (which us much more refined than the standard LXDE-based Desktop environment), the login window is still the old-style unrefined one.

The login window in Linux is controlled by a display manger. Raspbian Buster comes with the LightDM display manager. LightDM uses different styles of login-window themes called greeters. In order to change the look of the standard Raspbian Buster login window, we need to do one of the the things:
a. We can continue using the LightDM display manager but use a different greeter; or, alternatively
b. We can switch to a different display manager, which will come with a different style of the login window.

Replace Greeter in LightDM

1. Edit the following file with your favorite text editor:

Code: Select all

etc/lightdm/lightdm.conf
2. Change the value of the following string:

Code: Select all

greeter-session=pi-greeter
to

Code: Select all

greeter-session=lightdm-gtk-greeter
Note: This command changes the greeter used by LightDM
3. Save the file.

4. Open terminal and paste the following command to make sure that the lightdm-gtk-greeter package is installed.

Code: Select all

sudo apt list lightdm-gtk-greeter
Note: If you see at the end of the output the string installed or installed, automatic, then proceed to Step 5; Otherwise, install this package, pasting the following command in Terminal:

Code: Select all

sudo apt install lightdm-gtk-greeter
5. Paste the following command in Terminal:

Code: Select all

sudo apt install lightdm-gtk-greeter-settings
Note: This command installs the lightdm-gtk-greeter-settings package, which is a GUI interface to change the appearance of the lightdm-gtk-greeter login screen.


6. Reboot the Raspberry Pi.

7. When the Raspberry Pi reboots, you will see a different login window. Supply your Linux password and login in to Mate.

8. In Mate, navigate to System > Administration and select the LightDM GTK+ Greeter Settings menu item.

9. You will be prompted for your Linux password. Supply your Linux password and click Authenticate.

10. You can now adjust the settings of the GTK Greeter's login window.

11. GTK Greeter has a panel at the top of the screen (similar to the Mate's panel). You can add additional items to this panel or remove some items from this panel by clicking the Panel tab in the LightDM GTk+ Greeter:settings window.

12. You can change the position of the login window on the screen if you click on the Window tab.

13. There are some additional setting you can check out on the Misc. tab.

14. Now that you have modified the look of the login window, reboot your Raspberry Pi and see if the login window is to your liking.

15. If you want to revert to the default login window that ships with Raspbian, repeat Steps 1 and Step 2 and replace lightdm-gtk-greeter[ with pi-greeter in Step 2. Then reboot the Raspberry Pi.

Use a Different Display Manager
Now we can try to use the GDM3 display manager instead of the LightDM display manager to see if we like the look of the GDM3 display manager better than the LightDM display manager with the LightDM GTK Greeter.

1. Open Terminal and paste the following command:

Code: Select all

sudo apt install gdm3
Note: This command installs the GDM3 display manager.

2. During the installation, you will be prompted with a window explaining that the installation script detected more than one display manager in the system. It will ask you to select the display manager from a list of available display managers. Select GDM3.

3. Once the installation script completes, reboot the Raspberry Pi.

4. When the Raspberry Pi reboots, you will see a new login window provided by the GDM display manager.
Note: The GDM display manager doesn't have a GUI utility to modify various screen elements of the login window. So, if you like GDM more than LightDM with GTK greeter, you will have to research how to modify the appearance of the login window to suit your taste. Such a modification will have to be done by editing GDM's configuration files.

5. If you want to revert to LightDM, use one of the following commands (they both do the same thing):

Code: Select all

sudo dpkg-reconfigure gdm3
or

Code: Select all

sudo dpkg-reconfigure lightdm
Note: Once you issue this command, you will see a window similar to the one you saw during the installation of GDM3. This window will allow you to choose a different display manager, so you can choose LightDM in this window. When you reboot, you will be back to the LightDM with GTK Greeter login window.

(Optional Step) Uninstall Unused Packages
Once you have chosen the display manager and the greeter, you can uninstall unused packages as follows:
1. To uninstall GDM, paste the following command in Terminal:

Code: Select all

sudo apt remove gdm3 --purge
Note: Do this step only if you have switched to GDM, didn't like it, and and switched back to LightDM.

2. To uninstall the LightDM display manager, paste the following command in Terminal:

Code: Select all

sudo apt remove lightdm* --purge
Note: Do this step only if you have switched to GDM and liked it.

3. To uninstall the LightDM GTK+ Greeter settnigs, paste the following command in Terminal:

Code: Select all

sudo apt remove lightdm-gtk-greeter-settings --purge

Note: There is no reason to use this step unless you decided to revert to pi-greeter.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Creating New Users in Raspbian with Mate Desktop

Sat Jan 11, 2020 7:51 pm

Now that we have enabled the login window with a display manager of choice, we can create additional users for the Raspberry Pi. Each user gets his/her own desktop, home folder, the custom panels, the custom panel application launch icons, the custom set of keyboard layouts, etc.

New Linux users can be created in Terminal with the useradd command, and they can be added to groups with the usermod command. However, we will use a GUI utility to add users and add users to groups here, as those who want to do this in in the Linux shell with Terminal already know how to do this.

1. We need to download the GUI utility called gnome-syste-tools. Open terminal and paste the following command:

Code: Select all

sudo apt install gnome-system tools
2. In Mate desktop, navigate to System > Administration and select Users and Groups.

3. Click the Add button.

4. You will be asked to enter the Linux password for the user you are logged in as.

5. Enter the Name of the new user. The system will create the username out of the name, but you can modify the username.

6. Create a password for the new user and confirm it.

7. Click Manage Groups.

8. In the list of groups, select each group and then click Properties. Add the newly created user to a group by selecting the username under a group.
Note: The user pi comes as a member of the following groups: adm, dialout, cdrom, sudo, audio, video, plugdev, games, users, input, netdev, spi, i2c, gpio. Therefore, if you want to create another user with the same privileges as the user pi, select each of these groups, click Properties, and add the newly created user to them.

9. You can rename the user pi. Select pi in the Users Settings window, click Change... next to the username pi, type the new username, and click OK. Then, close the Users Settings window.

10. Reboot the raspberry PI and log in as the newly created user.

********************************************************************************
When a newly created user tries to issue a Terminal command that starts with sudo, he/she will be prompted for the Linux password. This behavior is standard in most Linux and Unix based OSes, including MacOS. However, in Raspbian, this behavior is disabled for the standard user pi; when the user pi uses a Terminal command starting with sudo, the system authenticates this user automatically. If you want the no-password behavior when using a Terminal command starting with sudo for a new user, follow these steps.

a. Use your favorite text editor to edit this file:

Code: Select all

/etc/sudoers.d/010_pi-nopasswd
b. Add the following line for the new user. Assume that the corresponding username is jack

Code: Select all

jack ALL=(ALL) NOPASSWD: ALL
.

c. Save the file.

d. Reboot the Raspberry Pi, login to the profile for the username jack, open Terminal, and try to issue the following command to make sure that sudo no longer requires a password for authentication.
sudo cat /etc/sudoers.d/010_pi-nopasswd
If no password was required, repeat steps (a), (b), and (c) for each newly created user unless you want these users to supply their Linux password every time they use sudo.
**********************************************************************************

Even though the new users were added to the group sudo, the Users and Groups utility/applet in System > Control Center allows only the users root and pi to authenticate with their passwords to be able to add/delete/edit users and/or groups. If you want some other users to be able to authenticate with their passwords to add/delete/edit users and/or groups, do the following:
a. Make a copy of the file /etc/polkit-1/localauthority.conf.d/60-desktop-policy.conf by using the following command:

Code: Select all

sudo cp /etc/polkit-1/localauthority.conf.d/60-desktop-policy.conf /etc/polkit-1/localauthority.conf.d/60-desktop-policy.conf.bk
b. Edit the file at the following path with your favorite text editor:

Code: Select all

/etc/polkit-1/localauthority.conf.d/60-desktop-policy.conf

c. The default content of this file is as follows:

Code: Select all

[Configuration]
AdminIdentities=unix-user:pi;unix-user:0
Append the usernames of the users (e.g. lisa and margie) whom you want to be able add/delete/edit users and/or groups by authenticating with their passwords in the Users and Groups utility/applet, as follows:

Code: Select all

[Configuration]
AdminIdentities=unix-user:pi;unix-user:0;unix-user:lisa;unix-user:marge
Now, the Users and Groups utility/applet will allow four users to authenticate with their passwords to be able to add/delete/edit users and/or groups: pi, root; lisa, margie.
Last edited by sirozha on Sun Jan 26, 2020 6:15 pm, edited 2 times in total.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Creating a Common Folder for Sharing Files Among Raspberry Pi Users

Sun Jan 12, 2020 4:41 am

Now that we have several users created on the Raspberry Pi, we may need to have a common folder on the file system where all users on the same Raspberry Pi can share their files and folders. By default, Raspberry Pi users can see each others' folders but cannot read files in those folders or write to those folders.

1. Open Terminal and paste the following command:

Code: Select all

sudo addgroup family
]Note: This command creates a new group family in Rasbpian:

2. Add every user to the newly created group:

Code: Select all

sudo adduser pi family
Note: This command adds the user pi to the group family. Repeat this command for every user you created in Raspbian per instructions in the previous post.

3. Create a folder to be used for file sharing among Raspberry Pi users. Open Terminal and paste the following command:

Code: Select all

sudo mkdir -p /home/common 
]Note: The name of the folder for file sharing is common

4. Change the group ownership of the common folder to family

Code: Select all

sudo chgrp family /home/common
5. Change the folder permissions:

Code: Select all

sudo chmod 2775 /home/common
Note 1: The permissions 2755 mean the following: 2 - SetGID; 7 - User permissions (read, write, execute); 7 - Group permissions (read, write, execute); 5 - Everyone's permissions (read, write).
Note 2: When the SetGID is enabled on a folder, every file and every subfolder created inside the folder inherit the group ownership of the folder.

6. The default umask configured in Raspbian Buster (and in Debian Buster) is 022. By default, all folders are created with the permission 777 and all files are created with the permission 666. However, the umask is applied to arrive at the actual permissions set on folders and files. With the umask set to 022, the folders are created with the permission 755, and the files are created with the permission 644.
777: User (read, write, execute); Group (read, write, execute); Everyone: (read, write, execute)
755: User (read, write, execute); Group (read, execute); Everyone: (read, execute)
666: User (read, write); Group (read, write); Everyone: (read, write)
644: User (read, write); Group (read); Everyone: (read)

If we keep the default umask, users won't be able to see the contents of the subfolders created by other users inside the common folder or be able to modify files created by other users inside the common folder. Therefore, we need to change the umask to 002, so that the subfolders are created with the permissions 775 and files are created with the permissions 664. These permissions would allow users to open the subfolders of the folder common created by other users and modify the files saved inside the folder common or its subfolders.

a. Open the following file in your favorite editor:

Code: Select all

/etc/pam.d/common-session

b. Add the following string to the end of the file:

Code: Select all

session optional pam_umask.so umask=002
c. Save the file

7. In Terminal, create a symbolic link to the folder common:

Code: Select all

sudo ln -s /home/common  /home/common_folder
8. Copy the symbolic link to each user's desktop, by using the following command:

Code: Select all

sudo cp -P /home/common_folder /home/pi/Desktop

Note: Repeat this command for every user created on the Raspberry Pi and replace pi with the username.

9. Reboot the Raspberry Pi.

10. When the Raspberry Pi restarts, log in to a user profile, and double-click the shortcut common_folder on your desktop. The folder common should open in the file manager.

11. Create a subfolder in the folder common, create a test file and save it inside the folder common as well as inside a subfolder of the folder common.

12. Log out of this user profile and log in to another user profile.

13. Double-click the shortcut common_folder on the desktop in another user profile.

14. Make sure you can read the test file inside the folder common, make sure you can open the subfolder inside the folder common, make sure you can open the test file insider the subfolder, and make sure you can edit the both test files and save them.

******************************************************************************************
Now several users can share files and folders on the Raspberry Pi by using the folder
common
.
******************************************************************************************
15. (Optional) In this step, we will share the folder common over Samba so that it can be readable from and writable to by other computers on the same network.
a. Open the following file in your favorite editor:

Code: Select all

/etc/samba/smb.conf
b. Add the following lines at the bottom of this file:

Code: Select all

[Common Folder]
   comment= Folder used for sharing files among users on the same system 
   path = /home/common
   read only = no
   browseable = yes 
c. In Terminal, paste the following command:

Code: Select all

sudo service smbd restart
d. Browse the Network Neighborhood / Network on another computer, click on the Raspberry Pi, and you should see the share called Common Folder. Open a file that's stored in that folder, edit the file, and save it to the folder. Create a subfolder in that folder. Delete a file from that folder. Delete the subfolder that you created.
*******************************************************************************************
Now the folder common can be used as a shared folder among users on the Raspberry Pi as well as among other computers (Macs and PCs) on the same network.
**********************************************************************************
If you need to create a new user after this procedure was completed, follow directions on the above post, and make sure that you add the new user to the group family (along with other groups on the list specified in that post). Then, you can use the Caja file manager in Mate to copy the symbolic link (aka shortcut) common_directory from:

Code: Select all

/homes/common/
to: a disk location accessible from the new user's profile. For example, this location could be the new user's Desktop or Documents folder.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Reversing Direction of Mouse Scrolling in Raspbian

Tue Jan 14, 2020 11:24 pm

These instructions are for reversing the scrolling direction of a mouse in Raspbian Buster. The result is that the scrolling direction will match the way it is done in macOS, which is called Natural Scrolling. With Natural Scrolling, you are moving the imaginative sheet of paper under the screen rather than moving the screen over the sheet over paper. Natural Scrolling is the same way that scrolling is implemented in smartphones and tablets.

1. Use your favorite text editor to edit this file:

Code: Select all

/usr/share/X11/xorg.conf.d/40-libinput.conf
2. Add the following line at the end of the first instance of Section "Input Class":

Code: Select all

Option "NaturalScrolling" "true"
3. Restart restart the Raspberry Pi.

The mouse scrolling direction should now be reversed compared to how it was before.

If you want to revert back to the original scrolling direction (the non-Natural one), then delete from the file 40-libinput.conf the string:

Code: Select all

Option "NaturalScrolling" "true"
and then reboot the Raspberry Pi.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Converting Raspbian Buster with NOOBS into Raspbian Buster without NOOBS

Sat Feb 01, 2020 12:48 am

If you installed the Raspbian Buster OS from a micro-SD card that you purchased as part of a Raspbian Pi Kit (official or third-party kit), chances are that the image that was installed on the micro-SD card was NOOBS.

NOOBS is an installer that allows you to choose which Linux OS to install, but NOOBS itself is a small OS. When you choose to install Raspbian Buster upon the first boot of your Raspberry Pi, NOOBS configures the system to load Raspbian Buster, but NOOBS itself continues to load before Raspbian Buster loads every time you boot your Raspbian Pi.

There are different opinions on whether or not running NOOBS along with Raspbian Pi is beneficial. There's also an unofficial fork of NOOBS that can do much more than NOOBS and much better.

The benefits of NOOBS or its fork is that you can boot into NOOBS even if the Raspbian Buster installation gets corrupted, and you can use NOOBS to reinstall Raspbian Buster from within NOOBS. It's similar to having a recovery partition in macOS, except in macOS, the recovery partition doesn't load upon every boot, whereas NOOBS does.

The downside of NOOBS is that it's a separate OS that loads every time you boot the Raspberry Pi. Therefore, it takes longer for the Raspberry Pi to boot up Raspbian and get you all the way into the desktop environment.

In order to find out whether or not NOOBS is present in your installation, use the following command:

Code: Select all

sudo fdisk -l
If you see something similar to this output, you have NOOBS installed:

Code: Select all

Device         Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk0p1         8192  4615234  4607043  2.2G  c W95 FAT32 (LBA)
/dev/mmcblk0p2      4615235 62333951 57718717 27.5G  5 Extended
/dev/mmcblk0p5      4620288  4685821    65534   32M 83 Linux
/dev/mmcblk0p6      4685824  5210109   524286  256M  c W95 FAT32 (LBA)
/dev/mmcblk0p7      5210112 62333951 57123840 27.2G 83 Linux
What you see here is a list of partitions on the device mmcblk0, which is your micro-SD card. There are five partitions on the micro-SD card.
  • mmcblk0p1 is the partition where NOOBS is installed.
  • mmcblk0p5 is the partition where configuration files for the NOOBS as well as some scripts are stored.
  • mmcblk0p6 is the partition mounted to the folder /boot. Everything you see in the folder /boot is stored on the partition mmcblk0p6
  • mmcblk0p7 is the partition where Raspbian Buster is installed. This is Raspbian Buster's *root* partition, which is mounted to / (aka *root folder*). Everything you see in the Raspbian Buster's root folder (besides the contents of the /boot folder) is stored in the partition mmcblk0p7.
Now we will convert the NOOBS with Raspbian Buster installation into the pure Raspbian Buster running without NOOBS. Once we are done, the boot time of the pure Raspbian Buster installation (without NOOBS) will be reduced by about 20 seconds on the Raspberry Pi 4B (with 4GB of RAM).

1. Download the noobs2img.zip file, which contains a compressed script created by the Raspbian forum member RonR.
Note: By default, the noobs2img.zip file will be saved in your profile's Downoads folder by the web browser.
2. Open the Caja file manager and navigate to the Downloads folder.
3. Double-click on the downloaded file noobs2img.zip. Caja should open the plugin that extracts zip archives.
4. Extract the [b]noobs2img.zip[/b] file into the Downloads folder.
5. Open Terminal and issue the following commands:

Code: Select all

cd
cd Downloads
chmod +x noobs2img
sudo ./noobs2img
The script will prompt you with the following questions:

Code: Select all

Image file to create? 
Paste the following string as your answer:

Code: Select all

/media/buster.img
Then press Enter.

Code: Select all

Image ROOT filesystem size (MB) [XXXXX]?
Type in 0 and press Enter.
Note: By giving the size of 0, you are instructing the script to calculate the necessary size for the image file.

Code: Select all

Image ROOT filesystem size (MB) [30173]? YYYYY

Note: The value displayed in stead of YYYYY is the auto-calculated size (in MB) of the image file that will contain a copy of the Raspbian Buster installation without NOOBS partitions.

Press Enter.

Code: Select all

Create /media/buster.img [YYYYY MB] (y/n)
Type in y and press Enter.

The script will start copying the Raspbian Buster installation (the root and the boot partitions) into the image file buster.img

Be patient, it may take 15-20 minutes for the script to finish its work. While the script is working, there will be no output in the Terminal window. Once the script completes, you will see the the output in the Terminal window cluing your in that the file was created.

6. Move the the file buster.img to your profile's Documents folder by using the following command:

Code: Select all

sudo mv /media/buster.img /home/<your_user_name/Documents/
7. Copy the file buster.img to a Mac , non-ARM 64-bit Linux, or Windows machine, using your favorite method. You can copy this file to a USB flash drive (it should be at least 16 GB flash drive) or share your profile's Documents folder and transfer the file buster.img to a Mac, Windows, or a non-ARM 64-bit Linux machine over the network.

8. Use your favorite software for burning images to external drives to transfer the file buster.img to another micro-SD card. The micro-SD card should be at least the same size as the one you were using with the NOOBS with Rasbpian Buster installation.
Note 1: Please do not re-use the same micro-SD card to preclude destroying your NOOBS with Raspbian installation before you make sure that the Raspbian without NOOBS installation can be booted off.
Note 2: On a Mac, a non-ARM 64-bit Linux, or Windows machine, you can use the Balena Etcher application to transfer the buster.img image file to a micro-SD card. For some reason, the web site doesn't have the Windows version of this application, but you can google the name and download it from another source.

9. It will take about 30 minutes or so to transfer the file buster.img to a micro-SD card, using Balena Etcher. Once the process is completed, turn off the Raspberry Pi, remove the micro-SD card and keep it safe for now, then insert the new micro-SD card that contains Raspbian buster without NOOBS, and turn on your Raspberry Pi.

10. Upon the first boot, the Raspberry Pi may automatically reboot once or twice. Don't be alarmed; let it reboot and then log in to your profile. You should have all the files and settings exactly the same way they were in the Raspbian with NOOBS installation on the other micro-SD card.

11 Open Terminal and paste this command:

Code: Select all

sudo fdisk -l
The output of this command should be as follows:

Code: Select all

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1        8192   532480   524289  256M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      540672 62333951 61793280 29.5G 83 Linux
As you can see, there are only two partitions now. NOOBS is gone! (Compare to the output of the same command at the beginning of this post).

These two partitions are:
  • mmcblk0p1: This is the boot partition
  • mmcblk0p2: This is the root partition

You are done. Enjoy faster boot times and more free space on your micro-SD card.
Last edited by sirozha on Sat Feb 01, 2020 2:24 am, edited 6 times in total.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Modifying Raspberry Pi Behavior During Boot

Sat Feb 01, 2020 1:56 am

When the Raspberry Pi boots, you can see several things on the monitor:
a. A rainbow-colored square that is displayed for a few seconds.
b. Several red raspberries (as in *berries*) displayed in the upper left corner.
c. You may see a rolling screen of system messages displayed on the monitor.

You can change what's displayed on the monitor when you tun on your Raspberry Pi.
Note: Depending on the text editor you will be using, you may be asked to authenticate with your user password before you can edit these configuration files. If you are using a shell-based editor, like vim or emacs, use sudo in front of the text editor name.

1. To remove the red raspberries in the upper left corner, do the following:
a. Make a backup copy of the file /boot/cmdline.txt as follows:

Code: Select all

sudo cp /boot/cmdline.txt /boot/cmdline.bk
b. In your favorite text editor, edit the file:

Code: Select all

/boot/cmdline.txt
Note: All commands in this file are listed on one line separated by a space and without any line breaks.

c. Add a space to the end of the line followed by:

Code: Select all

logo.nologo
Therefore, the entire line of commands in the file cmdline.txt should look like this:

Code: Select all

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait logo.nologo
d. Save the file cmdline.txt and reboot the Raspberry Pi.

e. Observe that the red raspberries no longer appear in the upper-left corner.

2. In this step, we will remove the rainbow-colored square that appears for a few seconds right after the Raspberry Pi starts to boot.
a. If you have Raspbian Buster without NOOBS, edit the file /boot/config.txt with your favorite text editor and add the following string as a new line in that file (it can be added anywhere in the file, but you can simply add it to the end of the file to make sure that you don't delete anything else):

Code: Select all

disable_splash=1
Reboot the Raspberry Pi, and upon the next boot, you should no longer see the rainbow-colored square.

b. If you have Raspbian Buster with NOOBS, you need to mount the NOOBS partition first and create the file config.txt, as follows:

Code: Select all

sudo mnt /dev/mmcblk0p1 /mnt
cd /mnt
sudo touch config.txt
Then, use your favorite text editor to add the following string to the file /mnt/config.txt

Code: Select all

disable_splash=1
Save the file, reboot the Raspberry Pi, and upon the next boot, you should no longer see the rainbow-colored square.

3. In this step we will disable the output of system messages to the console during the boot.

a. If you Raspbian Buster without NOOBS, in your favorite text editor, edit the file /boot/cmdline.txt and add the following commands to the end of the string in this file:

Code: Select all

consoleblank=0 loglevel=1 quiet
Note: All commands in this file are listed on one line separated by a space and without any line breaks.
Save the file, reboot the Raspberry Pi, and upon the next boot, you should no longer see any system messages.

b. If you have Raspbian Buster with NOOBS, sit tight. I'm still working on the solution.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Connecting Bluetooth audio device (speaker or headphones) to Raspberry Pi

Tue Feb 04, 2020 10:16 pm

In the first post of this thread, while configuring the Mate desktop environment, we installed the Blueman package, which created the Bluetooth icon in the System Tray (upper-right corner) of the Mate desktop. Now we will connect a Bluetooth Audio device (Bluetooth headphones or Bluetooth speakers) to Raspberry Pi.

1. Put your Bluetooth audio device in the discoverable mode.

2. Click on the Bluetooth icon in System Tray and select Devices in the drop-down menu.

3. Click the Search button at the top of the window and select the Bluetooth audio device you want to pair with Raspberry Pi from the list of Bluetooth devices.

4. Click the button with the keys at the top of the window to pair the Raspberry Pi with the Bluetooth audio device.

5. Click the star button at the top of the window to mark this Bluetooth audio device as trusted.

6. Click the Setup button at the top of the window to launch a wizard to set up the Bluetooth Audio Device. In the wizard, choose the Headphones option and complete the setup.

7. The Bluetooth icon in the Mate's System Tray should turn from blue to green. This means that your Bluetooth Audio device is now connected.

8. Right-click on the Speaker icon in the Mate's System Tray, select the Sound Preferences menu item, click on the Output tab, and observe that both the Built-in Analog Audio and the newly configured Bluetooth audio device are listed there.

9. In Chromium, open Youtube and start playing a video or audio. You can search for "stereo test" and play that audio. The sound should be playing through the Bluetooth audio device. If you can't hear any sound, adjust the volume by clicking on the Speaker icon in Mate's system tray and/or adjust the sound volume in your Bluetooth audio device (headphones or speaker).

10. If you want to switch audio from the Bluetooth audio device to the Raspberry Pi's analog audio jack (or HDMI audio) or vice versa, do the followign:
a. Right-click the speaker icon in Mate's system tray.
b. Select Sound Preferences
c. Click the Output tab
d. Select other audio device from the list of audio devices on this tab.
Note: This method doesn't switch audio playing in Chromium from one audio device to another in real time. Therefore, you would need to close the Chromium tab, then open a new tab, and then restart audio in the new tab. The audio will be playing on the device that you chose in Step (d).

11. In order to be able to switch audio from one audio device to another one in real time, you need to install the utility called Sound Switcher Indicator
a. Download the Debian package from here:
b. The downloaded package will automatically be saved in your profile's Downloads folder.
c. Open Terminal and paste the following commands (one at a time), each followed by pressing the Enter key:

Code: Select all

cd ~/Downloads
sudo dpkg -i indicator-sound-switcher_*_all.deb
12. Once the Sound Switcher Indicator utility installs, reboot Raspberry Pi.

13. When the Raspberry Pi reboots, log in to your profile. You will see a new icon in Mate's System Tray.

14. Launch Chromium, open Youtube and start playing a video or audio in Youtube.

15. Click on the Sound Switcher Indicator icon in System Tray and select the analog output or (HDMI output) audio device to play the audio through. Then, switch the audio device back to the Bluetooth audio device. Note that you can now switch audio devices in real time (while the audio is playing).
Last edited by sirozha on Tue Feb 04, 2020 11:02 pm, edited 1 time in total.

User avatar
scruss
Posts: 2811
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Steps for Configuring Mate Desktop on 4GB Raspberry Pi 4B - (Rev.6)

Tue Feb 04, 2020 10:26 pm

Additionally, the standard Raspbian installation lacks (at the time of this writing) a GUI-based printer configuration utility
Not any more: updates pull in system-config-printer and the IPP driver by default.
If anyone with the Raspbian Foundation is reading this post, I would recommend that you guys look into releasing an official Rasbpian OS distribution with the Mate DE, perhaps only for the 4GB Rasbperry Pi 4B
That's not their jam: all official OS releases must run on all Raspberry Pi hardware. Hence no official 64-bit releases.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Re: Steps for Configuring Mate Desktop on 4GB Raspberry Pi 4B - (Rev.6)

Tue Feb 04, 2020 11:04 pm

scruss wrote:
Tue Feb 04, 2020 10:26 pm
Additionally, the standard Raspbian installation lacks (at the time of this writing) a GUI-based printer configuration utility
Not any more: updates pull in system-config-printer and the IPP driver by default.
If anyone with the Raspbian Foundation is reading this post, I would recommend that you guys look into releasing an official Rasbpian OS distribution with the Mate DE, perhaps only for the 4GB Rasbperry Pi 4B
That's not their jam: all official OS releases must run on all Raspberry Pi hardware. Hence no official 64-bit releases.
The 64-bit kernel is already available from Raspbian. They will release a 64-bit OS for the Raspberry Pi versions that support it.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Adding equalizer to the Raspbian installation

Tue Feb 04, 2020 11:18 pm

If you want to add an equalizer to your installation of Raspbian with Mate or with the standard Raspbian (based on LXDE), use the following instructions (that I found in this post):
1. Open Terminal and paste this command followed by the Enter key:

Code: Select all

sudo apt install libasound2-plugin-equal 
2. Create the following file, using your favorite text editor:

Code: Select all

~/.asoundrc
3. Paste the following commands in the file, save the file, and close the file (make sure you scroll down in the window below to copy all the commands):

Code: Select all

pcm.!default {
 type plug
 slave.pcm plugequal;
}
 
ctl.equal {
 type equal
}
 
pcm.plugequal {
 type equal
 slave.pcm "plughw:ALSA,0"
}
 
pcm.equal {
 type plug
 slave.pcm plugequal
}
4. Type this command in Terminal (followed by the Enter key)

Code: Select all

alsactl kill rescan
5. In Terminal type this command (followed by the Enter key) to open the curses[/i-based ]ALSA equalizer:

Code: Select all

alsamixer -D equal
Note: Alternatively, you can open the curses-based ALSA mixer, by using this command:

Code: Select all

alsamixer
then press the F6 key, highlight the enter device name line, press Enter on the keyboard, type equal, and press Enter on the keyboard again.

BenRandomNameHere
Posts: 14
Joined: Fri Sep 20, 2019 2:59 pm

Re: Steps for Configuring Mate Desktop on 4GB Raspberry Pi 4B - (Rev.7)

Thu Feb 06, 2020 4:22 pm

Call for help in figuring out why I cannot actually click anything with my touchscreen- I can open menus but not execute a function within a menu.

I can select System, the menu opens. But if I attempt to tap on Shutdown... it flashes and does nothing.

I would like to re-enable the missing bits so I don't need a mouse anymore.

I have not completed beyond the initial post, but can report I am super dooper happy with the Mate Desktop experience. I am a Linux n00b, but this setup described here is just awesome.

Bonus Question:
Is this 'Mate Desktop' available as a full blown distribution? With updates? I see it is related to Ubuntu, but I don't quite understand some of the Linux specific flavors/desktops/managers stuffs.

The Mate Desktop experience is vastly superior on an overclocked 4b. Desktop compositing fixes the screen tearing. I now have a personal Disney+/Spotify player I take everywhere with me.

To all involved with these projects- Thank You!

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Re: Steps for Configuring Mate Desktop on 4GB Raspberry Pi 4B - (Rev.7)

Thu Feb 06, 2020 6:27 pm

Are you able to navigate menus with a mouse in Mate desktop?

Are you able to navigate menus in the standard Raspbian desktop with touchscreen using touch only?

By the way, Mate is not part of standard Ubuntu, which uses Gnome 3 desktop. Mate is a fork of Gnome 2. There’s an Ubuntu flavor that comes with Mate, but in Ubuntu, you can switch desktops easily anyway, so you can install the standard Ubuntu with Gnome 3 and then switch to Mate or a number of other desktops.

There is no official Raspbian flavor with Mate. If there were, I wouldn’t have had to spend so much time on figuring all these things out and making this thread, which took at least 100 hours. However, I would encourage the Raspbian developers to release an official Raspbian Mate flavor, as the experience with Mate is much superior to that of the standard Raspbian desktop based on LXDE.

BenRandomNameHere
Posts: 14
Joined: Fri Sep 20, 2019 2:59 pm

Re: Steps for Configuring Mate Desktop on 4GB Raspberry Pi 4B - (Rev.7)

Thu Feb 06, 2020 11:26 pm

Yes to both questions.

Touching the screen properly moves the mouse pointer, and will even open menus... it just won't 'activate' any commands in menus.

Touch properly works in all other expected ways; I can move windows, resize, minimize, close, etc. I can scroll a page with the scrollbar on the side, etc.

Just can't actually get things like "Shutdown...' or 'Control Center' or 'Chromium Web Browser' to work in the menus with touch. Browsing the menus works fine though. It's frustrating... but to be honest, even if this isn't easily fixable, I won't switch back to the standard interface stuff in the foreseeable future.

BenRandomNameHere
Posts: 14
Joined: Fri Sep 20, 2019 2:59 pm

Re: Steps for Configuring Mate Desktop on 4GB Raspberry Pi 4B - (Rev.7)

Fri Feb 07, 2020 12:14 am

I just changed from the standard menu on the bar to "Brisk" and touch works with it as it should.

I don't know what's wrong with the normal menu setup, but switching to Brisk works well.

sirozha
Posts: 68
Joined: Sat Dec 28, 2019 2:44 am

Controlling Mouse Scrolling Speed in Raspbian Buster with Mate Desktop

Sat Feb 15, 2020 12:20 am

Standard mouse controls in Mate do not have mouse scrolling speed control. However, it's relatively easy to create an applet that can control the mouse scrolling speed:
Creating an applet for controlling mouse scrolling speed

1. Create a new file, using your favorite text editor and then paste the following script:

Code: Select all

#!/bin/bash
# Version 0.1 Tuesday, 07 May 2013
# Comments and complaints http://www.nicknorton.net
# GUI for mouse wheel speed using imwheel in Gnome
# imwheel needs to be installed for this script to work
# sudo apt-get install imwheel
# Pretty much hard wired to only use a mouse with
# left, right and wheel in the middle.
# If you have a mouse with complications or special needs,
# use the command xev to find what your wheel does.
#
### see if imwheel config exists, if not create it ###
if [ ! -f ~/.imwheelrc ]
then

cat >~/.imwheelrc<<EOF
".*"
None, Up, Button4, 1
None, Down, Button5, 1
Control_L, Up, Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L, Up, Shift_L|Button4
Shift_L, Down, Shift_L|Button5
EOF

fi
##########################################################

CURRENT_VALUE=$(awk -F 'Button4,' '{print $2}' ~/.imwheelrc)

NEW_VALUE=$(zenity --scale --window-icon=info --ok-label=Apply --title="Wheelies" --text "Mouse wheel speed:" --min-value=1 --max-value=100 --value="$CURRENT_VALUE" --step 1)

if [ "$NEW_VALUE" == "" ];
then exit 0
fi

sed -i "s/\($TARGET_KEY *Button4, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button4, and write new value.
sed -i "s/\($TARGET_KEY *Button5, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button5, and write new value.

cat ~/.imwheelrc
imwheel -kill

# END OF SCRIPT FILE

2. Save the file with any name. You can call it scroll.sh

3. Open Caja, navigate to the directory where you saved the file scroll.sh, right click on the file scroll.sh, select Properties, then click on the Permissions tab and enable the check box Allow executing file as a program
Alternatively, use the following command:

Code: Select all

sudo chmod +x scroll.sh
Note: Make sure that you have changed the working directory to the directory where you saved the file scroll.sh

4. In Terminal, use the following command:

Code: Select all

apt install imwheel zenity
5. In Caja, double-click on the file scroll.sh, and select Run in Terminal
Alternatively, in Terminal, use the following command:
./scroll.sh

6. In the GUI window that pops up, move the slider to a value higher than 1 and click Apply

7. Test the scrolling speed in several applications, such as LibreOffice, Chromium, etc. If additional adjustments are needed, repeat Steps 4-6.
*******************************************************

Creating an applet on a Mate Panel for controlling the mouse scrolling speed:

1. Right-click on a Mate panel where you want the new applet to be located.
Note: This can be the Mate panel at the top of the screen or the Mate panel at the bottom of the screen.

2. Select Add to Panel from the contextual window.

3. Double-click on Custom Application Launcher

4. Fill in the following information:
Type: Application
Name: Scroll Speed
Command: Click the Browse button and navigate to the directory where you saved the file scroll.sh. Then select the file b]scroll.sh[/b] and click Open
Comment: Set Scroll Speed using imwheel and zenity script

5. [Optional - Changing the default icon of the applet] Click on the icon in the upper left corner and navigate to the path /usr/share/icons/hicolor/scalable/apps, select the file engrampa.svg, and click Open
Note: Alternatively, select any icon you would want this applet to use.

6. In the Launcher Properties window, Click OK

7. Double-click on the newly created applet (in the Mate Panel where you placed it) and in the GUI window that opens set the mouse scrolling speed. Don't forget to click Apply before testing the newly set scrolling speed.

Return to “Raspbian”