Initial commit

This commit is contained in:
Andrew Scott 2021-12-17 23:14:15 -05:00
parent 171d3edd66
commit ac179d9696
Signed by: a
GPG key ID: 3EB62D0BBB8DB381
7 changed files with 546 additions and 0 deletions

View file

@ -7,6 +7,7 @@ git clone https://codeberg.org/acscott/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
# list branches
git branch -a
git branch -l
# checkout desired branch
git checkout <branch>
# update install.sh as needed, then run it

86
Xresources Normal file
View file

@ -0,0 +1,86 @@
! -----------------------------------------------------------------------------
! Based on: gruvbox-dark.xresources
! Description: Retro groove colorscheme generalized
! Source: https://github.com/morhetz/gruvbox-generalized
! -----------------------------------------------------------------------------
! Laptop screen DPI
Xft.dpi: 216
Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb
! hard contrast: *background: #1d2021
! medium contrast: *background: #282828
! soft contrast: *background: #32302f
*background: #1d2021
*foreground: #ebdbb2
! Black + DarkGrey
*color0: #282828
*color8: #928374
! DarkRed + Red
*color1: #cc241d
*color9: #fb4934
! DarkGreen + Green
*color2: #98971a
*color10: #b8bb26
! DarkYellow + Yellow
*color3: #d79921
*color11: #fabd2f
! DarkBlue + Blue
*color4: #458588
*color12: #83a598
! DarkMagenta + Magenta
*color5: #b16286
*color13: #d3869b
! DarkCyan + Cyan
*color6: #689d6a
*color14: #8ec07c
! LightGrey + White
*color7: #a89984
*color15: #ebdbb2
!!! urxvt
URxvt.perl-ext-common: default,matcher
URxvt*buffered: true
URxvt*saveLines: 5000
URxvt*cursorBlink: true
URxvt*borderless: 1
URxvt*internalBorder: 20
URxvt*scrollBar: false
URxvt.url-launcher: /usr/bin/xdg-open
URxvt.matcher.button: 1
URxvt.clipboard.autocopy: true
! do not scroll with output
URxvt*scrollTtyOutput: false
! scroll in relation to buffer (with mouse scroll or Shift+Page Up)
URxvt*scrollWithBuffer: true
! scroll back to the bottom on keypress
URxvt*scrollTtyKeypress: true
! disable scrollback buffer in secondary screen (allows scrolling pager when using 'less' etc)
URxvt.secondaryScreen: 1
URxvt.secondaryScroll: 0
! Disable printing the terminal contents when pressing PrintScreen.
URxvt.print-pipe: "cat > /dev/null"
!! copy/paste
! disable default ctrl-shift binding
URxvt.iso14755: false
URxvt.iso14755_52: false
! disable default copy/paste bindings
URxvt.keysym.Control-Meta-c: builtin-string:
URxvt.keysym.Control-Meta-v: builtin-string:
! new copy/paste bindings
URxvt.keysym.Shift-Control-V: eval:paste_clipboard
URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard
!! font
!URxvt.letterSpace: -1
URxvt.font: xft:Hack:regular:size=12, \
xft:Font Awesome 5 Brands:Regular:size=10, \
xft:Font Awesome 5 Free:Solid:size=10, \
xft:Font Awesome 5 Free:Regular:size=10

54
config/bspwm/bspwmrc Executable file
View file

@ -0,0 +1,54 @@
#!/bin/bash
bspc monitor eDP-1 -d 1 2 3 4 5 6 7 8 9 10
bspc config border_width 2
bspc config window_gap 10
bspc config top_padding 74
bspc config bottom_padding 0
bspc config split_ratio 0.50
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc rule -a Galculator state=floating
bspc rule -a vlc state=floating
bspc rule -a Blueman-manager state=floating
bspc rule -a Bitwarden state=floating
bspc rule -a Leafpad state=floating
bspc rule -a firefox desktop='^1' follow=on
bspc rule -a Brave-browser desktop='^2' follow=on
bspc rule -a Chromium desktop='^2' follow=on
bspc rule -a Evince desktop='4' follow=on
bspc rule -a Soffice desktop='^4' follow=on
bspc rule -a Xsane desktop='^4' follow=on state=floating
bspc rule -a kitty desktop='^6' follow=on
bspc rule -a Konsole desktop='^6' follow=on
bspc rule -a URxvt desktop='^6' follow=on
bspc rule -a Eclipse desktop='^6' follow=on
bspc rule -a Ranger desktop='^3' follow=on
bspc rule -a Thunar desktop='3' follow=on
bspc rule -a Steam desktop='^5' follow=on state=floating
bspc rule -a Lutris desktop='^5' follow=on state=floating
bspc rule -a origin.exe desktop='^5' state=floating
bspc rule -a Emacs desktop='^7' follow=on state=tiled
bspc rule -a jetbrains-pycharm-ce desktop='^7' follow=on
bspc rule -a Clementine desktop='^8' follow=on
bspc rule -a Spotify desktop='^8' follow=on
bspc rule -a Element desktop='^9'
bspc rule -a Mattermost desktop='9'
bspc rule -a Slack desktop='^9'
bspc rule -a tutanota-desktop desktop='^10'
### Focus on 1st workspace by default
bspc desktop -f 1
### Autostart
grep -x sxhkd > /dev/null || sxhkd &
/usr/bin/dunst &
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
xss-lock -n /usr/lib/xsecurelock/dimmer -l -- xsecurelock &
xidlehook --not-when-audio --not-when-fullscreen --timer 120 "xrandr --output eDP-1 --brightness .1" "xrandr --output eDP-1 --brightness 1" --timer 480 "xset s activate" "xrandr --output eDP-1 --brightness 1" &
$HOME/.local/bin/single-polybar-launcher &
sh ~/.fehbg &
dex -ae bspwm &

134
config/polybar/config.ini Normal file
View file

@ -0,0 +1,134 @@
[global/wm]
include-file = ~/.config/polybar/colors.ini
include-file = ~/.config/polybar/modules.ini
include-file = ~/.config/polybar/custom_modules.ini
margin-bottom = 0
margin-top = 0
[bar/one]
monitor = eDP-1
monitor-fallback =
monitor-strict = false
enable-ipc = true
override-redirect = true
bottom = false
fixed-center = true
width = 100%
height = 72
offset-x = 0%
offset-y = 0%
dpi-x = 216
dpi-y = 216
background = ${color.background}
foreground = ${color.foreground}
radius-top = 0.0
radius-bottom = 0.0
line-size = 0
line-color = ${color.background}
border-bottom-size = 0
border-bottom-color = ${color.foreground}
padding = 1
module-margin-left = 1
module-margin-right = 0
seperator =
dim-value = 1.0
locale = en_US.UTF-8
font-0 = Hack:size=10;3
font-1 = Font Awesome 5 Free:style=Solid:size=12;3
font-2 = Font Awesome 5 Free:style=Regular:size=12;3
font-3 = Font Awesome 5 Brands:style=Regular:size=12;3
modules-left = workspaces sep title
modules-center = spotify
modules-right = keyboard sep pulseaudio-control sep battery0 sep date sep powermenu
tray-position = right
tray-detached = false
tray-maxsize = 40
tray-background = ${color.background}
tray-offset-x = 0
tray-offset-y = 0
tray-padding = 0
tray-scale = 1.0
wm-name = bspwm
wm-restack = bspwm
scroll-up = bspwm-desknext
scroll-down = bspwm-deskprev
click-left =
click-middle =
click-right =
;scroll-up = bspc desktop -f prev.local
;scroll-down = bspc desktop -f next.local
double-click-left =
double-click-middle =
double-click-right =
cursor-click =
cursor-scroll =
[bar/two]
monitor = eDP-1
monitor-fallback =
monitor-strict = false
enable-ipc = true
override-redirect = true
bottom = true
fixed-center = true
width = 100%
height = 32
offset-x = 0%
offset-y = 0%
background = ${color.background}
foreground = ${color.foreground}
radius-top = 0.0
radius-bottom = 0.0
line-size = 0
line-color = ${color.background}
border-bottom-size = 0
border-bottom-color = ${color.foreground}
padding = 1
module-margin-left = 1
module-margin-right = 1
seperator =
dim-value = 1.0
locale = en_US.UTF-8
font-0 = Hack:size=10;3
font-1 = Font Awesome 5 Free:style=Solid:size=12;3
font-2 = Font Awesome 5 Free:style=Regular:size=12;3
font-3 = Font Awesome 5 Brands:style=Regular:size=12;3
modules-left = workspaces sep title
modules-center = spotify
modules-right = cpu sep memory sep filesystem
tray-position = none
tray-detached = false
tray-maxsize = 16
tray-background = ${color.background}
tray-offset-x = 0
tray-offset-y = 0
tray-padding = 0
tray-scale = 1.0
wm-name = bspwm
wm-restack = bspwm
scroll-up = bspwm-desknext
scroll-down = bspwm-deskprev
click-left =
click-middle =
click-right =
;scroll-up = bspc desktop -f prev.local
;scroll-down = bspc desktop -f next.local
double-click-left =
double-click-middle =
double-click-right =
cursor-click =
cursor-scroll =
[settings]
throttle-output = 5
throttle-output-for = 10
screenchange-reload = false

180
config/sxhkd/sxhkdrc Normal file
View file

@ -0,0 +1,180 @@
#
# wm independent hotkeys
#
# terminal emulator
super + Return
kitty
# program launcher
super + @space
rofi -dpi 240 -modi drun, run -show drun
# power menu
super + @End
rofi -dpi 240 -show power-menu -modi power-menu:/usr/bin/rofi-power-menu
# make sxhkd reload its configuration files:
super + Escape
pkill -USR1 -x sxhkd
# Show list of open windows
alt + @Tab
rofi -show window
# Lock the screen
ctrl + alt + l
xset s activate
# Screenshot
Print
maim | xclip -selection clipboard -t image/png
alt + Print
maim -s | xclip -selection clipboard -t image/png
shift + Print
maim -i $(xdotool getactivewindow) | xclip -selection clipboard -t image/png
# bspwm hotkeys
#
# quit/restart bspwm
super + alt + {q,r}
bspc {quit,wm -r}
# close and kill
super + {_,shift + }q
bspc node -{c,k}
# alternate between the tiled and monocle layout
super + m
bspc desktop -l next
# send the newest marked node to the newest preselected node
super + y
bspc node newest.marked.local -n newest.!automatic.local
# swap the current node and the biggest window
super + g
bspc node -s biggest.window
#
# state/flags
#
# set the window state
super + {t,shift + t,s,f}
bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
# set the node flags
super + ctrl + {m,x,y,z}
bspc node -g {marked,locked,sticky,private}
#
# focus/swap
#
# focus the node in the given direction
super + {_,shift + }{h,j,k,l}
bspc node -{f,s} {west,south,north,east}
# focus the node for the given path jump
super + {p,b,comma,period}
bspc node -f @{parent,brother,first,second}
# focus the next/previous window in the current desktop
super + {_,shift + }c
bspc node -f {next,prev}.local.!hidden.window
# focus the next/previous desktop in the current monitor
super + bracket{left,right}
bspc desktop -f {prev,next}.local
# focus the last node/desktop
super + {grave,Tab}
bspc {node,desktop} -f last
# focus the older or newer node in the focus history
super + {o,i}
bspc wm -h off; \
bspc node {older,newer} -f; \
bspc wm -h on
# focus or send to the given desktop
super + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
#
# preselect
#
# preselect the direction
super + ctrl + {h,j,k,l}
bspc node -p {west,south,north,east}
# preselect the ratio
super + ctrl + {1-9}
bspc node -o 0.{1-9}
# cancel the preselection for the focused node
super + ctrl + space
bspc node -p cancel
# cancel the preselection for the focused desktop
super + ctrl + shift + space
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
#
# move/resize
#
# expand a window by moving one of its side outward
super + alt + {h,j,k,l}
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
# contract a window by moving one of its side inward
super + alt + shift + {h,j,k,l}
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
# move a floating window
super + {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0}
### Function Keys
XF86AudioMute
pactl set-sink-mute @DEFAULT_SINK@ toggle
XF86AudioLowerVolume
pactl set-sink-volume @DEFAULT_SINK@ -5%
XF86AudioRaiseVolume
pactl set-sink-volume @DEFAULT_SINK@ +5%
XF86AudioMicMute
pactl set-source-mute @DEFAULT_SOURCE@ toggle
XF86MonBrightnessDown
xbacklight -dec 5
XF86MonBrightnessUp
xbacklight -inc 5
XF86Display
mirror-outputs
XF86WLAN
toggle-wifi
XF86Tools
lxappearance
XF86Search
pamac-manager
XF86LaunchA
rofi -show window
XF86Explorer
thunar

View file

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# key : 161
# group: school
# name : cs hw header
# --
# Author: $1
# Date: `(format-time-string "%m-%d-%Y")`$0
# Description: $2

83
install.sh Executable file
View file

@ -0,0 +1,83 @@
#!/bin/bash
backup=~/dotfiles_backup
log_file=~/dotfiles_install.log
dotfiles_dir=~/.dotfiles
config_dir=~/.config
bin_dir=~/.local/bin
## Logging
exec 3>&1 4>&2
trap 'exec 2>&4 1>&3' 0 1 2 3
exec 1>$log_file 2>&1
## Backup current files and folders
mkdir -p $backup
cp -a ~/.bash_profile $backup/
cp -a ~/.bashrc $backup/
cp -a ~/.profile $backup/
cp -a ~/.emacs $backup/
cp -a ~/.emacs.d $backup/
cp -a ~/.Xresources $backup/
cp -a $config_dir/bspwm $backup/
cp -a $config_dir/dunst $backup/
cp -a $config_dir/kitty $backup/
cp -a $config_dir/nvim $backup/
cp -a $config_dir/polybar $backup/
cp -a $config_dir/ranger $backup/
cp -a $bin_dir $backup/
# Delete current files and folders
rm -rf ~/.bash_profile
rm -rf ~/.bashrc
rm -rf ~/.profile
rm -rf ~/.emacs
rm -rf ~/.emacs.d
rm -rf ~/.Xresources
rm -rf $config_dir/bspwm
rm -rf $config_dir/dunst
rm -rf $config_dir/kitty
rm -rf $config_dir/nvim
rm -rf $config_dir/polybar
rm -rf $config_dir/ranger/
rm -rf $bin_dir
# Create HOME symlinks
ln -sf $dotfiles_dir/bashrc ~/.bashrc
ln -sf $dotfiles_dir/bash_profile ~/.bash_profile
ln -sf $dotfiles_dir/profile ~/.profile
ln -sf $dotfiles_dir/emacs.d ~/.emacs.d
ln -sf $dotfiles_dir/xinitrc ~/.xinitrc
ln -sf $dotfiles_dir/vimrc ~/.vimrc
ln -sf $dotfiles_dir/Xresources ~/.Xresources
# Create $config_dir, sub-directories, and symlinks
mkdir -p $config_dir/{bspwm,dunst,kitty,nvim,polybar,ranger,rofi,sxhkd}
ln -sf $dotfiles_dir/config/bspwm/bspwmrc $config_dir/bspwm/bspwmrc
ln -sf $dotfiles_dir/config/dunst/dunstrc $config_dir/dunst/dunstrc
ln -sf $dotfiles_dir/config/kitty/kitty.conf $config_dir/kitty/kitty.conf
ln -sf $dotfiles_dir/config/kitty/gruvbox.conf $config_dir/kitty/gruvbox.conf
ln -sf $dotfiles_dir/config/nvim/init.vim $config_dir/nvim/init.vim
ln -sf $dotfiles_dir/config/polybar/config.ini $config_dir/polybar/config.ini
ln -sf $dotfiles_dir/config/polybar/colors.ini $config_dir/polybar/colors.ini
ln -sf $dotfiles_dir/config/polybar/modules.ini $config_dir/polybar/modules.ini
ln -sf $dotfiles_dir/config/polybar/custom_modules.ini $config_dir/polybar/custom_modules.ini
ln -sf $dotfiles_dir/config/ranger/commands_full.py $config_dir/ranger/commands_full.py
ln -sf $dotfiles_dir/config/ranger/commands.py $config_dir/ranger/commands.py
ln -sf $dotfiles_dir/config/ranger/rc.conf $config_dir/ranger/rc.conf
ln -sf $dotfiles_dir/config/ranger/rifle.conf $config_dir/ranger/rifle.conf
ln -sf $dotfiles_dir/config/ranger/scope.sh $config_dir/ranger/scope.sh
ln -sf $dotfiles_dir/config/rofi/config.rasi $config_dir/rofi/config.rasi
ln -sf $dotfiles_dir/config/sxhkd/sxhkdrc $config_dir/sxhkd/sxhkdrc
# Create $bin_dir and symlinks
mkdir -p $bin_dir
ln -sf $dotfiles_dir/bin/mirror-outputs $bin_dir
ln -sf $dotfiles_dir/bin/single-polybar-launcher $bin_dir
ln -sf $dotfiles_dir/bin/toggle-wifi $bin_dir
# Finishing up
source ~/.bashrc
source ~/.bash_profile
xrdb ~/.Xresources