dotfiles

Cross platform dotfiles for linux, mac and windows
git clone git@getsh.org:dotfiles.git
Log | Files | Refs

commit e103ceabe8edc61f2ce3012d9c42e0456d82b62c
parent 3add155397edd3aae9fc44af897af94e5e0458ba
Author: Bharatvaj <bharatvaj@yahoo.com>
Date:   Wed, 16 Feb 2022 02:45:39 +0530

Handle dependencies carefully in xinitrc

Everything is checked and then launched xinitrc, can be convenient in new
environments.

Use hjkl instead jkl; in i3. Use alacritty as the terminal emulator for i3.

Use `type` instead of `which` in the mich function (refactor the name later).

Diffstat:
M.config/X11/xinitrc | 18+++++++++++++++---
M.config/i3/config | 36+++++++++++++++---------------------
M.profile | 4++--
3 files changed, 32 insertions(+), 26 deletions(-)

diff --git a/.config/X11/xinitrc b/.config/X11/xinitrc @@ -1,3 +1,15 @@ -exec i3 & -exec hsetroot -solid "#000000" & -exec compton +#!/bin/sh + +__type() { + type "$@" >/dev/null 2>/dev/null +} + +__type i3 || (echo "i3 not found" && exit 1) + +__type setxkbmap && setxkbmap -option caps:escape +__type xbmap && xbmap +__type xrdb && xrdb merge ~/.config/X11/Xresources +__type hsetroot && exec hsetroot -solid "#000000" & +__type compton && exec compton & + +exec i3 diff --git a/.config/i3/config b/.config/i3/config @@ -30,8 +30,7 @@ font pango:monospace 8 floating_modifier $mod # start a terminal -bindsym $mod+Return exec --no-startup-id urxvt -name floating -for_window [class="URxvt" instance="floating"] floating enable +bindsym $mod+Return exec --no-startup-id alacritty # kill focused window bindsym $mod+Shift+q kill @@ -45,10 +44,10 @@ bindsym $mod+n exec sh ~/.config/i3/dmenu_search.sh # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop # change focus -bindsym $mod+j focus left -bindsym $mod+k focus down -bindsym $mod+l focus up -bindsym $mod+semicolon focus right +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right # alternatively, you can use the cursor keys: bindsym $mod+Left focus left @@ -57,10 +56,10 @@ bindsym $mod+Up focus up bindsym $mod+Right focus right # move focused window -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+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right # alternatively, you can use the cursor keys: bindsym $mod+Shift+Left move left @@ -69,7 +68,7 @@ bindsym $mod+Shift+Up move up bindsym $mod+Shift+Right move right # split in horizontal orientation -bindsym $mod+h split h +bindsym $mod+s split h # split in vertical orientation bindsym $mod+v split v @@ -78,7 +77,7 @@ bindsym $mod+v split v bindsym $mod+f fullscreen toggle # change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking +bindsym $mod+semicolon layout stacking bindsym $mod+w layout tabbed bindsym $mod+e layout toggle split @@ -133,10 +132,10 @@ mode "resize" { # 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 + bindsym h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l 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 @@ -156,9 +155,4 @@ client.focused #f5f5f5 #f5f5f5 #000000 #f5f5f5 new_window 1pixel bar { - status_command i3status } - -#force floating for all windows -for_window [class="[.]*"] floating enable -for_window [window_role="pop-up"] floating enable diff --git a/.profile b/.profile @@ -64,9 +64,9 @@ chance() { [ -f "${1}" ] && . "${1}" } +# TODO refactor function name mich() { - # Muted which - which "$@" >/dev/null 2>/dev/null + type "$@" >/dev/null 2>/dev/null } # Setup editor