diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml new file mode 100644 index 0000000..ccd1241 --- /dev/null +++ b/.config/alacritty/alacritty.toml @@ -0,0 +1,81 @@ +[colors] +draw_bold_text_with_bright_colors = false + +[colors.bright] +black = "0x4d4754" +blue = "0x789ebf" +cyan = "0x82bfb3" +green = "0x97bd5e" +magenta = "0xa97fb3" +red = "0xcc5c5c" +white = "0xc7c6c3" +yellow = "0xf0c767" + +[colors.cursor] +background = "CellForeground" +text = "CellBackground" + +[colors.normal] +black = "0x14171d" +blue = "0x3d67a2" +cyan = "0x578c7c" +green = "0x759438" +magenta = "0x7b5687" +red = "0xa63a3a" +white = "0xada0a8" +yellow = "0xde7e54" + +[colors.primary] +background = "0x14171d" +foreground = "0xc7c6c3" + +[colors.selection] +background = "CellForeground" +text = "CellBackground" + +[font] +size = 11.5 + +[font.bold] +style = "Bold" + +[font.bold_italic] +style = "Bold Italic" + +[font.italic] +style = "Italic" + +[font.normal] +family = "monospace" +style = "Regular" + +[font.offset] +x = 0 +y = 0 + +[[hints.enabled]] +command = "xdg-open" +post_processing = true +regex = "(magnet|mailto|gemini|gopher|https|http|news|file|git|ssh|ftp):[^\u0000-\u001F\u007F-Ÿ<>\"\\s{-}\\^⟨⟩`]+" + +[hints.enabled.binding] +key = "U" +mods = "Control|Shift" + +[hints.enabled.mouse] +enabled = true +mods = "None" + +[[keyboard.bindings]] +action = "SpawnNewInstance" +key = "Return" +mods = "Control|Super" + +[window] +decorations = "full" +dynamic_title = true +opacity = 0.85 + +[window.padding] +x = 5 +y = 5 diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 275697b..5411729 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -30,28 +30,28 @@ draw_bold_text_with_bright_colors: false colors: primary: - background: '0x14171d' - foreground: '0xc7c6c3' + background: '#14171d' + foreground: '#c7c6c3' normal: - black: '0x14171d' - red: '0xa63a3a' - green: '0x759438' - yellow: '0xde7e54' - blue: '0x3d67a2' - magenta: '0x7b5687' - cyan: '0x578c7c' - white: '0xada0a8' + black: '#14171d' + red: '#a63a3a' + green: '#759438' + yellow: '#de7e54' + blue: '#3d67a2' + magenta: '#7b5687' + cyan: '#578c7c' + white: '#ada0a8' bright: - black: '0x4d4754' - red: '0xcc5c5c' - green: '0x97bd5e' - yellow: '0xf0c767' - blue: '0x789ebf' - magenta: '0xa97fb3' - cyan: '0x82bfb3' - white: '0xc7c6c3' + black: '#4d4754' + red: '#cc5c5c' + green: '#97bd5e' + yellow: '#f0c767' + blue: '#789ebf' + magenta: '#a97fb3' + cyan: '#82bfb3' + white: '#c7c6c3' selection: text: CellBackground @@ -68,7 +68,6 @@ hints: post_processing: true mouse: enabled: true - mods: None binding: key: U mods: Control|Shift diff --git a/.config/sway/config b/.config/sway/config index 8567530..98a9a6e 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -26,43 +26,42 @@ workspace 9 output eDP-1 for_window [app_id="scratch_term"] move scratchpad, resize set 960 640 for_window [app_id="scratch_calc"] move scratchpad, resize set 960 640 -for_window [app_id="scratch_cmus"] move scratchpad, resize set 960 640 -for_window [app_id="scratch_htop"] move scratchpad, resize set 960 640 for_window [app_id="wofi"] opacity 0.8 # gnome time set $gnome-schema org.gnome.desktop.interface exec_always { - gsettings set $gnome-schema gtk-theme 'Adwaita-dark' - gsettings set $gnome-schema icon-theme 'Adwaita' - gsettings set $gnome-schema font-name 'Cantarell 11' - gsettings set org.gnome.desktop.default-applications.terminal exec $term + gsettings set $gnome-schema gtk-theme 'Adwaita-dark' + gsettings set $gnome-schema icon-theme 'Adwaita' + gsettings set $gnome-schema font-name 'Cantarell 11' + gsettings set org.gnome.desktop.default-applications.terminal exec $term } # swaymsg -t get_outputs #output eDP-1 resolution 3840x2400 position 2133,0 #output DP-2 resolution 2560x1440 position 0,0 scale 1.2 #output eDP-1 resolution 3840x2400 position 1920,0 -#output DP-2 resolution 1920x1080 position 0,0 +#output DP-2 resolution 1920x1080 position 0,n0 output eDP-1 resolution 3840x2400 position 0,0 -output DP-3 resolution 2560x1440 position 1920,0 scale 1.2 +output DP-3 resolution 2560x1440 position 1920,0 scale 1.1875 input "type:keyboard" { - xkb_layout uscustom - xkb_options compose:menu,caps:escape + xkb_layout uscustom + xkb_options compose:menu,caps:escape } input "type:touchpad" { - #events disabled - tap enable + tap enable + accel_profile flat + pointer_accel 0.2 } # Idle configuration exec swayidle -w \ - timeout 300 'swaylock -f' \ - timeout 300 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ - before-sleep 'swaylock -f' + timeout 300 'swaylock -f' \ + timeout 300 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock -f' floating_modifier $mod normal gaps inner 14 @@ -123,8 +122,6 @@ bindsym $mod+y exec ~/.config/sway/scratchpads.sh scratch_term zsh bindsym $mod+u exec dmenu_specialchars bindsym $mod+Shift+u exec dmenu_unicode bindsym $mod+i exec ~/.config/sway/scratchpads.sh scratch_calc "talc -H ~/.local/share/talc_history" -bindsym $mod+o exec ~/.config/sway/scratchpads.sh scratch_cmus cmus -bindsym $mod+p exec ~/.config/sway/scratchpads.sh scratch_htop htop # Move focus to the parent container bindsym $mod+a focus parent diff --git a/.local/scripts/colortest b/.local/scripts/colortest new file mode 100755 index 0000000..ea69ced --- /dev/null +++ b/.local/scripts/colortest @@ -0,0 +1,20 @@ +#!/bin/bash + +# REQUIRES: +# bash +# coreutils + +printf " " +for b in 40 41 42 43 44 45 46 47 100 101 102 103 104 105 106 107; do printf "%5s " "$b"; done +echo +for f in "" 30 31 32 33 34 35 36 37 90 91 92 93 94 95 96 97; do + for s in "" "1;"; do + printf "%5s" "${s}${f}" + printf " \033[%sm%s\033[0m" "$s$f" "gYw " + for b in 40 41 42 43 44 45 46 47 100 101 102 103 104 105 106 107; do + printf " \033[%s;%sm%s\033[0m" "$b" "$s$f" " gYw " + done + printf "\033[0m" + echo + done +done diff --git a/.local/scripts/dmenu_kblayout b/.local/scripts/dmenu_kblayout new file mode 100755 index 0000000..e390b9e --- /dev/null +++ b/.local/scripts/dmenu_kblayout @@ -0,0 +1,25 @@ +#!/bin/sh + +layouts="US CUSTOM +INTL +IPA +MATH +SPECIAL +BOXDRAW" + +choice="$(printf %s "$layouts" | wofi -S dmenu -p "Set keyboard layout:" -k /dev/null)" + + +if [ "$?" -eq 0 ]; then + if [ "$choice" = "US CUSTOM" ]; then + swaymsg input '*' xkb_layout 'uscustom' + elif [ "$choice" = "INTL" ]; then + swaymsg input '*' xkb_layout 'us(intl)' + elif [ "$choice" = "IPA" ]; then + swaymsg input '*' xkb_layout 'ipa' + elif [ "$choice" = "MATH" ]; then + swaymsg input '*' xkb_layout 'math' + elif [ "$choice" = "SPECIAL" ]; then + swaymsg input '*' xkb_layout 'special' + fi +fi diff --git a/.local/scripts/dmenu_specialchars b/.local/scripts/dmenu_specialchars new file mode 100755 index 0000000..6afaccf --- /dev/null +++ b/.local/scripts/dmenu_specialchars @@ -0,0 +1,7 @@ +#!/bin/sh + +sel="$(wofi -S dmenu -p "character" -k /dev/null < "$HOME/.local/scripts/specialchars_list" )" + +if [ "$sel" != "" ]; then + echo "$sel" | awk '{print $1}' | tr -d '\n' | wtype - +fi diff --git a/.local/scripts/initcproj b/.local/scripts/initcproj new file mode 100755 index 0000000..b8069f9 --- /dev/null +++ b/.local/scripts/initcproj @@ -0,0 +1,53 @@ +#!/bin/sh + +# get directory name +name="${PWD##*/}" + +# create git repo +git init + +# create gitignore +echo "\ +bin/ +$name +" >> .gitignore + +# create source +mkdir -p src + +# create main file +echo "\ +int main(int argc, char **argv) { + return 0; +} +" > src/main.c + +# create makefile +echo "\ +CFLAGS += -Wall -Wextra -pedantic -std=c23 + +SDIR=src +ODIR=bin +BIN=$name + +SRC=\$(shell find \$(SDIR) -type f -name '*.c') +SRH=\$(shell find \$(SDIR) -type f -name '*.h') +OBJ=\$(patsubst \$(SDIR)/%.c,\$(ODIR)/%.o,\$(SRC)) + +.PHONY: clean run + +\$(BIN): \$(OBJ) \$(SRH) + @mkdir -p \$(ODIR) + \$(CC) -o \$@ \$(OBJ) \$(CFLAGS) + +\$(ODIR)/%.o: \$(SDIR)/%.c \$(SRH) + @mkdir -p \$(ODIR) + \$(CC) -c -o \$@ $< \$(CFLAGS) + +clean: + rm -rf \$(BIN) \$(ODIR) + +run: \$(BIN) + ./\$(BIN) +" > Makefile + diff --git a/.local/scripts/kernelver b/.local/scripts/kernelver new file mode 100755 index 0000000..d50e34a --- /dev/null +++ b/.local/scripts/kernelver @@ -0,0 +1,4 @@ +#!/bin/sh + +printf "Running version: %s\n" "$(uname -r)" +printf "Package version: %s\n" "$(pacman -Q | grep '^linux ' | awk '{ print $2 }')" diff --git a/.local/scripts/rand-wallpaper b/.local/scripts/rand-wallpaper new file mode 100755 index 0000000..6fa013d --- /dev/null +++ b/.local/scripts/rand-wallpaper @@ -0,0 +1,9 @@ +#!/bin/sh + +name=$(find ~/pictures/wallpapers -type f | shuf -n 1) +# xwallpaper --zoom $name +PID=$(pidof swaybg) +swaybg -i "$name" -m fill & +sleep 0.4 +kill "$PID" +echo "$name" | tee /tmp/wallpapername diff --git a/.local/scripts/screenshot b/.local/scripts/screenshot new file mode 100755 index 0000000..f449076 --- /dev/null +++ b/.local/scripts/screenshot @@ -0,0 +1,32 @@ +#!/bin/bash + +set -o pipefail + +options=$"display +upload +save +gimp" + +#maim -s -u | tee "$HOME/screenshots/latest.png" | xclip -selection clipboard -t image/png +grim -g "$(slurp)" - | tee "$HOME/screenshots/latest.png" | wl-copy -t image/png +exit_code=$? +if [[ $exit_code -eq 0 ]]; then + while :; do + choice="$(printf %s "$options" | wofi -S dmenu -p "Screenshot options:")" + if [ "$choice" = "display" ]; then + ( imv "$HOME/screenshots/latest.png" & ) + elif [ "$choice" = "upload" ]; then + fupload-notify "$HOME/screenshots/latest.png" + elif [ "$choice" = "save" ]; then + timestamp="$(date +"%Y-%m-%dT%H.%M.%S")" + cp "$HOME/screenshots/latest.png" "$HOME/screenshots/$timestamp.png" + elif [ "$choice" = "gimp" ]; then + ( gimp "$HOME/screenshots/latest.png" & ) + else + exit 0 + fi + done +else + notify-send "Screenshot canceled" + exit 1 +fi diff --git a/.local/scripts/specialchars_list b/.local/scripts/specialchars_list new file mode 100644 index 0000000..4c8b0c5 --- /dev/null +++ b/.local/scripts/specialchars_list @@ -0,0 +1,224 @@ +α \alpha +β \beta +γ \gamma +δ \delta +ε \epsilon +ζ \zeta +η \eta +θ \theta +ϑ \vartheta +ι \iota +κ \kappa +λ \lambda lamda +μ \mu micro +ν \nu +ξ \xi +ο \omicron +π \pi +ρ \rho +σ \sigma +ς \varsigma +τ \tau +υ \upsilon +φ \phi +ϕ \varphi +χ \chi +ψ \psi +ω \omega +Α \Alpha +Β \Beta +Γ \Gamma +Δ \Delta +Ε \Epsilon +Ζ \Zeta +Η \Eta +Θ \Theta +Ι \Iota +Κ \Kappa +Λ \Lambda Lamda +Μ \Mu +Ν \Nu +Ξ \Xi +Ο \Omicron +Π \Pi product +Ρ \Rho +Σ \Sigma sum +Τ \Tau +Υ \Upsilon +Φ \Phi +Χ \Chi +Ψ \Psi +Ω \Omega ohm +ℵ aleph alef +ℶ beth +ℷ gimel +ℸ daleth +ה he +ו waw vav +ז zayin +ח chet +ט tet +י yod +כ kaf +ך varkaf +ל lamed +מ mem +ם varmem +נ nun +ן varnun +ס samech +ע ayin +פ pe +ף varpe +צ tsadi +ץ vartsadi +ק qof +ר resh +ש shin +ת tav +° \degree +– en dash +— em dash +† \dag dagger cross +‡ \ddag double dagger cross +• bullet +‣ triangle bullet +… \dots ellipses +‰ \permil per mille thousand +‱ \pertenthousand per ten thousand +‽ interrobang +∧ \land \wedge logical and +∨ \lor \vee logical or +¬ \lnot \neg logical not +← arrow left +→ arrow right implies +↔ arrow leftright left right biconditional +↑ arrow up +↓ arrow down +↕ arrow updown up down +↖ arrow upleft up left +↗ arrow upright up right +↘ arrow downright down right +↙ arrow downleft down left +⇐ arrow double left +⇒ arrow double right +⇔ arrow double leftright left right +⇑ arrow double up +⇓ arrow double down +⇕ arrow double updown up down +⇖ double arrow upleft up left +⇗ double arrow upright up right +⇘ double arrow downright down right +⇙ double arrow downleft down left +∃ \exists +∀ \forall for all +∄ \not\exists not exists +∂ \partial differential derivative +∇ \nabla del +∈ \in element +∉ \notin \not\in not element +∊ small element +∋ \ni contains +∌ \not\ni contains +∍ small contains +∅ \emptyset empty set +∏ product +∐ coproduct +∑ sum +ℂ complex bbC \mathbb{C} +ℍ quaternions bbH \mathbb{H} +ℕ naturals bbN \mathbb{N} +ℙ projective prime power bbP \mathbb{P} +ℚ rationals fractions bbQ \mathbb{Q} +ℝ reals bbR \mathbb{R} +ℤ integers bbZ \mathbb{Z} +↊ dozenal duodecimal ten inverted two +↋ dozenal duodecimal eleven inverted three +æ ae ligature +œ oe ligature +© copyright +™ trademark +® register mark sign +± \pm plus minus +∓ \mp minus plus +∖ \setminus set difference +∗ \ast asterisk convolution +☭ communism hammer and sickle +∘ \circ circle +∙ \cdot center dot +√ \root radical +∛ 3root root3 cube root +∜ 4root root4 fourth root +∝ proportional \propto +∞ \infty infinity +∩ \cap intersect +∪ \cup contains +∫ \int integral +∬ \iint double integral +∭ \iiint triple integral +∮ \oint contour integral +∯ \oiint double contour integral +∰ \oiiint triple contour integral +÷ \div division +∴ \therefore +∵ \because +∶ ratio +∷ double colon ratio +∣ \mid divides +∤ \not\mid not divides +∠ angle +∼ \sim asymptotically equal +≁ \not\sim not asymptotically equal +≃ \simeq +≄ \not\simeq +≅ \cong congruent isomorphic +≇ \not\cong not congruent isomorphic +≈ \approx approximately equal +≉ \not\approxi not approximately equal +≠ \neq not equal +≡ \equiv equivalent +≢ \not\equiv not equivalent +≤ \le less than or equal +≥ \ge greater than or equal +≮ \not< not less than +≯ \not> not greater than +≰ \not\le not less than or equal +≱ \not\ge not greater than or equal +⊂ \subset +⊃ \supset superset +⊄ \not\subset not subset +⊅ \not\supset not superset +⊆ \subseteq subset or equal +⊇ \supseteq superset or equal +⊆ \not\subseteq not subset or equal +⊇ \not\supseteq not superset or equal +⊊ \subsetneq subset not equal +⊋ \supsetneq superset not equal +⊕ \oplus plus with circle +⊖ \ominus minus with circle +⊗ \otimes times cross multiply with circle +⊘ \oslash slash divide with circle +⊙ \odot dot with circle +⊞ plus with square +⊟ minus with square +⊠ times cross multiply with square +⊡ dot with square +⊢ \vdash turnstile right tack tee +⊣ \dashv reverse turnstile +⊤ \top true +⊥ \bot bottom false +⊨ \models entails double turnstile +⊬ \not\vdash not turnstile right tack tee +⊭ \not\models not models entails double turnstile +⊲ \triangleleft \vartriangleleft strict normal subgroup +⊳ \triangleright \vartriangleright strict normal supergroup +⊴ \unlhd \vartrianglelefteq normal subgroup or equal +⊵ \unrhd \vartrianglerighteq normal supergroup or equal +⋪ \not\triangleleft \not\vartriangleleft not strict normal subgroup +⋫ \not\triangleright \not\vartriangleright not strict normal supergroup +⋬ \not\unlhd \not\vartrianglelefteq not normal subgroup or equal +⋭ \not\unrhd \not\vartrianglerighteq not normal supergroup or equal +⋮ \vdots vertical dots +⋯ \cdots ellipsis dots +⋱ \ddots diagonal dots +⋰ \iddots \udots reverse diagonal dots diff --git a/.local/scripts/termedit b/.local/scripts/termedit new file mode 100755 index 0000000..aa62112 --- /dev/null +++ b/.local/scripts/termedit @@ -0,0 +1,9 @@ +#!/bin/sh + +# REQUIRES: +# sh +# coreutils +# $TERMINAL +# $EDITOR + +$TERMINAL -e $EDITOR $@ diff --git a/.local/scripts/todo b/.local/scripts/todo new file mode 100755 index 0000000..fee465f --- /dev/null +++ b/.local/scripts/todo @@ -0,0 +1,20 @@ +#!/bin/bash + +# REQUIRES: +# coreutils +# bash +# $HOME + +# todo: simple todo script + +todo_file="$HOME/.local/share/todo" +if [[ ! -f "$todo_file" ]]; then + touch "$todo_file" +fi + +if [[ "$1" == "-r" ]]; then + sed -i -e "$(($2+1))d" "$todo_file" +elif (($#)); then + printf "%s\n" "$*" >> "$todo_file" +fi +nl -v 0 -w 2 -n 'ln' "$todo_file" diff --git a/.local/scripts/wofi_symbols b/.local/scripts/wofi_symbols new file mode 100755 index 0000000..3c20a01 --- /dev/null +++ b/.local/scripts/wofi_symbols @@ -0,0 +1,7 @@ +#!/bin/sh + +sel="$(wofi -S dmenu -p "symbol" -k "$HOME/.cache/wofi-unicode" < "$HOME/.local/scripts/symbols.txt" )" + +if [ "$sel" != "" ]; then + wtype "$(echo "$sel" | awk '{ print $1 }')" +fi diff --git a/.zshenv b/.zshenv index 3b4e5b9..5d9ac4e 100755 --- a/.zshenv +++ b/.zshenv @@ -28,6 +28,7 @@ export BUNDLE_USER_CACHE="$XDG_CACHE_HOME/bundle" export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME/bundle" export NUGET_PACKAGES="$XDG_CACHE_HOME/NuGetPackages" export WINEPREFIX="$XDG_DATA_HOME/wine" +export OPAMROOT="$XDG_DATA_HOME/opam" export QT_QPA_PLATFORM=wayland-egl export MOZ_ENABLE_WAYLAND=1 @@ -45,5 +46,8 @@ export PATH="$PATH:/usr/lib/rustup/bin:$HOME/.local/scripts:$HOME/.local/bin:$HO if [ "$(tty)" = "/dev/tty1" ]; then exec sway +elif tty | grep -E "^/dev/tty([234589]|1[012])$" 2>&1 >/dev/null; then + exec tmux fi +clear diff --git a/.zshrc b/.zshrc index 0481e1b..0014f6f 100755 --- a/.zshrc +++ b/.zshrc @@ -3,6 +3,10 @@ HISTSIZE=10000 SAVEHIST=10000 HISTFILE=~/.histfile +# BEGIN opam configuration +[[ ! -r "$OPAMROOT/opam-init/init.zsh" ]] || source "$OPAMROOT/opam-init/init.zsh" > /dev/null 2> /dev/null +# END opam configuration + gpg-connect-agent updatestartuptty /bye &> /dev/null export GPG_TTY=$(tty) SSH_AUTH_SOCK="/run/user/$(id -u)/gnupg/S.gpg-agent.ssh" @@ -11,7 +15,7 @@ gpgconf --launch gpg-agent setopt extendedglob bindkey -e -tabs 4 +tabs autoload -U compinit compinit @@ -79,6 +83,16 @@ function preexec () { # Aliases # +cd() { + if printf "%s" "$@" | grep -E '^(/.*|\./.*|\../.*|..)$' >/dev/null; then + pushd "$@" >/dev/null + else + builtin cd "$@" + fi +} + +alias emcc=/usr/lib/emscripten/emcc + alias ..="cd .." alias ~="cd ~" @@ -123,7 +137,17 @@ alias ssht="ssh -D 1080" alias irc="ssh -t apiaceae tmux attach -t weechat" -alias e="emacs -nw" +x() { + ( "$@" & ) +} + +_x() { + #compdef x + shift words + (( CURRENT-- )) + _normal +} +compdef _x -p x # # Todo @@ -133,7 +157,3 @@ todomsg=$(todo) [ "$todomsg" != "" ] && printf "TODO: \n%s\n" "$todomsg" return 0 - - -# Load Angular CLI autocompletion. -source <(ng completion script)