Using Latte as a Dock in Kde

KDE Linux

Latte is a great “newish” dock for KDE that can be used as launching/task dock, or even completely replace your plasma panels. The dock is fast stable with a good “feel”, and it fully supports plasma widgets.

I myself do not like the Apple like task docks. I prefer using docks for app launching and let my panels do the task management. I was looking for a fast dock for my Arch VM at work, and Latte was one of the best options. The only thing missing was how to remove the task manager option. But luckily I ended up finding a way on my own (which feels more of a bug, but I won’t get into it), and I’m sharing the instructions here.

a. Install latte-dock

$ pacman -Syu latte-dock

b. Start the dock (from the terminal or with Alt+F2)

c. Right click on the dock and click on “Add/Widgets”. Add a widget (like the “Audio Volume” widget)

d. Right click on the dock again and click on “Dock/Panel Settings”

e. Remove the “Latte Widget”

F. Now try to drag an application icon (like from /usr/share/applications) to the dock. If that does not work, try opening and closing the “Dock/Panel Settings”. It will eventually let you add the application icon (hence why I said it seems like a bug). Once the first application shortcut has been added you can drag more.

Here’s a gif animation of the whole process.

TLDR Instead of MAN

Bash Linux

Here’s a quick way to get quick simplified explanation and usage for commands in Bash with TLDR Pages.

$ tldr tldr
# tldr                                                                            

  Simplified man pages.                                                           

- Get typical usages of a command (hint: this is how you got here!):              

  tldr command       

TLDR pages is community driven and holds common commands for UNIX, Linux, macOS, SunOS and Windows. The amount of commands available is already pretty vast, and users are encouraged to contribute with new pages on their git repo - https://github.com/tldr-pages/tldr.

You can also access a web/live version of tldr on https://tldr.ostera.io/.

Install

Arch

pacman -Sy community/tldr

Other distros:

npm install -g tldr

Snap

sudo snap install tldr

Android

https://play.google.com/store/apps/details?id=io.github.hidroh.tldroid

Quickly Backing Up Files in Bash

Linux bash

Here’s a quick and simple way to backup files in Bash by using Bash’s built-in brace expansion {,}.

Let’s first create a file:

$ ls -l > listing.txt

Now let’s create a backup:

$ cp listing.txt{,.bak}

And the result is a new file with the .bak extension:

$ ls -l listing*
Permissions Size User   Group Date Modified Name
.rw-r--r--  2.5k victor users 15 Oct 14:21  listing.txt
.rw-r--r--  2.5k victor users 15 Oct 14:21  listing.txt.bak

How about getting fancy and adding a date?

cp listing.txt{,.$(date +%Y%m%d_%H%M)}

And the result:

$ ls -l listing.tx*
Permissions Size User   Group Date Modified Name
.rw-r--r--  2.5k victor users 15 Oct 14:21  listing.txt
.rw-r--r--  2.5k victor users 15 Oct 14:21  listing.txt.bak
.rw-r--r--  2.5k victor users 15 Oct 14:23  listing.txt.20181015_1423

Editing Multiple Lines in Vim

Bash Linux Vim

A simple way of to edit (like commenting or uncommenting) a block of lines/code in Vim.

The example below explains how to comment multiple lines:

  • Place the cursor on the first line that you’d like to edit
  • Press Ctrl+v
  • User the arrow keys to go down until the last line
  • Press Shift+i to go into insert mode
  • Press #
  • Press Esc and wait a second

Special Characters and Symbols in Bash

Bash Linux

Character Recognition

Shapecatcher

You can use Shapecatcher to draw a character and try to recognize it.

Other usefull sites are &what and Unicode® character table.

In Bash

If you can paste the character in Bash, you can dump the character in hex with hexdump

$ echo "✰" | hexdump -C
00000000  e2 9c b0 0a                                       |....|
00000004

Use the hex value to recreate the character:

$ echo -e "\xe2\x9c\xb0"
✰
code with