diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc new file mode 100755 index 0000000..f857efc --- /dev/null +++ b/bspwm/.config/bspwm/bspwmrc @@ -0,0 +1,94 @@ +#!/bin/sh +# New Start: A modern Arch workflow built with an emphasis on functionality. +# Copyright (C) 2018 Donovan Glover + +export SXHKD_SHELL="/usr/bin/bash" +export XCURSOR_THEME="breeze_cursors" +export XDG_DATA_DIRS="/usr/share:/usr/share:/usr/local/share" + +sxhkd & + +bspc monitor -d     + +bspc config split_ratio 0.50 + +# When monocle mode is enabled, don't show borders or gaps (i.e. let it +# take up the full available space on the screen). +bspc config borderless_monocle true +bspc config gapless_monocle true + +# Always focus the window under the cursor +# while moving the mouse, similar to i3 +bspc config focus_follows_pointer true + +# Make caps lock work as ctrl +xmodmap ~/.xmodmap + +# Make caps lock (left ctrl) work as escape +xcape -e 'Control_L=Escape' + +# Change the default X shaped cursor to a pointer +xsetroot -cursor_name left_ptr + +# Set a temporary black background to avoid flash +~/.config/feh/tile.sh 000000 + +# If running with VirtualBox client utilities, start them. +# Useful for automatically changing display resolution, etc. +if hash VBoxClient-all 2>/dev/null; then + VBoxClient-all +fi + +# Set the color scheme to a sane default. +wal -o ~/.config/wal/done.sh --theme base16-tomorrow-night + +# Never blank the screen (disable power saving) +xset s off -dpms + +# Start polybar and other things based on DPI +# Get the host width +HOST_WIDTH=$(bspc query -T -m | jq '.rectangle.width') + +CURSOR_THEME=${XCURSOR_THEME:-breeze_cursors} + +# If the DPI is not set, set it to 96 by default +if [ -z "$(xrdb -query | grep dpi)" ]; then + X_DPI=96 +fi + +# Determine the DPI based on screen width +if [ "$HOST_WIDTH" -eq "1920" ]; then + X_DPI=96 +fi + +if [ "$HOST_WIDTH" -eq "3840" ]; then + X_DPI=192 +fi + +# Reposition the desktop background +~/.fehbg & + +# If the DPI needs to be changed, change it +if [ "$X_DPI" ]; then + echo "Xft.dpi:$X_DPI" | xrdb -merge + + # Change the X cursor size as well + # NOTE: For full effect, this needs to be used in combination with XCURSOR_SIZE. + # NOTE: ($X_DPI / 6) here means that 4k will use cursor size 32, so it will appear + # about half the size of the 1080p cursor. If this is not what you want, use + # cursor size 64 instead. + xsetroot -xcf "/usr/share/icons/$CURSOR_THEME/cursors/left_ptr" "$(($X_DPI / 6))" +fi + +~/.config/polybar/launch.sh main & + +# bspc rules +bspc rule -a mpv state=floating +bspc rule -a feh state=floating +bspc rule -a kitty:floating state=floating + +bspc rule -a kwrite state=floating +bspc rule -a ark state=floating +bspc rule -a kmag state=floating +bspc rule -a kcharselect state=floating +bspc rule -a Onboard state=floating sticky=on diff --git a/bspwm/.config/bspwm/wal.sh b/bspwm/.config/bspwm/wal.sh new file mode 100755 index 0000000..7736218 --- /dev/null +++ b/bspwm/.config/bspwm/wal.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Source the colors from wal +source ~/.cache/wal/colors.sh + +# Set the border colors +bspc config normal_border_color "$color8" +bspc config active_border_color "$color2" +bspc config focused_border_color "$color7" +bspc config presel_feedback_color "$color7" diff --git a/bspwm/README.md b/bspwm/README.md new file mode 100644 index 0000000..4a48609 --- /dev/null +++ b/bspwm/README.md @@ -0,0 +1,18 @@ +# bspwm + +[bspwm][bspwm] is a tiling window manager for X11. + +## Use Cases + +bspwm can be used to: + +- Automatically tile all kinds of windows, maximizing screen estate +- Have complete control of your window manager through simple shell commands +- Minimize resource usage; bspwm works best without a desktop environment + +You should not use bspwm if: + +- You are using a desktop environment +- You just want to open multiple shells (use [kitty](/kitty) or [tmux](/tmux) for this instead) + +[bspwm]: https://github.com/baskerville/bspwm