all repos — website @ 9f7b624e57853bcf238e2d274c0c6db9764159db

personal website hosted at prithu.xyz, built using hugo

change title of post and publish
Prithu Goswami prithugoswami524@gmail.com
Fri, 08 May 2020 21:13:33 +0530
commit

9f7b624e57853bcf238e2d274c0c6db9764159db

parent

65d0f7d6ae3df62de74961289d6c3c38438abfa9

M hugo-site/content/posts/custom-development-setup-using-i3-and-vim/index.mdhugo-site/content/posts/custom-development-setup-using-i3-and-vim/index.md

@@ -1,37 +1,38 @@

--- -title: "Custom development setup using i3 and vim" +title: "The joys of configurable programs like vim and i3" date: 2019-12-02T14:15:30+05:30 description: "I go through how i3 and vim can be used to setup a custom workspace for working with NS (network simulator) and Nam (network animator)" tags: - i3 - vim - workflow -draft: false --- -I see extendable software like vim and i3 really good tools to work with. I -think you should have control over how something works in your tool set. Tools -like vim and i3 allow for users to customize the workings in order fit their -needs - this is what makes them so powerful and a joy to use. There are many -instances where one feels the need to tweak their tools so that they could do -things which would make their lives a little more easier. Most of the times -these are small tweaks and this is where prgrams like vim and i3 shine. +I see configurable software like vim and i3 really good tools to work with. I +strongly believe you should have control over how something works in your +toolset. Tools like vim and i3 allow for users to customize their workings in +order fit their needs - this is what makes them so powerful and a joy to use. +There are many instances where one feels the need to tweak their tools so that +they could do things which would make their lives a little more easier. Most of +the times these are small ad-hoc tweaks and this is where programs like vim and +i3 shine. One such instance of being able to tweak something was when I was working with NS (network simulator) and preparing for my Computer Networks Lab exams. NS is -a network simulator and is built as a Tcl framework. It allows you to simlate -networking events like sending TCP traffic or pining a host, etc. A simulation -is run using the `ns <tcl-script>` command. This runs the simmulation and also +a network simulator and is built as a Tcl framework. It allows you to simulate +networking events like sending TCP traffic or pinging a host, etc. A simulation +is run using the `ns <tcl-script>` command. This runs the simulation and also creates a `.nam` file that can be fed to NAM. NAM is a Tcl/TK based animation tool for viewing network simulation traces and real world packet traces. -Now for our labwork we were supposed to make the topography of the network and -run the simulation and to visualize it we were supposed to use NAM. This +Now for our lab work, we were supposed to make the topography of a network and +run the simulation, and to visualize it, we were supposed to use NAM. This becomes a cumbersome task - first, to run the tcl script using the `ns` -command; then, run `nam output.nam`. Now do this everytime you want to see the -changes take effect to the animation. All of this can simply be "automated" +command; then, run `nam output.nam`. Now, do this every time you want to see the +changes take effect to the animation. All of this can simply be "automated". -first I add a small keybind to vim to run `ns` on the tcl script. +First I add a small keybind to vim to run `ns` on the tcl script that is +currently being edited. ``` nnoremap <leader>n:!ns %<Enter>

@@ -67,13 +68,13 @@ again annoying as it messes up my terminal.

{{< figure src="before-configuring.png" title="Before configuring i3" width=90% >}} -Instead of having the main window -tiled I would like it to be floating and to the right side of the screen. As -for the unwanted window, I would like it to be moved out of sight. This is -where I can configure i3 to manage the windows. I can configure i3 such -that the unwanted window is moved to a scratchpad workspace which is -basiclaly just a hidden workspace. And the main window can be moved to the -side of the screen and floating instead of tiling. +Instead of having the main window tiled I would like it to be floating to the +right side of the screen. As for the unwanted window, I would like it to be +moved out of sight. This is where I can configure i3 to manage the windows. I +can configure i3 such that the unwanted window is moved to a scratchpad +workspace which is basically just a hidden workspace. And the main window can +be moved to the side of the screen and floating instead of tiling. The +following lines in the i3 config do the job. ``` for_window [title="Nam Console v1.15"] floating enable move scratchpad

@@ -89,3 +90,6 @@ reisze it to 800x720 and move to position x=560 and y=25 on the screen.

{{< figure src="after-configuring.png" title="After configuring i3" width=90% >}} +This was a small instance where good configurable tools, with a few lines of +configuration (literally three lines in this case) can make a huge impact on +work flow and productivity.
M hugo-site/static/css/blog.csshugo-site/static/css/blog.css

@@ -89,7 +89,7 @@ .post-text{

/* font-family: Roboto, Sans-serif; */ font-family: "Noto Serif"; font-size: 1.2rem; - color: rgba(0, 0, 0, 0.7); + color: rgba(0, 0, 0, 0.8); } .post-text figure h4{