aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-09-17 11:46:13 +0200
committerlonkaars <loek@pipeframe.xyz>2023-09-17 11:46:13 +0200
commitb1f258dad18abd2c18d3f007c0917429f0318bc2 (patch)
tree4603741571fb3fd9b386c23fe21989ac9ce77d4a
parent5b6064be7d0787c55fcc163e68debb2d17e8b5f6 (diff)
clean up shell/i3 startup scripts
-rw-r--r--.config/i3/autostart##template15
-rw-r--r--.config/i3/config##template2
-rw-r--r--.config/user-dirs.locale1
-rw-r--r--.profile82
-rwxr-xr-x.xprofile20
l---------.zshenv1
-rw-r--r--.zshrc49
7 files changed, 98 insertions, 72 deletions
diff --git a/.config/i3/autostart##template b/.config/i3/autostart##template
index 6d54ff7..23eb199 100644
--- a/.config/i3/autostart##template
+++ b/.config/i3/autostart##template
@@ -1,18 +1,15 @@
#!/bin/sh
+. ~/.profile
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
-{% if yadm.hostname == "thoncc" %}
-cat ~/.config/X11/base ~/.config/X11/light | xrdb &
-{% else %}
-cat ~/.config/X11/base ~/.config/X11/dark | xrdb &
-{% endif %}
+cat "$XDG_CONFIG_HOME/X11/$(cat "$XDG_DATA_HOME/mode/active")" | xrdb -merge &
polybar &
-zsh -c "rwall" &
+rwall &
picom -b
xbanish &
dunst &
autocutsel &
fcitx5 -d
-zsh -c "xbindkeys -f ~/.config/xbindkeys/main"
+xbindkeys -f "~/.config/xbindkeys/main"
{% if yadm.hostname == "thoncc" %}
xdimmer -t 45 -p 3 &
light-locker --no-late-locking &
@@ -20,12 +17,12 @@ light-locker --no-late-locking &
redshift -l 52:6 &
nicotine &
{% endif %}
-zsh -c "flashfocus" &
+flashfocus &
# bw unlock <password> --raw | keyctl padd user bw_session @u
sh ~/.config/i3/unlock_bitwarden &
# auto start lazy script after everything else
sleep 2
-[[ -f ~/do.sh ]] && source ~/do.sh
+[ -f "~/do.sh" ] && . "~/do.sh"
diff --git a/.config/i3/config##template b/.config/i3/config##template
index 49a2caf..2b7a84b 100644
--- a/.config/i3/config##template
+++ b/.config/i3/config##template
@@ -41,7 +41,7 @@ bindsym $mod+n gaps inner current set -1; gaps outer current set 0
bindsym $mod+d gaps inner current set $inner_gaps; gaps outer current set $outer_gaps;
# Autostart
-exec "sh ~/.config/i3/autostart"
+exec "~/.config/i3/autostart"
# split in horizontal orientation
bindsym $mod+bar split h
diff --git a/.config/user-dirs.locale b/.config/user-dirs.locale
deleted file mode 100644
index 3e0b419..0000000
--- a/.config/user-dirs.locale
+++ /dev/null
@@ -1 +0,0 @@
-en_US \ No newline at end of file
diff --git a/.profile b/.profile
new file mode 100644
index 0000000..fd2312c
--- /dev/null
+++ b/.profile
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# this file should only contain posix-compliant shell customizations.
+# shell-specific customizations should be done in the respective shell's
+# profile or init file (e.g. .zshrc, .bash_profile, etc.)
+
+# aliases
+alias cls="clear"
+alias vim="nvim"
+alias copy="xclip -selection c"
+alias dnd="dragon-drag-and-drop -a -x"
+alias mk="make"
+
+# one letters
+alias r="ranger"
+alias v="nvim"
+alias m="neomutt"
+alias y="yay"
+alias n="ncmpcpp"
+alias c="khal"
+
+# "functions"
+alias reload="sudo systemctl restart lightdm"
+alias screenrecord='giph -f 60 -s -b 4 -c 255,255,255 $(date +"$HOME/%Y-%m-%d_%H-%M-%S.mp4")'
+
+# fontpreview
+if [ -n "$DISPLAY" ]; then
+ export FONTPREVIEW_BG_COLOR="$(xrdb -query | grep background | cut -f2)"
+ export FONTPREVIEW_FG_COLOR="$(xrdb -query | grep foreground | cut -f2)"
+fi
+
+# bat
+alias bat="bat -pp --theme=base16"
+
+# force colorterm
+export COLORTERM="truecolor"
+
+# xdg base directories
+export XDG_CONFIG_HOME="$HOME/.config"
+export XDG_CACHE_HOME="$HOME/.cache"
+export XDG_DATA_HOME="$HOME/.local/share"
+
+# script locations
+export PATH="$HOME/.local/share/bin:$PATH"
+export PATH="$HOME/.local/bin:$PATH"
+export PATH="$HOME/.local/go/bin:$PATH"
+# export PATH="/opt/f4pga/xc7/conda/bin:$PATH"
+
+# other stuff
+export EDITOR="nvim"
+export FZF_DEFAULT_COMMAND="find ."
+export FZF_DEFAULT_OPTS="--color=16"
+export GOPATH="$HOME/.local/go"
+
+# use .config/ instead of home directory
+export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android"
+export ADB_VENDOR_KEY="$XDG_CONFIG_HOME/android"
+export CARGO_HOME="$XDG_DATA_HOME/cargo"
+export gnome_user_dir="$HOME/.config/gnome/apps"
+export GNUPGHOME="$XDG_DATA_HOME/gnupg"
+export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle"
+export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
+export PARALLEL_HOME="$XDG_CONFIG_HOME/parallel"
+export PYLINTHOME="$XDG_CACHE_HOME/pylint"
+export STACK_ROOT="$XDG_DATA_HOME/stack"
+export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default"
+export HISTFILE="$XDG_DATA_HOME/zsh/history"
+export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv"
+export CONAN_USER_HOME="$XDG_CONFIG_HOME/conan"
+alias nvidia-settings=nvidia-settings --config="$XDG_CONFIG_HOME"/nvidia/settings
+alias gpg2="gpg2 --homedir $XDG_DATA_HOME/gnupg"
+
+# disable dotnet telemetry
+export DOTNET_CLI_TELEMETRY_OPTOUT=1
+
+# java
+export _JAVA_OPTIONS="-Djava.util.prefs.userRoot=$XDG_CONFIG_HOME/java -Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
+export _JAVA_AWT_WM_NONREPARENTING=1
+
+# secrets
+[ -f "$HOME/.env" ] && . "$HOME/.env"
+
diff --git a/.xprofile b/.xprofile
index 9abfa55..04dc85c 100755
--- a/.xprofile
+++ b/.xprofile
@@ -1,22 +1,12 @@
-#!/bin/zsh
-systemctl --user import-environment DISPLAY
-
-export _JAVA_AWT_WM_NONREPARENTING=1
-export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on'
-export _JAVA_OPTIONS='-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
-export TZ='Europe/Amsterdam'
-
-xrandr --dpi 92
+#!/bin/sh
+. ~/.profile
-if [ -d /etc/X11/xinit/xinitrc.d ] ; then
- for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
- [ -x "$f" ] && . "$f"
- done
- unset f
-fi
+systemctl --user import-environment DISPLAY
+xrdb -merge "$XDG_CONFIG_HOME/X11/base"
# https://github.com/swaywm/sway/wiki#gtk-applications-take-20-seconds-to-start
dbus-update-activation-environment --systemd DISPLAY
+
i3
diff --git a/.zshenv b/.zshenv
new file mode 120000
index 0000000..aa7da3a
--- /dev/null
+++ b/.zshenv
@@ -0,0 +1 @@
+.profile \ No newline at end of file
diff --git a/.zshrc b/.zshrc
index a9550ff..494b93f 100644
--- a/.zshrc
+++ b/.zshrc
@@ -4,66 +4,23 @@ zstyle ':omz:update' mode reminder
plugins=(
git
zsh-syntax-highlighting
- )
+)
# oh-my-zsh
export ZSH="$HOME/.local/share/oh-my-zsh"
source $ZSH/oh-my-zsh.sh
-# esp8266 rtos sdk
-export IDF_PATH="/opt/ESP8266_RTOS_SDK/"
-
# shift-tab fix
bindkey '^[[Z' reverse-menu-complete
+# zsh autocompletion
compinit -D
-# ueberzug
-source "`ueberzug library`"
-
-# fontpreview
-export FONTPREVIEW_BG_COLOR=$(xrdb -query | grep background | cut -f2)
-export FONTPREVIEW_FG_COLOR=$(xrdb -query | grep foreground | cut -f2)
-
-# aliases
-alias reload="sudo systemctl restart lightdm"
-alias cls="clear"
-alias timesync="sudo ntpd -qg && sudo hwclock --systohc"
-alias vim="nvim"
-alias copy="xclip -selection c"
-alias clipout="xclip -selection c -out"
-alias ncp="ncmpcpp"
-alias dnd="dragon-drag-and-drop -a -x"
-alias scdl="scdl --onlymp3 -l"
-alias screenrecord='giph -f 60 -s -b 4 -c 255,255,255 $(date +"$HOME/%Y-%m-%d_%H-%M-%S.mp4")'
-alias deemix="deemix -b FLAC -p ~/dl"
-alias docxtopdf="soffice --headless --convert-to pdf"
-alias fd='cd "`find . -type d | fzf`"'
-
+# evaluate math expression in python by running `= <expr>`
function = () { python3 -c "from math import *; deg = pi / 180; print($*)" }
aliases[=]="noglob ="
alias 16="python3 -c 'import sys;print(f\"{int(sys.stdin.read().strip()):x}\")'"
-# one letters
-alias r="ranger"
-alias v="nvim"
-alias l="less"
-alias m="neomutt"
-alias mk="make"
-alias y="yay"
-alias n="ncmpcpp"
-alias c="khal"
-
-# the fuck
-eval $(thefuck --alias)
-
-# bat
-alias bat="bat -pp --theme=base16"
-
# cleanup
rm -rf ~/.xsession-errors ~/.xsession-errors.old ~/.zshrc.zwc ~/.lesshst ~/.lyrics ~/.android ~/.zcalc_history .git-credentials .node_repl_history .python_history
-alias nvidia-settings=nvidia-settings --config="$XDG_CONFIG_HOME"/nvidia/settings
-alias gpg2="gpg2 --homedir $XDG_DATA_HOME/gnupg"
-# conda
-# . "/opt/f4pga/xc7/conda/etc/profile.d/conda.sh"