1
0
Fork 0
This commit is contained in:
Luca Bilke 2023-06-07 00:08:36 +02:00
commit ca024de304
19 changed files with 88 additions and 75 deletions

View file

@ -1,7 +1,8 @@
#!/bin/sh -x
#!/bin/sh
X11_CONFIG="$XDG_CONFIG_HOME/X11"
SESSIONFILES=$(run-parts --list "$X11_CONFIG/xsession.d")
SESSIONDIR="$XDG_CONFIG_HOME/X11/xsession.d"
SESSIONFILES=$(run-parts --list $SESSIONDIR)
if [ -n "$SESSIONFILES" ]; then
set +e
for SESSIONFILE in $SESSIONFILES; do
@ -11,6 +12,6 @@ if [ -n "$SESSIONFILES" ]; then
set -e
fi
. "$XDG_CONFIG_HOME/X11/xprofile"
. "$X11_CONFIG/xprofile"
exec dwm

View file

@ -7,3 +7,4 @@ export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme.
export SUDO_ASKPASS="$dmenupasspath"
export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads.
export AWT_TOOLKIT="MToolkit wmname LG3D" #May have to install wmname
export ERRFILE="$XDG_CACHE_HOME/X11/xsession-errors"

View file

@ -11,7 +11,7 @@ map gdm cd "/home/luca/Documents"
map gms cd "/home/luca/Music"
map gpc cd "/home/luca/Pictures"
map gvd cd "/home/luca/Videos"
map gdot cd "/home/luca/.dotfiles"
map gdot cd "/home/luca/.local/share/stow/dots"
map Ebf $$EDITOR "/home/luca/.config/shell/bm-files"
map Ebd $$EDITOR "/home/luca/.config/shell/bm-dirs"
map Ecfx $$EDITOR "/home/luca/.config/x11/xresources"

View file

@ -12,5 +12,4 @@ dm ${XDG_DOCUMENTS_DIR:-$HOME/Documents}
ms ${XDG_MUSIC_DIR:-$HOME/Music}
pc ${XDG_PICTURES_DIR:-$HOME/Pictures}
vd ${XDG_VIDEOS_DIR:-$HOME/Videos}
dot $HOME/.dotfiles
dot $STOW_DIR/dots

View file

@ -1,6 +1,9 @@
#!/bin/zsh
# profile file. Runs on login. Environmental variables are set here.
# If you don't want this in your home directory, execute this command and move this file
# echo 'export ZDOTDIR="$HOME/.config/zsh"' | sudo tee -a /etc/zsh/zshenv
export EDITOR="nvim"
export TERMINAL="kitty"
export BROWSER="firefox"
@ -59,7 +62,8 @@ export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc"
export DOTFILES_DIR="$HOME/.dotfiles"
export STOW_DIR="$XDG_DATA_HOME/stow"
export DOTS_DIR="$STOW_DIR/dots"
export ZSH_COMPDUMP="$XDG_CACHE_HOME/zcompdump"
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config"
@ -67,7 +71,6 @@ export GTK2_RC_FILES="$XDG_CONFIG_HOME/.config}/gtk-2.0/gtkrc-2.0"
export LESSHISTFILE="-"
export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc"
export INPUTRC="$XDG_CONFIG_HOME/shell/inputrc"
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default"
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
@ -85,6 +88,7 @@ export NODE_REPL_HISTORY="$XDG_DATA_HOME/node_repl_history"
export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv"
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java"
export MOZBUILD_STATE_PATH="$XDG_DATA_HOME/mozbuild"
export W3M_DIR="$XDG_DATA_HOME"/w3m
localpath="$(find -L ~/.local/bin -type d -printf %p: | sed 's/.$//')"
export PATH="$PATH:$HOME/.local/share/npm-global/bin:$localpath"
@ -100,5 +104,5 @@ fi
gpgconf --launch gpg-agent
if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then
exec startx
exec startx $XINITRC
fi

View file

@ -1,4 +1,3 @@
# vim: filetype=zsh
hash -d h=/home/luca
hash -d ch=/home/luca/.cache
hash -d cf=/home/luca/.config
@ -12,7 +11,7 @@ hash -d dm=/home/luca/Documents
hash -d ms=/home/luca/Music
hash -d pc=/home/luca/Pictures
hash -d vd=/home/luca/Videos
hash -d dot=/home/luca/.dotfiles
hash -d dot=/home/luca/.local/share/stow/dots
hash -d bf=/home/luca/.config/shell/bm-files
hash -d bd=/home/luca/.config/shell/bm-dirs
hash -d cfx=/home/luca/.config/x11/xresources

View file

@ -1,18 +1,18 @@
# vim: filetype=zsh
alias h="cd /home/luca && tput cuu1;tput el" \
ch="cd /home/luca/.cache && tput cuu1;tput el" \
cf="cd /home/luca/.config && tput cuu1;tput el" \
dt="cd /home/luca/.local/share && tput cuu1;tput el" \
sr="cd /home/luca/.local/src && tput cuu1;tput el" \
it="cd /home/luca/.local/src/git && tput cuu1;tput el" \
sc="cd /home/luca/.local/bin && tput cuu1;tput el" \
mn="cd /mnt && tput cuu1;tput el" \
dl="cd /home/luca/Downloads && tput cuu1;tput el" \
dm="cd /home/luca/Documents && tput cuu1;tput el" \
ms="cd /home/luca/Music && tput cuu1;tput el" \
pc="cd /home/luca/Pictures && tput cuu1;tput el" \
vd="cd /home/luca/Videos && tput cuu1;tput el" \
dot="cd /home/luca/.dotfiles && tput cuu1;tput el" \
# vim: filetype=sh
alias h="cd /home/luca" \
ch="cd /home/luca/.cache" \
cf="cd /home/luca/.config" \
dt="cd /home/luca/.local/share" \
sr="cd /home/luca/.local/src" \
it="cd /home/luca/.local/src/git" \
sc="cd /home/luca/.local/bin" \
mn="cd /mnt" \
dl="cd /home/luca/Downloads" \
dm="cd /home/luca/Documents" \
ms="cd /home/luca/Music" \
pc="cd /home/luca/Pictures" \
vd="cd /home/luca/Videos" \
dot="cd /home/luca/.local/share/stow/dots" \
bf="$EDITOR /home/luca/.config/shell/bm-files" \
bd="$EDITOR /home/luca/.config/shell/bm-dirs" \
cfx="$EDITOR /home/luca/.config/x11/xresources" \

2
.gitignore vendored
View file

@ -4,3 +4,5 @@
.config/gtk-2.0/gtkfilechooser.ini
.local/share/firefox/user.js
.local/share/firefox/userjs_backups
.local/share/fonts/.uuid

View file

@ -6,9 +6,9 @@ BLUE='\033[34m'
RED='\033[31m'
NC='\033[0m'
printf "%b" "$BOLD${BLUE}Changing directory to $DOTFILES_DIR$NC\n"
if ! cd "$DOTFILES_DIR"; then
printf "%b" "${RED}Could not CD into $DOTFILES_DIR$NC\n"
printf "%b" "$BOLD${BLUE}Changing directory to $DOTS_DIR$NC\n"
if ! cd "$DOTS_DIR"; then
printf "%b" "${RED}Could not CD into $DOTS_DIR$NC\n"
exit
fi
printf "\n"
@ -35,18 +35,18 @@ unmerged_files=$(git diff --name-only --diff-filter=U)
if [ -n "$unmerged_files" ]; then
printf "%b" "${RED}The following files have merge conflicts after popping the stash:$NC\n"
printf "\n"
printf "$unmerged_files\n"
printf "%s" "$unmerged_files\n"
else
stow --dotfiles -t "$HOME" . || printf "%b" "${RED}Failed to run stow!$NC\n"
stow -R -t "$HOME" dots || printf "%b" "${RED}Failed to run stow!$NC\n"
fi
printf "%b" "$BOLD${BLUE}Generating firefox profiles...$NC\n\n"
"$DOTFILES_DIR/.mozilla/firefox/generate.sh"
"$DOTS_DIR/.mozilla/firefox/generate.sh"
printf "\n"
printf "${BOLD}Recompile/Install src files? ${GREEN}Y/N?$NC\n"
read ans
[ "$ans" = "y" ] && for f in "$DOTFILES_DIR"/.local/src/*; do
printf "%b" "${BOLD}Recompile/Install src files? ${GREEN}Y/N?$NC\n"
read -r ans
[ "$ans" = "y" ] && for f in "$DOTS_DIR"/.local/src/*; do
if ! cd "$f"; then
printf "%b" "${RED}Could not CD into $f$NC\n"
exit

View file

@ -1,8 +1,8 @@
#!/bin/sh
# Inputs
bmdirs="$XDG_DATA_HOME/bookmarks/dirs"
bmfiles="$XDG_DATA_HOME/bookmarks/files"
bmdirs="$XDG_CONFIG_HOME/shell/dir-bookmarks"
bmfiles="$XDG_CONFIG_HOME/shell/file-bookmarks"
# Outputs
shell_shortcuts="$ZDOTDIR/configs/autogenerated/shortcuts"
@ -17,7 +17,7 @@ printf "# vim: filetype=sh\\nalias " >"$shell_shortcuts"
# Format the `directories` file in the correct syntax and sent it to all three configs.
eval "echo \"$(cat "$bmdirs")\"" | awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
printf(\"%s=\42cd %s && tput cuu1;tput el\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
printf(\"%s=\42cd %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
printf(\"map g%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ;
printf(\"%s\n\",\$2) >> \"$lf_dirs\" }"

34
.local/bin/statusbar/sb-cpu Executable file
View file

@ -0,0 +1,34 @@
#!/bin/sh
reset="\033[0m"
normal="\033[10m"
big="\033[11m"
red="\033[31m"
green="\033[32m"
orange="\033[33m"
cache=/tmp/cpubarscache
temp=$(sensors | awk '/CPU/ {print $2}' | tr -d "+")
stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat)
[ ! -f $cache ] && echo "$stats" >"$cache"
old=$(cat "$cache")
printf "%b" "$big﬙$normal $temp "
echo "$stats" | while read -r row; do
id=${row%% *}
rest=${row#* }
total=${rest%% *}
idle=${rest##* }
case "$(echo "$old" | awk '{if ($1 == id)
printf "%d\n", (1 - (idle - $3) / (total - $2))*100 /12.5}' \
id="$id" total="$total" idle="$idle")" in
"0") printf "%b" "$green▁" ;;
"1") printf "%b" "$green▂" ;;
"2") printf "%b" "$green▃" ;;
"3") printf "%b" "$orange▄" ;;
"4") printf "%b" "$orange▅" ;;
"5") printf "%b" "$orange▆" ;;
"6" | "7" | "8") printf "%b" "$red▇" ;;
esac
done
printf "%b" "$reset\n"
echo "$stats" >"$cache"

View file

@ -1,10 +1,11 @@
#!/bin/sh
transmission-remote "$1" -l | grep % |
sed " # The letters are for sorting and will not appear.
s/.*Stopped.*/A /;
transmission-remote $@ -l -N "$XDG_CONFIG_HOME/netrc" | grep % |
# The letters are for sorting and will not appear. \
sed "
s/.*Stopped.*/A /;
s/.*Seeding.*/Z 﫠/;
s/.*100%.*/N 﫠/;
s/.*Idle.*/B ﭦ/;
s/.*Uploading.*/L /;
s/.*%.*/M /" |
sort -h | uniq -c | awk '{print $3 $1}' | paste -sd ' ' -
s/.*%.*/M /
" | sort -h | uniq -c | awk '{print $3 $1}' | paste -sd ' ' -

View file

@ -1,14 +0,0 @@
h $HOME
ch $XDG_CACHE_HOME
cf $XDG_CONFIG_HOME
dt $XDG_DATA_HOME
sr $HOME/.local/src
it $HOME/.local/src/git
sc $HOME/.local/bin
mn /mnt
dl $XDG_DOWNLOAD_DIR
dm $XDG_DOCUMENTS_DIR
ms $XDG_MUSIC_DIR
pc $XDG_PICTURES_DIR
vd $XDG_VIDEOS_DIR
dot $HOME/.dotfiles

View file

@ -1,13 +0,0 @@
bf $XDG_CONFIG_HOME/shell/bm-files
bd $XDG_CONFIG_HOME/shell/bm-dirs
cfx $XDG_CONFIG_HOME/x11/xresources
cfX $XDG_CONFIG_HOME/x11/xprofile
cfb $HOME/.local/src/dwmblocks/config.h
cfk $XDG_CONFIG_HOME/kitty/kitty.conf
cfK $XDG_CONFIG_HOME/kitty/kittyfullscreen.conf
cfv $XDG_CONFIG_HOME/lvim/config.lua
cfz $ZDOTDIR/.zshrc
cfa $XDG_CONFIG_HOME/shell/aliasrc
cfp $XDG_CONFIG_HOME/shell/profile
cfl $XDG_CONFIG_HOME/lf/lfrc
cfL $XDG_CONFIG_HOME/lf/preview

@ -1 +1 @@
Subproject commit c4c8faaaa1b03b087ece7d4f226c349693b47f58
Subproject commit ed4e20fe1fc8c72b94c8c38077e308388527786b

@ -1 +1 @@
Subproject commit 2a50821d8570b455298b402aecc50dcd839c2f36
Subproject commit 8605ef724062df44b837c6c9cb3c2e60d7fc2ef9

@ -1 +1 @@
Subproject commit 5394602f9cb29d041808572e8c448341bfefe337
Subproject commit c844a7936a592aad3693c09e65a4563d2ceba9f1

View file

@ -1 +0,0 @@
.config/zsh/profile