DEV Community

Shrihari Mohan
Shrihari Mohan

Posted on • Updated on

Things I changed in Ubuntu for productivity and improvements

1. Changing Left Alt / Left Ctrl

I extensively used Windows / Ubuntu / MacOS. One thing I found out very useful was the command key and I have small fingers I can't extend that much. So I just swtiched the Left Ctrl / Left Alt which I think is the most optimal for developers.

To swap the Left Ctrl / Left Alt

sudo apt-get install gnome-tweak-tool 
Enter fullscreen mode Exit fullscreen mode

Then open the Tweaks
Keyboard & mouse -> Additional Layout Options -> Ctrl Position where we will find the option to swap
Swap LCtrl and LAlt

2. Using Terminator instead of Gnome Terminal

I love the terminal in ubuntu but customizing them takes some time. I simply need the split window option to see several terminals at the same time. Terminator just does that insanely good

To install Terminator

sudo apt install terminator
Enter fullscreen mode Exit fullscreen mode

and on a single right click on the terminator lets you split windows like this.
Terminator split window

3. Adding git branch name on terminals

Having the role of web development I always use terminals for generally using git. Having to know which branch we're working on the terminal is the cool addition. You can see the red color text saying Master in the image.

Git branch name on terminals

How to add git branch names on terminal

Add these lines in your ~/.bashrc file. More information on this Forum

# Show git branch name
force_color_prompt=yes
color_prompt=yes
parse_git_branch() {
 git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
else
 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '
fi
unset color_prompt force_color_prompt
Enter fullscreen mode Exit fullscreen mode

Or In a simple way just add oh my zsh for your terminal
For that you have to install zsh then oh my zsh!

sudo apt install zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Enter fullscreen mode Exit fullscreen mode

Just say yes to use zsh as our default terminal and you are good to go! More details on Oh my Zsh

Thanks to @jankapunkt for letting me know about zsh in ubuntu!

4. Having a Swap space to avoid app crashes

Even though my laptop ram is 8 GB its not enough when I am running like 3 servers locally and had to utilize the internal SSD to behave similar to ram. Thats called a swap , if you haven't set up swap when installing the OS , you can set up now through terminal.

I am having a Swap space of 12 GB .. make sure you use around atleast 3 GB.
To add a swap space follow this article and make sure you add atleast 3 GB

Just have to change the unit 1G to 3G or 6G or 12G

5. Scroll through various gnome extensions.

I have clipboard history Which shows me previously copied texts.

You can just spend some 5 mins and install the things you need that can be pretty useful.


If you like this of content follow me @shrihari which will motivate to write more - Peace 🕊


Try Our new product for free!

DocsAI - Create AI support agents with your documents in the most affordable price, starts at 0$. Don't need a bot , but need ai help on your docs just upload and start chating !

Using for a company ? Check out our pricing Just contact me for personalized pricing !

docsAi


More Free articles from me

Top comments (8)

Collapse
 
netch80 profile image
Valentin Nechayev

There is a thing github.com/nojhan/liquidprompt which adds (to bash or zsh) much details like branch, action status (e.g. in rebasing), count of changed files, etc.
I turn it on sometimes when in a complex task.
For swap space, well, old recommendations to have it at least 1*RAM, better - 2*RAM, are still crucial. Linux is extremely bad in memory handling policy (so do other Unixes, unfortunately).

Collapse
 
moopet profile image
Ben Sinclair

Changing Left Alt / Left Ctrl

I think this is going to depend on what keyboard you're using :) But for a lot of people, I hear changing capslock to ctrl is a goood choice. I don't do this myself because I use that key as esc instead.

Collapse
 
shrihari profile image
Shrihari Mohan

Good to see the varieties other people use , I thought I am weird switching up keys. But it's just whatever works for you 😉.

Collapse
 
roalz profile image
Roal Zanazzi

If you prefer to use bash, there's also "Oh my bash": ohmybash.nntoan.com/

Collapse
 
shrihari profile image
Shrihari Mohan

Just went through their site and found this . felt funny thats why sharing that here

If you heard about Oh-My-Zsh before, this project is a shameless fork of that one, but in "Bourne Again Shell"

Collapse
 
jankapunkt profile image
Jan Küster

Installing zsh and oh-my-zsh also makes working with the cli so much easier

Collapse
 
shrihari profile image
Shrihari Mohan

Updated the post with zsh!

Collapse
 
shrihari profile image
Shrihari Mohan

I never knew oh my zsh existed in ubuntu .. I have it on my Mac with FIG . Thanks for letting me know , I will update my post soon.