Recently I tried out Manjaro operating system, and did some experiment with XFCE and KDE desktop environments. Here I am going to share some tips and tricks to setup Manjaro in you machine. Now, let us dive in.
Copy bash history to ZSH ︎
Lets say you are using bash for a long time, and now you have installed ZSH. All of a sudden all of your command history is gone, so you want to transfer you bash history to ZSH. You can do that using the following script(copy pasted from this snippet):
import sys import time def main(): timestamp = None for line in sys.stdin.readlines(): line = line.rstrip('\n') if line.startswith('#') and timestamp is None: t = line[1:] if t.isdigit(): timestamp = t continue else: sys.stdout.write(': %s:0;%s\n' % (timestamp or time.time(), line)) timestamp = None if __name__ == '__main__': main()
Usage: you can run like this
$ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history.
Backlight On using terminal ︎
You can turn backlight from command prompt like this:
echo 2 | sudo tee /sys/class/leds/tpacpi::kbd_backlight/brightness
Install visual studio code(VS Code) ︎
install VSCode using the following commands:
git clone https://aur.archlinux.org/visual-studio-code-bin.git cd visual-studio-code-bin makepkg -si
Another way is to use
snap install code --classic to do that.
Wireless headphone muddy sound fix ︎
Wireless headphone setup/fix guide can be found
here. But the most common problem is hearing muddy sound in wireless headphones, its due to lack of
a2dp profile in bluetooth settings. You can do it by:
pacmd set-card-profile card_number a2dp_sink
More information can be found in this section of the Bluetooth Headset Article.
GPG verify key error fix ︎
Sometimes when installing a package using pacman you will face an error GPG signature could not be verified, this means you are missing the required public key to verify that package or subpackage. So install that using:
gpg --search <key> gpg --recv-key <key>
Package managers ︎
There are several ways to install packages through package managers, Like
AUR or build your own packages ︎
AUR is the repository for softwares for ArchLinux. You can install the packages using:
git clone <package> cd <package-dir> makepkg -si // -sic
Pacman is the package manager for Archlinux. Basic usages are:
sudo pacman -S <package> # installing a package sudo pacman -R <package> # uninstalling a package
Here are some packages which can be installed using pacman:
Snaps are containerised software packages that are simple to create and install. It comes built it with Manjaro. Here are some basic usages:
snap install <package> snap remove <package>
Some packages which can be installed by snap:
Bootstrap manjaro setup ︎
Here are some gists containing useful scripts to bootstrap your manjaro setup with necessary packages:
IOS/Android file copy ︎
Manjaro works well with andriod, but for IOS it does not have proper support(as there is no itunes). You can install the following packages to copy files from IOS:
sudo pacman -Syyuu ifuse usbmuxd libplist libimobiledevice
Rows and columns in workspaces ︎
Although KDE has this sorted out, but XFCE has some issues with it(only one row, no columns). You can sort it out by:
xprop -root -f _NET_DESKTOP_LAYOUT 32cccc -set _NET_DESKTOP_LAYOUT 0,2,2,0 xprop -root -f _NET_NUMBER_OF_DESKTOPS 32c -set _NET_NUMBER_OF_DESKTOPS 4
Backup and restore ︎
As Archlinux is kind of bleeding edge thing, so updates might break your system, better to use a backup tool like timeshift.
Copy environment to other machine ︎
You can use Aptik to do that but as its now a paid software, its upto you to decide if you want to use it or not.
Thats it for now. If you have any feedback or suggestion, then please use the comment section below.
Thanks for reading. I will see you in the next article.
Last updated: Dec 03, 2020