git Gentoo Portage repos on GitHub

git me! The gentoo repos are on github2, and I've just discovered them.. mysteriously hidden in the World Wide Web ;)

There is a post on the gentoo forums from 2015, re git/github saying:
Although some developers wrongly still recommend plain rsync-update method, you should never do that, since it is fundamentally insecure (emerge-webrsync is signed by a machine key, but still better). 

You should instead start to sync via git (best do that from github, unless you want to break our infra server).

The Monolithic Cabals

A few decades ago, there was a great big flame war called the Monolithic vs Microkernel debate, between Andrew Tanenbaum (minix) and Linus Torvalds (linux). It is said that the debate was won by Linus, and that is why #linux became more popular.

Personally, I am a fan of Microkernels. But I am more a fan of Open Source. I believe that is the sole reason linux became popular, not because people loved a monolithic architecture. Folks embraced it because it was #opensource.

A Digital Beep

When you don't have a Speaker/Bell, or you can't make quite make it sound, and you want a beep!

i3 wm

I've been hearing about i3 Window Manager for a while now, and had been waiting to have a go. I finally did.

i3wm.org
i3 User Guide

All the major advantages are listed on the homepage itself. What I particularly like:
"Don’t be bloated, don’t be fancy (simple borders are the most decoration we want to have)."

For now I am making it my home. I don't need any fancy distracting frills. The only thing I seem to be missing is Alt+Tab, as I keep hitting it. [Update: I got that working. See config below.]

You can have a really beautiful desktop, but how long are you going to look at it, before you open some windows which cover most of your desktop? As for me, I usually have all windows maximised on my smallish screen.

i3 has three layouts - split ($mod+e), stacking ($mod+s), and tabbed ($mod+w). I particularly like the tabbed layout maximising screen estate use on small laptop screen. (Auto)Hide the statusbar, and or full-screen ($mod+f) your windows.

$mod+Enter will open a new terminal window in your chosen layout. You can change layouts anytime.
$mod+Shift+q will close your active window.
$mod+Shift+e will exit i3.

Armed with this basic knowledge, we can start exploring i3.

It is a very simple install - three packages - i3 + i3status and dmenu.

On first run, i3 will prompt you and create it's config in ~/.config/i3/config.

Below are my config files.

$ cat ~/.xinitrc
#!/bin/sh
setxkbmap -option terminate:ctrl_alt_bksp
exec i3

$ cat ~/.config/i3/config
set $mod Mod4

#font pango:monospace 8
#font pango:DejaVu Sans Mono 8
font pango:DejaVu Sans, FontAwesome 8

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"

bindsym $mod+Shift+q kill
bindsym $mod+Return exec i3-sensible-terminal

#bindsym $mod+d exec dmenu_run
bindsym $mod+d exec --no-startup-id i3-dmenu-desktop

bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right

bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right

bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

bindsym $mod+h split h
bindsym $mod+v split v

bindsym $mod+f fullscreen toggle

bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

# toggle tiling / floating
bindsym $mod+Shift+space floating toggle

# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

# focus the parent container
bindsym $mod+a focus parent

# focus the child container
#bindsym $mod+d focus child

set $workspace1 "1  "
set $workspace2 "2  "
set $workspace3 "3  "
set $workspace4 "4  "
set $workspace5 "5  "
set $workspace6 "6  "
set $workspace7 "7  "
set $workspace8 "8  "
set $workspace9 "9  "
set $workspace10 "10  "

assign [class="Geany"]  $workspace1
assign [class="Sylpheed"] $workspace2
assign [class="Opera"]  $workspace3
assign [class="QupZilla"] $workspace4
assign [class="Firefox"]  $workspace4
assign [class="mpv"]  $workspace9
assign [class="Spotify"] $workspace10

new_window none  #borders none
workspace_layout default #default|tabbed|stacking|splitv|splith
#force_display_urgency_hint 2000

for_window [class="mpv"] workspace $workspace9, floating enable, focus
#for_window [class="Spotify"] workspace $workspace10
for_window [class="Gimp"] floating enable
for_window [class="Uzbl-core"] focus child, layout tabbed, focus

bindsym $mod+1 workspace $workspace1, layout splith;
bindsym $mod+2 workspace $workspace2
bindsym $mod+3 workspace $workspace3
bindsym $mod+4 workspace $workspace4, layout tabbed;
bindsym $mod+5 workspace $workspace5
bindsym $mod+6 workspace $workspace6
bindsym $mod+7 workspace $workspace7
bindsym $mod+8 workspace $workspace8
bindsym $mod+9 workspace $workspace9, layout floating;
bindsym $mod+0 workspace $workspace10

bindsym $mod+Shift+1 move container to workspace $workspace1
bindsym $mod+Shift+2 move container to workspace $workspace2
bindsym $mod+Shift+3 move container to workspace $workspace3
bindsym $mod+Shift+4 move container to workspace $workspace4
bindsym $mod+Shift+5 move container to workspace $workspace5
bindsym $mod+Shift+6 move container to workspace $workspace6
bindsym $mod+Shift+7 move container to workspace $workspace7
bindsym $mod+Shift+8 move container to workspace $workspace8
bindsym $mod+Shift+9 move container to workspace $workspace9
bindsym $mod+Shift+0 move container to workspace $workspace10

# resize window (you can also use the mouse for that)
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode

        # Pressing left will shrink the window’s width.
        # Pressing right will grow the window’s width.
        # Pressing up will shrink the window’s height.
        # Pressing down will grow the window’s height.
        bindsym j resize shrink width 10 px or 10 ppt
        bindsym k resize grow height 10 px or 10 ppt
        bindsym l resize shrink height 10 px or 10 ppt
        bindsym semicolon resize grow width 10 px or 10 ppt

        # same bindings, but for the arrow keys
        bindsym Left resize shrink width 10 px or 10 ppt
        bindsym Down resize grow height 10 px or 10 ppt
        bindsym Up resize shrink height 10 px or 10 ppt
        bindsym Right resize grow width 10 px or 10 ppt

        # back to normal: Enter or Escape
        bindsym Return mode "default"
        bindsym Escape mode "default"
}

bindsym $mod+r mode "resize"

bar {
 status_command nice -n19 i3status -c ~/.config/i3/i3status.conf
 position top
 colors {
  statusline #55BB55
 }
}

hide_edge_borders both
workspace_auto_back_and_forth yes

## http://slackword.net/?p=657
#bindsym $mod+z workspace back_and_forth
#bindsym $mod+Shift+z move container to workspace back_and_forth
#bindsym $mod+Shift+z move container to workspace back_and_forth; workspace back_and_forth

bindsym $mod+Tab workspace back_and_forth
bindsym $mod+Shift+Tab move container to workspace back_and_forth

bindsym Mod1+Tab workspace back_and_forth
bindsym Mod1+Shift+Tab move container to workspace back_and_forth

bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -q set Master 2+
bindsym XF86AudioLowerVolume exec --no-startup-id amixer -q set Master 2-
bindsym XF86AudioMute exec --no-startup-id amixer -q set Master toggle

bindsym XF86MonBrightnessUp exec xbacklight -inc 20
bindsym XF86MonBrightnessDown exec xbacklight -dec 20

bindsym $mod+b exec --no-startup-id i3-msg border toggle

bindsym $mod+t exec urxvt -e tmuxj
bindsym $mod+g exec geany, workspace $workspace1;
bindsym $mod+m exec sylpheed, workspace $workspace2;
bindsym $mod+o exec opera
#bindsym $mod+o exec opera, workspace $workspace3;
bindsym $mod+q exec qupzilla, workspace $workspace4;
bindsym $mod+Shift+s exec spotify, workspace $workspace10;

## http://faq.i3wm.org/question/1262/exiting-i3-without-mouse-click.1.html
#bindsym $mod+Shift+e exec sh -c '[ $(echo "NO\nYES" | dmenu -sb "#ff6600" -i -p "Really exit i3 X session?") = "YES" ] && i3-msg exit'

exec --no-startup-id "nice -n19 volumeicon"
exec --no-startup-id "nice -n19 wpa_gui -t"
exec --no-startup-id "nice -n19 dunst"
exec urxvt -e tmux

The default i3status config is ~/.config/i3status/config, but I wanted to keep all my i3 stuff together. There's not much there.. just two files.

$ cat ~/.config/i3/i3status
# i3status configuration file.
# see "man i3status" for documentation.

# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!

general {
 output_format = "i3bar"
 colors = true
 interval = 5
 separator = ""
 color_good = "#55bb55"
 color_bad = "#ff0000"
 color_degraded = "#bbbb00"
}

order += "wireless _first_"
#order += "ethernet _first_"
order += "disk /"
#order += "cpu_temperature 0"
order += "cpu_usage"
order += "load"
order += "volume master"
order += "battery 0"
order += "time"

wireless _first_ {
 format_up = " %bitrate %quality  %essid %frequency"
 format_down = ""
}

ethernet _first_ {
 ## %speed requires root privileges
 format_up = "E %ip %speed"
 format_down = "E"
}

disk "/" {
 format = " %avail"
 prefix_type = "custom"
 low_threshold = "1"
 threshold_type = "gbytes_avail"
}

cpu_usage {
 format = " %usage"
}

load {
 format = " %1min"
}

cpu_temperature 0 {
 format = "%degrees °C"
 path = "/sys/devices/platform/coretemp.0/temp1_input"
}

volume master {
 format = " %volume"
 format_muted = " %volume"
 device = "default"
 mixer = "Master"
 mixer_idx = 0
}

battery 0 {
 #format = " %status %percentage %remaining %emptytime %consumption"
 format = " %status %percentage %consumption %remaining"
 format_down = ""
 integer_battery_capacity = "true"
 hide_seconds = true
 status_chr = ""
 status_bat = ""
 status_full = "☻"
 path = "/sys/class/power_supply/BAT%d/uevent"
 low_threshold = 10
 threshold_type = percentage
}

time {
 format = " %b %d %a %R"
}

ref: i3wm Jump Start, by Alex Booker

softvol boost increase alsa volume

One thing I liked with pulseaudio was increasing the volume to more than 100%. Although audiophiles may disagree, I need to increase the volume beyond 100% so I could hear some movies with low sound particularly voice dialogues.

I missed that feature in alsa. It turns out that this is built-in. Not many know about this, and those who do have issues configuring alsa softvol.

After trawling through much www research, this is what works for me. All one needs is a properly configured ~/.asoundrc file.

$ cat ~/.asoundrc
defaults.pcm.!card 0
defaults.pcm.!device 0
defaults.pcm.!ctl 0

pcm.!default {
    type asym
    playback.pcm "plug:softvol"
    capture.pcm "plug:dsnoop"
}
pcm.softvol {
    type softvol
    slave.pcm "dmix"
    control { name "PCM"; card 0; }
    #max_dB 32.0
    max_dB 20.0
    min_dB -5.0
}

Note that this uses PCM as your volume slider. So config your volume hotkeys (or triggers) to manipulate PCM, rather than Master. Set your Master level to 100% or whatever max suitable, and increase/decrease PCM for audio volume.

gentoo portage

ref: http://wiki.gentoo.org/wiki/portage

Gentoo is Portage. Portage is Gentoo.

Getting portage settings right is vitally important. It's not the end of the world, if you don't. But you sure will expend a lot of your time staring at the matrix flowing past, as you compile everything yet again one more time..

dash system & login shell

dash is more efficient than bash in all respects, except perhaps for interactive use. and i always replace system default, root, and login shells to dash.

gentoo second install x86 btrfs debian

Now that my Gentoo Phase 2 has been put on hold for the near future, I have to satisfy this itch to install gentoo on my main laptop. Having it on my primary rig, would allow me to use it more often than pulling out my backup system.

My blind first attempt, at a gentoo install, gave me a lot of confidence in the gentoo community. This second attempt substantially lessens the time/aggro I spent previously installing gentoo.

gentoo phase 2

My first attempt boosted confidence in gentoo (and it's community) beyond expectation. So much that the debian to gentoo transition continues to gather pace.

In all my systems, I have always replaced the full fledged (bloatware?) tools with minimal busybox, wherever I could. Busybox is stable, and fulfils all my requirements rather nicely. This led me to voidlinux which has that same ethos in it's core. It is a great booster that gentoo could satisfy me on this count too.

most viewed