tunnckoCore / x-dotfiles

Maintained, latest as of Q4 2018. Much updates compared to the `arckos` repo.
MIT License
1 stars 0 forks source link

August 07, 2021, i3 config #5

Open tunnckoCore opened 3 years ago

tunnckoCore commented 3 years ago
# August 07, 2021
# Latest and greatest

# Constants
set $alt      Mod1
set $mod      Mod4
set $win      Mod4
set $super    Mod4
set $shift    Shift
set $ctrl     Control
set $esc      Escape
set $del      Delete
set $ret      Return
set $return   Return
set $enter    Return
set $tab      Tab
set $prnt     Print
set $exec     exec --no-startup-id
set $cfg      /home/charlike/.config/i3/config
set $cfg_blk  /home/charlike/.config/i3/blocks/config

# Theme colors
set $base00 "#101218"
set $base01 "#1f222d"
# atom material: set $base01 "#222D32"
set $base02 "#252936"
set $base03 "#7780a1"
set $base04 "#D5D5D5"
set $base05 "#d1d4e0"
set $base06 "#C9CCDB"
set $base07 "#ffffff"
set $base08 "#ee829f"
set $base09 "#f99170"
set $base10 "#ffefcc"
set $base11 "#a5ffe1"
set $base12 "#97e0ff"
set $base13 "#97bbf7"
set $base14 "#c0b7f9"
set $base15 "#fcc09e"

# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
#  - btc
#  - downloads
#  - tasks
#  - mail

# Workspaces
set $ws1    "1:  web "
set $ws2    "2:  term "
set $ws3    "3:  dev "
set $ws4    "4:  chat "
set $ws5    "5:  htop "
set $ws6    "6:  home "
set $ws7    "7:  mail "
set $ws8    "8:  "
set $ws9    "9:  "
set $ws0   "10:  desk "

# switch to workspace
bindsym $super+1 workspace number $ws1
bindsym $super+2 workspace number $ws2
bindsym $super+3 workspace number $ws3
bindsym $super+4 workspace number $ws4
bindsym $super+5 workspace number $ws5
bindsym $super+6 workspace number $ws6
bindsym $super+7 workspace number $ws7
bindsym $super+8 workspace number $ws8
bindsym $super+9 workspace number $ws9
bindsym $super+0 workspace number $ws0

# move focused container to workspace
bindsym $super+$shift+1 move container to workspace number $ws1
bindsym $super+$shift+2 move container to workspace number $ws2
bindsym $super+$shift+3 move container to workspace number $ws3
bindsym $super+$shift+4 move container to workspace number $ws4
bindsym $super+$shift+5 move container to workspace number $ws5
bindsym $super+$shift+6 move container to workspace number $ws6
bindsym $super+$shift+7 move container to workspace number $ws7
bindsym $super+$shift+8 move container to workspace number $ws8
bindsym $super+$shift+9 move container to workspace number $ws9
bindsym $super+$shift+0 move container to workspace number $ws0

# Config stuff
bindsym $super+$shift+c reload
bindsym $super+$shift+r restart
bindsym $super+$shift+e $exec leafpad $cfg

# Options configuration
font pango:         "Noto Sans 14"
floating_modifier       $super
focus_follows_mouse     no
hide_edge_borders       both
popup_during_fullscreen     smart
new_window          none
workspace_auto_back_and_forth   yes

# hide/unhide i3status bar
bindsym $super+m bar mode toggle

# Easier ergonomics
bindsym $super+$tab         workspace back_and_forth
bindsym $alt+$tab       workspace back_and_forth

# Volume Control with Alsa Mixer
# requires: alsa-lib alsa-utils
# Check with: speaker-test -c2)
bindsym $super+z exec amixer -q set Master 5%+ unmute
bindsym $super+x exec amixer -q set Master toggle
bindsym $super+c exec amixer -q set Master 5%- unmute

# Default workspaces
assign [class="(Navigator|firefox)"] $ws1
assign [class="Xfce4-terminal" instance="xfce4-terminal" title="^Terminal 1"] $ws2
assign [class="Code"] $ws3
assign [class="Pcmanfm" title="charlike"] $ws6
assign [class="Xfce4-terminal" title="htop"] $ws7

# Open specific applications in floating mode
# hint: use `xprop` and search for `WM_CLASS`
for_window [class="^.*"] border pixel 1
for_window [class="[.]*"] floating enable
for_window [class="Xfce4-terminal" instance="xfce4-terminal" title="^Terminal 1"] floating disable
for_window [class="URxvt"] floating disable
for_window [title="alsamixer"] floating enable border pixel 1
for_window [class="calamares"] floating enable border normal
for_window [class="(Navigator|firefox)"] floating disable
for_window [class="Firefox"] floating enable
for_window [class="(Pcmanfm|pcmanfm)" title="charlike"] floating disable
for_window [title="File Transfer*"] floating enable
for_window [title="^sysinxi-*"] floating enable

# force floating dialogs and popup windows
for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [window_role="Preferences"] floating enable
for_window [window_role="About"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable

# System Mode bindings
set $sysmenu "  System: [l]ock  [r]eboot  l[o]gout  [s]uspend  [h]ibernate  [p]oweroff"
bindsym $super+s     mode $sysmenu
mode $sysmenu {
    bindsym l $exec i3exit lock, mode "default"
    bindsym r $exec i3exit reboot, mode "default"
    bindsym o $exec i3exit logout, mode "default"
    bindsym s $exec i3exit suspend, mode "default"
    bindsym h $exec i3exit hibernate, mode "default"
    bindsym p $exec i3exit shutdown, mode "default"

    # exit system mode
    bindsym $super+s mode "default"
    bindsym $super+q mode "default"
    bindsym $esc mode "default"
    bindsym q mode "default"
}

# System bindings
bindsym $super+$shift+l     $exec i3exit lock
bindsym $super+$shift+s     $exec i3exit suspend
bindsym $super+$shift+h     $exec i3exit hibernate
bindsym $ctrl+$alt+$del     $exec i3exit reboot

# Easy quitting/killing
bindsym $super+$shift+$del  exec pkill X
bindsym $ctrl+q         kill
bindsym $ctrl+$shift+q      kill
bindsym $super+q        kill
bindsym $super+$shift+q     kill
bindsym $super+$shift+x --release $exec xkill

# System Mode bindings
set $sysinfo "  Info: [s]ensors  [g]raphics  [a]udio  [n]etwork [p]artitions cp[u] [i]nfo [f]ull"
bindsym $super+i     mode $sysinfo
mode $sysinfo {
    bindsym s exec alacritty --hold --title 'sysinxi-sensors'   -e inxi -Ss
    bindsym g exec alacritty --hold --title 'sysinxi-graphics'  -e inxi -SG
    bindsym a exec alacritty --hold --title 'sysinxi-audio'     -e inxi -SA
    bindsym n exec alacritty --hold --title 'sysinxi-network'   -e inxi -SN
    bindsym p exec alacritty --hold --title 'sysinxi-partnswap  -e inxi -SP --swap
    bindsym u exec alacritty --hold --title 'sysinxi-cpu'       -e inxi -SC
    bindsym i exec alacritty --hold --title 'sysinxi-info'      -e inxi -SI
    bindsym f exec alacritty --hold --title 'sysinxi-full'      -e ~/.local/bin/sysinxi-full

    # exit system mode
    bindsym $super+i mode "default"
    bindsym $super+q mode "default"
    bindsym $esc mode "default"
    bindsym q mode "default"
}

bindsym $super+$shift+i exec alacritty --hold --title 'sysinxi-full' -e ~/.local/bin/sysinxi-full

# TODO CACHE WEATHER on disk (for 3 hours?)
bindsym $super+$shift+w exec alacritty --hold --title 'sysinxi-weather' -e ~/.local/bin/sysinxi-weather

# Night Mode (aur: redshift-minimal, optional config at ~/.config/redshift/redshift.conf)
# see https://github.com/jonls/redshift
# 'nightmode' is at ~/.local/bin/nightmode
# and is a function: redshift -l "42.6977:23.3218" -t "7000:${1:-4000}" -b "1:0.6" > /dev/null 2>&1 &
#
# default follows the day/night
# (only once, on startx)
exec /home/charlike/.local/bin/nightmode

# on every i3 reload/restart (e.g. mod+shift+r)
#exec_always /home/charlike/.local/bin/nightmode

# allow manually "turn off"
bindsym $super+$shift+m exec pkill redshift

# allow manually "turn on"
bindsym $super+$shift+n exec /home/charlike/.local/bin/nightmode

# Full screens
bindsym F11         fullscreen toggle
bindsym $super+$shift+a     fullscreen toggle

# Handle floating
bindsym $super+$shift+f     floating toggle
bindsym $alt+$shift+f       floating toggle

# Screenshoting
set $scrt scrot '%Y-%m-%d-%T_$wx$h_scrot.png' -e 'mv $f ~/Pictures/Screenshots/'

bindsym --release $prnt     $exec $scrt     # fullscreen
bindsym --release $super+$prnt  $exec $scrt -u  # current window
bindsym --release $super+p  $exec $scrt -s  # select area

# i3blocks: keyindicator for CapsLock and NumLock
bindsym --release Caps_Lock    exec pkill -SIGRTMIN+11 i3blocks
bindsym --release Num_Lock     exec pkill -SIGRTMIN+11 i3blocks

# Programs
bindsym $super+b        exec firefox
bindsym $super+h        exec pcmanfm ~/
bindsym $super+d    exec dmenu_run -b -nb "#1f222d" -sb "#D5D5D5" -sf "#1f222d" -fn "Noto Sans-12" -h 30 -x 170 -y 1 -w 600
bindsym $super+t    exec xfce4-terminal --title="Terminal X"
bindsym $super+f  exec cd_with_fzf

# Window and bar Colors
#                          border   background  text        indicator
client.focused             $base01  $base01     $base07     $base15
client.focused_inactive    $base02  $base02     $base04     $base15
client.unfocused           $base02  $base02     $base04     $base15
client.urgent              $base02  $base08     $base00     $base15

bar {
    position bottom
    tray_padding 5
    font pango: Noto Sans 14
    strip_workspace_numbers yes
    #i3bar_command i3bar
    #status_command i3status
    status_command i3blocks -c $cfg_blk
    colors {
        separator   $base03
        background  $base01
        statusline  $base05
        #                       border      background  text
        # focused_workspace     $base01     $base01     $base07
        focused_workspace       $base04     $base04     $base01
        active_workspace        $base01     $base02     $base04
        inactive_workspace      $base01     $base01     $base04
        #urgent_workspace       $base01     $base01     $base08
        urgent_workspace    #FF3D00     #FF3D00     $base04
    }
}

# Auto startups

$exec xset r rate 300 25
$exec numlockx on
# aur: compton-old-git
exec_always compton -bf -D 2
#exec_always --no-startup-id picom -i 1 -o 1 -m 1 -f
exec_always --no-startup-id nitrogen --restore
# exec_always --no-startup-id feh --no-fehbg --bg-fill /home/charlike/Downloads/dracula-base-wallpaper.png
# exec_always --no-startup-id udiskie -a -2 -N -s

$exec xfce4-terminal --title="Terminal 1"

# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
$exec xss-lock --transfer-sleep-lock -- i3lock-fancy --nofork

# Layouts [us,bg,bg], toggle it with alt+shift
exec_always --no-startup-id setxkbmap -layout "us,bg(phonetic)" -option "grp:alt_shift_toggle"

# Remap Esc to CapsLock (esc key still works)
exec_always --no-startup-id setxkbmap -layout "us,bg(phonetic)" -option caps:escape
tunnckoCore commented 3 years ago
firefox keychain alsi pcmanfm xfce4-terminal inxi alacritty i3exit redshift-minimal scrot dmenu i3blocks compton-old nitrogen numlockx udiskie xss-lock i3lock-fancy
tunnckoCore commented 3 years ago

https://grabski.me/posts/2020/07/how-to-properly-setup-secure-dns/ https://github.com/NeQuissimus/DevSetup https://blog.gtank.cc/modern-alternatives-to-pgp/ https://blog.filippo.io/giving-up-on-long-term-pgp/ https://github.com/DNSCrypt/dnscrypt-proxy/wiki/Anonymized-DNS https://deltahub.io/collections/all-products/products/minimalistic-desk-pad?ref=ThisIsE https://www.youtube.com/watch?v=IUM-2cvJYHY https://twitter.com/CroissantEth/status/1424887931395772419 https://www.youtube.com/watch?v=mPsP1AaR7-k - ikea desk setup, table top, alex drawers, samsung m7, pebble Speakers