mirror of
https://github.com/The-Repo-Club/DotFiles.git
synced 2025-02-14 08:23:25 -05:00
228 lines
4.8 KiB
Bash
Executable File
228 lines
4.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#-*-coding:utf-8 -*-
|
|
#Auto updated?
|
|
# Yes
|
|
#File:
|
|
# autostart
|
|
#Author:
|
|
# The-Repo-Club [wayne6324@gmail.com]
|
|
#Github:
|
|
# https://github.com/The-Repo-Club/
|
|
#
|
|
#Created:
|
|
# Sat 15 October 2022, 09:01:26 PM [GMT+1]
|
|
#Modified:
|
|
# Fri 17 February 2023, 09:49:52 PM [GMT]
|
|
#
|
|
#Description:
|
|
# Config for herbstluftwm
|
|
#
|
|
#Dependencies:
|
|
# bash, herbstluftwm
|
|
#
|
|
# shellcheck disable=all
|
|
|
|
hc() {
|
|
herbstclient "$@"
|
|
}
|
|
|
|
hc emit_hook reload
|
|
|
|
#----------------#
|
|
# Setup Commands #
|
|
#----------------#
|
|
|
|
editor='code'
|
|
menu='menu'
|
|
browser='firefox'
|
|
terminal='alacritty'
|
|
power='rofi -show powermenu -config ~/.config/rofi/powermenu.rasi'
|
|
vbox='virt-manager'
|
|
files='nemo'
|
|
mail='thunderbird'
|
|
|
|
#---------------------------------#
|
|
# REMOVE ALL EXISTING KEYBINDINGS #
|
|
#---------------------------------#
|
|
hc keyunbind --all
|
|
|
|
#-------------#
|
|
# KEYBINDINGS #
|
|
#-------------#
|
|
|
|
MOD=Mod4 # Use the super key as the main modifier
|
|
ALT=Mod1 # Use the alt key as the alt modifier
|
|
SHIFT=Shift # Use the shift key as the shift modifier
|
|
CTRL=Control # Use the control key as the control modifier
|
|
|
|
#-----------------#
|
|
# System controls #
|
|
#-----------------#
|
|
hc keybind $MOD-$SHIFT-r reload
|
|
hc keybind $MOD-q close
|
|
hc keybind $MOD-Return spawn "${TERMINAL:-$terminal}"
|
|
hc keybind $MOD-b spawn "sh $HOME/.config/polybar/scripts/toggle_bar.sh"
|
|
|
|
#------------#
|
|
# Programing #
|
|
#------------#
|
|
|
|
hc keybind $MOD-$CTRL-c spawn $editor
|
|
|
|
#----------#
|
|
# Browsers #
|
|
#----------#
|
|
|
|
hc keybind $MOD-$CTRL-f spawn $browser
|
|
|
|
#-------#
|
|
# Files #
|
|
#-------#
|
|
|
|
hc keybind $MOD-$SHIFT-Return spawn $files
|
|
|
|
#-----------#
|
|
# Launchers #
|
|
#-----------#
|
|
|
|
hc keybind $MOD-m spawn $menu
|
|
hc keybind $MOD-$SHIFT-e spawn $power
|
|
|
|
#-------------#
|
|
# ScratchPads #
|
|
#-------------#
|
|
|
|
hc keybind $CTRL-Return spawn scratchpad
|
|
hc keybind $ALT-Return spawn scratch terminal
|
|
hc keybind $ALT-c spawn scratch files
|
|
hc keybind $ALT-v spawn scratch volume
|
|
|
|
#-----------------#
|
|
# Focusing Client #
|
|
#-----------------#
|
|
|
|
hc keybind $MOD-Up focus up
|
|
hc keybind $MOD-Down focus down
|
|
hc keybind $MOD-Left focus left
|
|
hc keybind $MOD-Right focus right
|
|
|
|
# Moving clients in tiling and floating mode #
|
|
|
|
hc keybind $MOD-$SHIFT-Up shift up
|
|
hc keybind $MOD-$SHIFT-Down shift down
|
|
hc keybind $MOD-$SHIFT-Left shift left
|
|
hc keybind $MOD-$SHIFT-Right shift right
|
|
|
|
#------------------#
|
|
# Splitting Frames #
|
|
#------------------#
|
|
|
|
hc keybind $MOD-u split bottom 0.6
|
|
hc keybind $MOD-o split right 0.6
|
|
|
|
#----------------------------------------------#
|
|
# let the current frame explode into subframes #
|
|
#----------------------------------------------#
|
|
|
|
hc keybind $MOD-$CTRL-space split explode
|
|
|
|
#--------------------------------------#
|
|
# resizing frames and floating clients #
|
|
#--------------------------------------#
|
|
|
|
resizestep=0.02
|
|
hc keybind $MOD-$CTRL-Up resize up +$resizestep
|
|
hc keybind $MOD-$CTRL-Down resize down +$resizestep
|
|
hc keybind $MOD-$CTRL-Left resize left +$resizestep
|
|
hc keybind $MOD-$CTRL-Right resize right +$resizestep
|
|
|
|
#------#
|
|
# tags #
|
|
#------#
|
|
""
|
|
tag_names=({1..9} 0)
|
|
tag_keys=({1..9} 0)
|
|
|
|
hc rename default "${tag_names[0]}" || true
|
|
for i in "${!tag_names[@]}" ; do
|
|
hc add "${tag_names[$i]}"
|
|
hc set_layout horizontal
|
|
hc set default_frame_layout 1
|
|
key="${tag_keys[$i]}"
|
|
if ! [ -z "$key" ] ; then
|
|
hc keybind "$MOD-$key" use_index "$i"
|
|
hc keybind "$MOD-$SHIFT-$key" move_index "$i"
|
|
fi
|
|
done
|
|
|
|
#-----------#
|
|
# Layouting #
|
|
#-----------#
|
|
|
|
hc keybind $ALT-r remove
|
|
hc keybind $ALT-f fullscreen toggle
|
|
|
|
#-------#
|
|
# Focus #
|
|
#-------#
|
|
|
|
hc keybind $MOD-BackSpace cycle_monitor
|
|
hc keybind $MOD-Tab cycle_all +1
|
|
hc keybind $MOD-$SHIFT-Tab cycle_all -1
|
|
hc keybind $MOD-c cycle
|
|
hc keybind $MOD-i jumpto urgent
|
|
|
|
#-------#
|
|
# MOUSE #
|
|
#-------#
|
|
|
|
hc mouseunbind --all
|
|
hc mousebind $MOD-Button1 move
|
|
hc mousebind $MOD-Button2 zoom
|
|
hc mousebind $MOD-Button3 resize
|
|
|
|
#-------#
|
|
# RULES #
|
|
#-------#
|
|
|
|
hc unrule -F # clear rules
|
|
|
|
#-------#
|
|
# THEME #
|
|
#-------#
|
|
|
|
if [ -f $HOME/.config/herbstluftwm/extra/theme ];
|
|
then
|
|
. $HOME/.config/herbstluftwm/extra/theme
|
|
fi
|
|
|
|
#----------#
|
|
# PROGRAMS #
|
|
#----------#
|
|
|
|
hc rule class~'([Aa]lacritty|[Kk]itty)' tag='1'
|
|
|
|
#-------------#
|
|
# SCRATCHPADS #
|
|
#-------------#
|
|
|
|
hc rule title~'scratchpad' floating=on floatplacement=center floating_geometry=1000x500
|
|
hc rule title~'clifm' floating=on floatplacement=center floating_geometry=1000x500
|
|
|
|
hc rule focus=on # normally focus new clients
|
|
hc rule floatplacement=center
|
|
#hc rule float_geometry=250x100
|
|
#hc rule focus=off # normally do not focus new clients
|
|
# give focus to most common terminals
|
|
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on floatplacement=center
|
|
hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on floatplacement=smart
|
|
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
|
|
|
|
hc set tree_style '╾│ ├└╼─┐'
|
|
|
|
#--------#
|
|
# UNLOCK #
|
|
#--------#
|
|
|
|
hc unlock
|
|
hc detect_monitors |