Customizing and Improving the Desktop

Useful tweaks for KDE

https://userbase.kde.org/Plasma/Tips

Awesome tweaks to install

  • Look & Feel
    • GNOME
      • Dash to Dock Gnome extension (Mac style center dock Lite) UPDATE: now built into Ubuntu 20.04. You can still install and disable it to get the settings GUI.
      • Arc menu Gnome extension⭐
    • KDE
    • KDE Mac OS Style:
    • Kvantum (KDE)
      • sudo apt install qt5-style-kvantum qt5-style-kvantum-themes
      • Allows use of advanced SVG theming which looks more refined and with blurred transparency.
      • McMojave is a nice looking Kvantum theme.
      • To complete transparency support for all apps/menus:
        • Install and configure this kwin script
        • Also enable Blur and Transparency under System Settings > Workspace Behaviour > Desktop Effects
  • Icon sets:
    • Flat design: Papirus
    • Non-flat design: Newaita
    • MacOS like: La Capitaine
  • Wallpapers:
  • Gnome Extensions:
    • Sound Input and Output device chooser (Gnome tweaks extension)⭐
    • Removable drive menu (Gnome tweaks extension)
    • GPaste (image support is buggy, suggest disable. Ctrl+Alt+S hides password). A better alternative might be Copy Q.⭐

KDE Tray icons not following current theme

The tray icons are set based on the current Plasma Style in System Settings, not your current Icon Set. Therefore the icon set you apply may not apply in the Tray and status icons. You need to find a Plasma Style (or Global Theme) that uses the icon set you want, for example try Arc KDE for Papirus icons.

Try searching for your icon set by name in the Get New Plasma Style dialog in System Settings. Dont worry about the Plasma Style screwing up your currently applied theme, as this is overridden by Application Style.

Using a Runner (KRunner)

This is nice powerful (almost “hidden”) function of KDE. Default press Alt+F2 top bring it up and try typing various things, from running an application, dictionary definitions, maths equations, currency conversion and more.

Learn more: https://userbase.kde.org/Plasma/Krunner/ https://www.youtube.com/watch?v=NTNw5IumQtk&t=408s

KRunner advanced settings: ~/.config/krunnerrc

Alternatives to KRunner:

  • Gnome Activity Overview (built into Ubuntu Gnome)
  • ULauncher
  • Albert (Mac OS Alfred clone)

Making your own KDE Extensions (KDE Plasma widgets, applets, tray utilities, add-ons or Plasmoids)

These can easily be written in Qt/QML in any text editor. An overview here: https://community.kde.org/Plasma/DeveloperGuide More practical guides on coding/structuring the widget: https://techbase.kde.org/Development/Tutorials/Plasma5/QML2/GettingStarted https://techbase.kde.org/Development/Tutorials/Plasma5/QML2/HelloWorld When testing your QML widget you can use this to immediately try it out and debug:

plasmoidviewer -a {path-to-package} -l bottomedge -f horizontal

Use this to install (-i to install -r to remove and -u to update):

kpackagetool5 -t Plasma/Applet -i {path-to-package}

After install/update you might need to refresh QML cache for your panel/docks to see the changes, by killing and reloading them:

killall plasmashell; kstart5 plasmashell

OR if using Latte Dock instead of default Plasma:

killall latte-dock; kstart5 latte-dock

Another approach for simple widgets without coding is to use Argos/Kargos/BitBar which allows creation of tray widgets using a shell script.

Adding an icon shortcut (a Launcher) in Gnome or changing icon of existing launcher

Use a Main Menu GUI tool or launcher manager e.g. sudo apt-get install menulibre

OR manually add launcher (.desktop file):

Edit/Add Launcher files in directory /usr/share/applications (system wide), or ~/.local/share/applications (local user)

Full .desktop reference.

For icon files, place the png file in /usr/share/pixmaps/ and link to its filename it in the .desktop file (minus the png file extension)

To refresh shortcuts run: sudo update-desktop-database, though normally its automatic

For terminal applications which you want to run in their own window with icon and name in launcher, make sure to set up the launcher as follows:

Exec=gnome-terminal -e "micro %F" -t "Micro" --hide-menubar --name=Micro --class=micro
StartupNotify=true
Terminal=false

TIP: Use cuttlefish to browser and search for icons.

Warning: Manually installing alternative DE alongside the default can cause unforeseen issues. https://askubuntu.com/questions/961580/completely-remove-budgie

Win+E shortcut to open file manager:

If it doesn't work by default, Open System Settings > Devices > Keyboard, look for Launchers > Home folder and add Super+E key combination.

Show/Hide Desktop keyboard shortcut:

Default is Ctrl+Super+D, you can change it to Windows-style Super+D under Open System Settings > Devices > Keyboard, look for Navigation > Hide all normal windows

Change Grub bootloader timeout:

Easy way to speed up boot.

    sudo nano /etc/default/grub
    sudo update-grub

Switch Python to Python 3 (if defaults to 2.7 which is discontinued)

Python 3 may be pre-installed but not set as default, if you run python and it's not found, try python3 to see if it is found. Set up the default by running this. Also set up default for pip in the same way.

Visual Tweaks

Improved font rendering

One thing I noticed when coming to Linux was a subtle "unpolished" look to the font rendering. It was hard to exactly put my finger on but there was always something about the system-wide font rendering that just looked ever so slightly "off" compared to Mac and Windows.

One way to improve font rendering is to add this line to your /etc/environment file and reboot.

FREETYPE_PROPERTIES="cff:no-stem-darkening=0 autofitter:no-stem-darkening=0"

This makes fonts generally more pleasing, however you may find in some cases definition is lost due to the thickness of font, for example the dot in lower case "i" making it hard to distinguish from uppercase "I" in some fonts.

Screenshots and Capture

Depends on your desktop environment. Ubuntu default: PrtScr Saves desktop screenshot.png in Pictures folder + clipboard Shift + PrtScr Saves selected area to Pictures folder (esc to cancel) Alt + PrtScr Saves current window to Pictures folder Ctrl + {Any above} Copies desktop to clipboard instead of saving file

KDE/Kubuntu: Hit PrtScr key to launch Spectacle too.

Record all the audio output of pc speaker plus microphone (e.g. a conference call):

sudo add-apt-repository ppa:audio-recorder/ppa sudo apt-get update && sudo apt-get install audio-recorder

Launch audio recorder and do custom source, go to advanced settings and choose headset output and headset microphone input as recording devices.

Record screen (screencast) as well (window, monitor, or area): Default Gnome : Ctrl+Alt+Shift+R to start/stop, will save to Videos folder. Or try kazam.

sudo apt install kazam

Move apps around screen:

Win + Arrow keys move around display Win + Shift + Arrow keys move to different monitor

Create a new file using right click context menu in file browser (~/Templates)

https://vitux.com/add-new-document-back-to-the-right-click-menu-in-ubuntu-18-04/

Running scripts, commands or apps on boot/startup:

There are several methods to achieve this, depending at which moment you want it to run:

  • EASY GUI method for your distro: Note it will only run for the current user when they login.
    • Kubuntu: look for Autostart settings
    • Ubuntu Gnome: look for Startup Applications settings
  • crontab: See section below. Add a line @reboot <command>. Cron is very powerful and also allows running scripts on specific events or at regular intervals.
  • init.d: Place the executable or a link in /etc/init.d (as root). You may additionally need to run sudo update-rc.d /etc/init.d/nameofscript.sh defaults right after updating that folder. Remember to make the script executable after copying with chmod +x
  • rc.local: Add commands to /etc/rc.local, which will run on next startup.
  • system.d service: Advanced, creates a service which can be enabled or disabled, or set to auto reload if it crashes etc. Example.
  • Terminal initialisation files: Depending when exactly you want it to run (e.g. on boot, on specific users login, or on starting a new terminal session), add it to the appropriate init file, see Terminal > Initialisation scripts. For example add to ~/.bash_profile or ~/.bash_logout to run on user login or logout.

Automating/scheduling running of scripts using Crontab:

The “real” crontab is located in: /var/spool/cron/crontabs However it is deliberately near impossible to view or edit it directly. Instead use the following commands: Edit current users crontab: crontab -e Edit root crontab: sudo crontab -e

GUI tool for editing crontabs:

npm install -g crontab-ui

Remember that paths in crontab lines must be full paths e.g. instead of npx, use /usr/local/bin/npx or whatever is returned by which npx.

To test cron jobs: change the jobs timer to * * * * * and wait approx 1 minute for it to run. You can check if it actually ran using systemctl status cron. To see the commands output, you can redirect it to a file in the cron command using >> or tee.

Multiple commands in one job: You can include multiple commands in a cron job either by putting them in a script or joining them into one line using &&.

Commands not running: First change executables to their full path, then try adding a cd command to the start to make sure you are in the right directory, and finally try running as its own terminal command like fish -C "the command" or bash -c "the command"

Show/Hide hidden files in File browser

Ctrl + h

or in KDE Dolphin Alt + . can also be used

Nautilus File Manager Tweaks

Open as Administrator within File manager

sudo apt install nautilus-admin

Right click on a file or folder and you will be able to open a Admin. If you get an error, see this.

Open a folder in VS Code

https://github.com/harry-cpp/code-nautilus

Built in terminal in file manager

https://github.com/flozz/nautilus-terminal (Press F4 to show/hide)

Change folder colors

Remote Access

To access your PC remotely you can use either XRDP or VNC. I recommend VNC as it is natively supported in Ubuntu and Kubuntu. For client application I would recommend Remmina.

For Ubuntu or GNOME simply enable it in System Settings under Sharing > Screen Sharing. Highly recommend setting a password.

For Kubuntu or KDE, install Krfb (sudo apt install krfb) and similarly enable it and set a password.