updates for i3

This commit is contained in:
Tyler Starr 2022-12-06 16:16:59 -08:00
parent dbe96d48d8
commit 6e1e0ea1da
13 changed files with 369 additions and 2 deletions

View File

@ -17,3 +17,6 @@ export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export PATH="$HOME/.nimble/bin:$PATH"
alias spl="tmux_splat"
. "$HOME/.cargo/env"

110
.config/i3/config Normal file
View File

@ -0,0 +1,110 @@
# i3 config file (v4)
#-------------------------------------------------------------------------------
#----- VARIABLES
#-------------------------------------------------------------------------------
set $HOME /home/tstarr
set $DISPLAY_DEV_1 HDMI-0
set $DISPLAY_DEV_2 DP-4
set $DISPLAY_MODE 1
set $BOR_WIDTH 2
set $GAP_INNER 2
set $GAP_NULL 0
#-------------------------------------------------------------------------------
#----- COLORS
#-------------------------------------------------------------------------------
set $CL_PRI #17917A
set $CL_SCR #191C25
set $CL_BLK #282828
set $CL_TXT #FFFFFF
set $CL_URG #900000
#-------------------------------------------------------------------------------
#----- MISC. CONFIGURATION
#-------------------------------------------------------------------------------
font pango:Google Noto 8.5
#focus_follows_mouse no
#floating_maximum_size 800x600
#for_window [class="^.*"] border pixel $BOR_WIDTH
#-------------------------------------------------------------------------------
#----- WINDOW DECORATION
#-------------------------------------------------------------------------------
# CLASS BORDER BACKGR. TEXT INDICATOR CHILD_BORDER
client.focused $CL_PRI $CL_PRI $CL_TXT $CL_PRI $CL_PRI
client.focused_inactive $CL_SCR $CL_BLK $CL_PRI $CL_SCR $CL_SCR
client.unfocused $CL_SCR $CL_BLK $CL_TXT $CL_SCR $CL_SCR
client.urgent $CL_PRI $CL_URG $CL_TXT $CL_PRI $CL_PRI
client.placeholder $CL_BLK $CL_SCR $CL_TXT $CL_SCR $CL_SCR
client.background $CL_BLK
#-------------------------------------------------------------------------------
#----- BINDING WORKSPACE TO DISPLAY
#-------------------------------------------------------------------------------
workspace "1" output $DISPLAY_DEV_1
workspace "2" output $DISPLAY_DEV_2
workspace "3" output $DISPLAY_DEV_1
workspace "4" output $DISPLAY_DEV_1
workspace "5" output $DISPLAY_DEV_1
workspace "6" output $DISPLAY_DEV_1
workspace "7" output $DISPLAY_DEV_1
workspace "8" output $DISPLAY_DEV_1
workspace "9" output $DISPLAY_DEV_1
workspace "0" output $DISPLAY_DEV_1
#-------------------------------------------------------------------------------
#----- CONTAINER GAPS
#-------------------------------------------------------------------------------
# CREATING GAPS BETWEEN THE WINDOWS AND EDGES
gaps inner $GAP_INNER
gaps outer 0
gaps horizontal 0
gaps vertical 0
gaps top 0
gaps bottom 0
gaps right 0
gaps left 0
# WORKSPACE-SPECIFIC GAP
#workspace "5" gaps top $GAP_NULL
#workspace "6" gaps top $GAP_NULL
#workspace "7" gaps top $GAP_NULL
#workspace "8" gaps top $GAP_NULL
#-------------------------------------------------------------------------------
#----- FORCE FLOATING
#-------------------------------------------------------------------------------
for_window [title="Steam - News"] floating enable
for_window [title="Friends List"] floating enable
for_window [title="Kazam"] floating enable
for_window [title="Settings"] floating enable
#-------------------------------------------------------------------------------
#----- BINDING APPLICATIONS TO WORKSPACE
#-------------------------------------------------------------------------------
assign [class="yakyak"] "10"
assign [class="zoom"] "9"
assign [class="Steam"] "9"
for_window [class="Steam"] move container to workspace "9"
#-------------------------------------------------------------------------------
#----- AUTOSTART WITH I3
#-------------------------------------------------------------------------------
exec --no-startup-id $HOME/.config/sxhkd/launch.sh
#-------------------------------------------------------------------------------
bar {
status_command i3status
}

@ -0,0 +1 @@
Subproject commit e7881e1d77eae5db69daaef760e8a39112ca9b46

4
.config/swhkd/launch.sh Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
killall sxhkd
sxhkd -c /home/tstarr/.config/sxhkd/sxhkdrc

71
.config/swhkd/sxhkdrc Normal file
View File

@ -0,0 +1,71 @@
#------------------------------------------------------------------------------
#----- WINDOW LAYOUT
#------------------------------------------------------------------------------
super + shift + r
i3-msg restart
super + shift + q
i3-msg exit
super + q
i3-msg kill
super + i; {q,w,e,r}
i3-msg layout {splith, tabbed, stacked, splitv}
super + f
i3-msg fullscreen toggle
super + t
i3-msg floating toggle
super + shift + t
i3-msg sticky toggle
super + Tab
i3-msg focus mode_toggle
#------------------------------------------------------------------------------
#----- WINDOW CHANGE FOCUS
#------------------------------------------------------------------------------
super + {h,j,k,l}
i3-msg focus {left,down,up,right}
super + {1-9,0}
i3-msg workspace {1-9,10}
super + space
i3-msg focus output right
super + b
i3-msg workspace back_and_forth
#------------------------------------------------------------------------------
#----- WINDOW MOVEMENT
#------------------------------------------------------------------------------
super + shift + {h,j,k,l}
i3-msg move {left,down,up,right}
super + shift + {1-9,0}
i3-msg move container to workspace {1-9,10}
#------------------------------------------------------------------------------
#----- LAUNCH APPLICATIONS
#------------------------------------------------------------------------------
super + shift + w
rofi -show drun -theme gruvbox-dark-soft -show-icons
super + w
rofi -show window -theme gruvbox-dark-soft -show-icons
super + Return
alacritty
super + o; b
firefox

File diff suppressed because one or more lines are too long

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule ".config/i3/scripts/i3-wk-switch"]
path = .config/i3/scripts/i3-wk-switch
url = https://github.com/tmfink/i3-wk-switch.git

87
.tmux.conf Normal file
View File

@ -0,0 +1,87 @@
# vim style tmux config
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
# vi is good
setw -g mode-keys vi
# mouse behavior
setw -g mouse on
set-option -g default-terminal screen-256color
bind-key : command-prompt
bind-key r refresh-client
bind-key L clear-history
bind-key space next-window
bind-key bspace previous-window
bind-key enter next-layout
# use vim-like keys for splits and windows
bind-key v split-window -h
bind-key s split-window -v
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n 'C-\' run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys 'C-\\') || tmux select-pane -l"
bind C-l send-keys 'C-l'
bind-key C-o rotate-window
bind-key + select-layout main-horizontal
bind-key = select-layout main-vertical
set-window-option -g other-pane-height 25
set-window-option -g other-pane-width 80
set-window-option -g display-panes-time 1500
set-window-option -g window-status-current-style fg=magenta
bind-key a last-pane
bind-key w display-panes
bind-key q kill-session
bind-key c new-window
bind-key t next-window
bind-key T previous-window
bind-key [ copy-mode
bind-key ] paste-buffer
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Status Bar
set-option -g status-interval 1
set-option -g status-style bg=black
set-option -g status-style fg=white
set -g status-left '#[fg=green]#H #[default]'
set -g status-right '%a%l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d'
set-option -g pane-active-border-style fg=yellow
set-option -g pane-border-style fg=cyan
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
# Allow the arrow key to be used immediately after changing windows
set-option -g repeat-time 0

17
bin/tmux_dot Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
DIR="~/.dotfiles"
SESSION="Dots"
SESSIONEXISTS=$(tmux list-sessions | grep $SESSION)
if [ "$SESSIONEXISTS" = "" ]
then
tmux new-session -s $SESSION -d
tmux rename-window -t $SESSION:1 'Edit'
tmux send-keys -t 'Edit' "cd ${DIR}" C-m 'nvim' C-m
tmux new-window -t $SESSION:2 -n 'Term'
tmux send-keys -t 'Term' "cd ${DIR}" C-m 'clear' C-m
fi
tmux attach-session -t $SESSION:1

22
bin/tmux_splat Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
FRONT_DIR="~/devel/work/genisys/splat-react"
BACK_DIR="~/devel/work/genisys/splat-python"
SESSION="Splat"
SESSIONEXISTS=$(tmux list-sessions | grep $SESSION)
if [ "$SESSIONEXISTS" = "" ]
then
tmux new-session -s $SESSION -d
tmux rename-window -t $SESSION:1 'Edit'
tmux send-keys -t 'Edit' "cd ${FRONT_DIR}" C-m 'nvim' C-m
tmux new-window -t $SESSION:2 -n 'Term'
tmux send-keys -t 'Term' "cd ${FRONT_DIR}" C-m 'clear' C-m
tmux new-window -t $SESSION:3 -n 'Front'
tmux send-keys -t 'Front' "cd ${FRONT_DIR}" C-m 'npm run dev' C-m
tmux new-window -t $SESSION:4 -n 'Back'
tmux send-keys -t 'Back' "cd ${BACK_DIR}" C-m './start-dev.sh admin' C-m
fi
tmux attach-session -t $SESSION:1

View File

@ -1,7 +1,7 @@
# Ansible Galaxy Roles
roles:
- src: https://github.com/starr-dusT/ansible-role-customize-gnome
- src: https://github.com/starr-dusT/ansible-rustup
collections:
- name: community.general
version: 6.0.1

View File

@ -8,6 +8,10 @@
- btrbk # Backup tool for btrfs subvolumes
- mpv # Movie player playing most video formats and DVDs
- alacritty
- i3-gaps
- sxhkd
- rofi
- python-i3ipc
state: present
become: true
@ -21,3 +25,6 @@
state: present
become: true
# Commented out until keychords are implemented
# - import_tasks: swhkd.yml

View File

@ -0,0 +1,42 @@
- name: Install swhkdi dependencies
block:
- name: Check if cargo is installed
shell: command -v cargo
register: cargo_exists
ignore_errors: yes
- name: Download rustup installer
when: cargo_exists is failed
get_url:
url: https://sh.rustup.rs
dest: "/home/{{ user }}/tmp/sh.rustup.rs"
mode: '0755'
force: 'yes'
tags:
- rust
- name: Install rust/cargo
when: cargo_exists is failed
shell: "/home/{{ user }}/tmp/sh.rustup.rs -y"
- name: Clone swhkd repo
git:
repo: https://github.com/waycrate/swhkd
dest: "/home/{{ user }}/tmp/swhkd"
clone: yes
update: yes
- name: Build swhkd
shell:
cmd: "{{ item }}"
chdir: "/home/{{ user }}/tmp/swhkd"
with_items:
- make setup
- make clean
- make
- name: Install swhkd
shell:
cmd: make install
chdir: "/home/{{ user }}/tmp/swhkd"
become: true