Archives For Ubuntu 18.04

gnome shell

This quick tutorial is going to show you how to add a ‘Show Desktop‘ icon into left dock launcher in Ubuntu 18.10 or Ubuntu 18.04.

The ‘Show Desktop‘ button was dropped since Ubuntu switched to Gnome 3 Desktop. To add it back, you can manually create show desktop shortcut icon and add it to panel (dock).

As you may know, the keyboard shortcuts Ctrl+Alt+d or Super+d do the function hide or show all opened app windows. And following steps will create a ‘show desktop’ shortcut icon simulates the keyboard press (Super+d) via xdotool.

NOTE that following steps don’t work on Wayland session, since xdotool simulates X11 keyboard/mouse input events.

1. Open terminal (Ctrl+Alt+T) and install xdotool:

sudo apt-get install xdotool

Type your user password (no asterisks feedback) when it prompts and hit Enter to continue.

2. Then create the show desktop shortcut icon and edit it via command:

gedit ~/.local/share/applications/show-desktop.desktop

When the file opens, paste following lines and save it.

[Desktop Entry]
Type=Application
Name=Show Desktop
Icon=desktop
Exec=xdotool key --clearmodifiers Super+d

3. Finally search for ‘show desktop’ in application menu, then right lick and select ‘add to favorites’:

That’s it. Enjoy!

Ubuntu 18.04

Ubuntu 18.10 Cosmic Cuttlefish was finally released today. Here’s how to upgrade from Ubuntu 18.04 to Ubuntu 18.10.

Ubuntu 18.10 is a short-term release with 9 months support. It features Linux 4.18 kernel, X.Org Server 1.20.1, Mesa 18.2.2, and new default desktop theme ‘Yaru’.

Preparation:

Before getting started, you need to do some preparations:

  1. Backup your bookmarks, documents, and other important data.
  2. It’s recommended to remove proprietary drivers and use the open-source drivers instead.
  3. Purge or remove third-party PPA repositories (Software & Updates -> Other Software)

To upgrade to Ubuntu 18.10:

1. Open Software & Updates and navigate to Updates tab.

Then select “For any version” from the drop-down menu of ‘Notify me of a new Ubuntu version’

2. Install all available system updates by running commands in terminal (Ctrl+Alt+T):

sudo apt-get update && sudo apt-get dist-upgrade

Type your user password (no asterisks feedback) when it prompts and hit Enter to continue.

3. Start Update Manager and you’ll see Ubuntu 18.10 available for upgrade (Restart first if required):

sudo update-manager -c

4. Click the Upgrade button and confirm in the next release note dialog:

The upgrading process starts and it may take a few hours depends on your device and internet speed.

gnome shell

This quick tutorial is for those who want to pin application shortcut icons to the default Gnome Desktop in Ubuntu 18.04, while you can’t drag and drop icons from applications menu to the desktop.

1. First, open Gnome Tweaks (if not available, install it via Ubuntu Software) and navigate to Desktop tab and enable ‘Show icons’ on desktop.

2. Open Files (Nautilus file browser) and navigate to Other Locations -> Computer -> usr -> share -> applications.

There drag and drop any application shortcut to the desktop.

Click to run the desktop icon, and select ‘Trust and Launch’. The shortcut icon will display correctly once the application launches.

To remove a desktop shortcut, simply move the icon to trash. Only the shortcut will be removed, not the original item.

That’s it. Enjoy!

gnome shell

The default Gedit text editor in Ubuntu 18.04 always opens file in a new window, even though there’s already an existing instance. And there’s no easy option to change the behavior.

Thanks to fossfreedom, you can re-built Gedit pakages so to always open files in new tabs in the same gedit window.

1. Open terminal either via Ctrl+Alt+T shortcut key or by searching for ‘terminal’ from software launcher.

2. When terminal opens, paste the command below and hit run to install the building tools:

sudo apt-get install devscripts build-essential fakeroot

3. Launch Software & Updates, and click enable download Source code from Ubuntu repositories.

4. In user downloads, create a build folder and navigate to the directory.

cd ~/Downloads/ && mkdir build && cd build

5. Download the gedit source code via command:

sudo apt-get update; apt-get source gedit

Type your password (no asterisks feedback) when it prompts

6. Next edit the source file gedit-app.c:

cd gedit-* && gedit gedit/gedit-app.c

When the file opens, add new line return TRUE; as the picture shows (line 320 for Ubuntu 18.04):

7. Give a unique package name by editing the debian/changelog file.

gedit debian/changelog

8. Finally rebuild the gedit via commands:

sudo apt-get build-dep gedit

debuild -i -us -uc -b

The commands will take a few minutes building the gedit text editor packages.

9. At last, install the new packages via command and enjoy!

cd ~/Downloads/build/ && sudo dpkg -i gedit*.deb

In addition, you may lock the changes so it won’t be overwritten after installing system updates.

And it can be done easily via Synaptic package manager (available in Ubuntu Software). Simply search for ‘gedit’ and choose lock version for gedit and gedit-common packages one by one.

gnome shell

While the trash icon does not have ‘Add to Favorites‘ context menu option, here’s how to manually add a trash can icon to the left launcher in Ubuntu 18.04 Gnome Shell.

First see the result effect (in the picture, the left panel was replaced by Dash to Dock extension):

1. Open terminal either via Ctrl+Alt+T shortcut key, or by searching for ‘terminal’ from app launcher.

2. Run command to create and edit an empty file called trash.sh:

gedit ~/Documents/trash.sh

When the file opens, paste following lines and save it.

#!/bin/bash
icon=$HOME/.local/share/applications/trash.desktop

while getopts "red" opt; do
	case $opt in
    r)
	if [ "$(gio list trash://)" ]; then
		echo -e '[Desktop Entry]\nType=Application\nName=Trash\nComment=Trash\nIcon=user-trash-full\nExec=nautilus trash://\nCategories=Utility;\nActions=trash;\n\n[Desktop Action trash]\nName=Empty Trash\nExec='$HOME/Documents/trash.sh -e'\n' > $icon
	fi
	;;
    e)
	gio trash --empty && echo -e '[Desktop Entry]\nType=Application\nName=Trash\nComment=Trash\nIcon=user-trash\nExec=nautilus trash://\nCategories=Utility;\nActions=trash;\n\n[Desktop Action trash]\nName=Empty Trash\nExec='$HOME/Documents/trash.sh -e'\n' > $icon
	;;
    d)
	while sleep 5; do ($HOME/Documents/trash.sh -r &) ; done
	;;
  esac
done

3. Make the script file executable and run it via the 2 commands:

chmod +x ~/Documents/trash.sh

./Documents/trash.sh -e

4. Search for ‘trash’ in software launcher and select ‘Add to Favorites’ in its context menu.

5. Finally open Startup Applications, click Add to add a new startup app:

  • Type a name for the trash script.
  • Type command /home/YOUR_USER_NAME/Documents/trash.sh -d

Reboot Ubuntu, and the trash can icon will change when it’s empty or not empty.

via: ubuntuforums