From ad53b986228720db2e9f0883291c23edaa6e36e4 Mon Sep 17 00:00:00 2001 From: tavo-wasd Date: Wed, 2 Aug 2023 18:12:10 -0600 Subject: [PATCH] xdg-base dir --- Xresources => X11/Xresources | 0 X11/xinitrc | 32 ++++++++++++++++++++++++++++++++ bashrc | 26 +++++++++++++++++--------- dunst/dunstrc | 2 +- scripts/dmenu-otp | 2 +- scripts/dmenu-pass | 2 +- scripts/sxiv-bkg | 2 +- 7 files changed, 53 insertions(+), 13 deletions(-) rename Xresources => X11/Xresources (100%) create mode 100644 X11/xinitrc diff --git a/Xresources b/X11/Xresources similarity index 100% rename from Xresources rename to X11/Xresources diff --git a/X11/xinitrc b/X11/xinitrc new file mode 100644 index 0000000..d29ba14 --- /dev/null +++ b/X11/xinitrc @@ -0,0 +1,32 @@ +#!/bin/sh + +userresources=$XDG_CONFIG_HOME/X11/Xresources +ERRFILE=$XDG_CACHE_HOME/X11/xsession-errors +usermodmap=$XDG_CONFIG_HOME/X11/Xmodmap +sysresources=/etc/X11/xinit/.Xresources +sysmodmap=/etc/X11/xinit/.Xmodmap + +# merge in defaults and keymaps +[ -f $sysresources ] && xrdb -merge $sysresources +[ -f $sysmodmap ] && xmodmap $sysmodmap +[ -f "$userresources" ] && xrdb -merge "$userresources" +[ -f "$usermodmap" ] && xmodmap "$usermodmap" + +[ -d /etc/X11/xinit/xinitrc.d ] && + for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do [ -x "$f" ] && . "$f" ; done && + unset f + +# Added xinitrc config +systemctl --user import-environment DISPLAY & +setxkbmap en & +xset r rate 300 50 & +hsetroot -cover /home/tavo/Media/Pictures/Backgrounds/71.jpg +dwmblocks & +clipmenud & +ps -C dunst | grep -q dunst || dunst & + +while true; do + dwm >/dev/null 2>&1 +done + +exec dwm diff --git a/bashrc b/bashrc index d545525..d9e6c8e 100644 --- a/bashrc +++ b/bashrc @@ -16,30 +16,38 @@ set -o vi # vi mode # $HOME cleanup export \ - LESSHISTFILE="$HOME/.local/share/lesshst" \ - VIMINIT="source $HOME/.config/vim/vimrc" \ - XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" \ - HISTFILE="$XDG_STATE_HOME/bash_history" \ - CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv \ XDG_STATE_HOME="$HOME/.local/state" \ XDG_CACHE_HOME="$HOME/.local/cache" \ XDG_DATA_HOME="$HOME/.local/share" \ XDG_CONFIG_HOME="$HOME/.config" \ + PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store" \ + GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0" \ + VIMINIT="source $XDG_CONFIG_HOME/vim/vimrc" \ + XSERVERRC="$XDG_CONFIG_HOME/X11/xserverrc" \ + XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" \ + HISTFILE="$XDG_STATE_HOME/bash_history" \ + XINITRC="$XDG_CONFIG_HOME/X11/xinitrc" \ + LESSHISTFILE="$XDG_DATA_HOME/lesshst" \ + WGETRC="$XDG_CONFIG_HOME/wget/wgetrc" \ + ELECTRUMDIR="$XDG_DATA_HOME/electrum" \ + CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv" \ + BASH_ENV="$XDG_CONFIG_HOME/bashrc" \ + GNUPGHOME="$XDG_DATA_HOME/gnupg" \ # Aliases alias \ - prt="cd $HOME/Pictures/Screenshots/ && ls" \ - bkg="cd $HOME/Pictures/Backgrounds/ && ls" \ + prt="cd $HOME/Media/Pictures/Screenshots/ && ls" \ + bkg="cd $HOME/Media/Pictures/Backgrounds/ && ls" \ + vid="cd $HOME/Media/Videos/ && ls" \ + img="cd $HOME/Media/Pictures/ && ls" \ tmp="cd $HOME/Desktop/temp/ && ls" \ www="cd $HOME/Desktop/www/ && ls" \ src="cd $HOME/.local/src/ && ls" \ doc="cd $HOME/Documents/ && ls" \ dow="cd $HOME/Downloads/ && ls" \ - img="cd $HOME/Pictures/ && ls" \ prj="cd $HOME/Projects/ && ls" \ dsk="cd $HOME/Desktop/ && ls" \ cfg="cd $HOME/.config/ && ls" \ - vid="cd $HOME/Videos/ && ls" \ mus="cd $HOME/Music/ && ls" \ ent="cd /mnt/Entr/ && ls" \ fzf-edit-script="fzf_nav /home/$(whoami)/.config/scripts" \ diff --git a/dunst/dunstrc b/dunst/dunstrc index 945676c..51d1d0a 100644 --- a/dunst/dunstrc +++ b/dunst/dunstrc @@ -2,7 +2,7 @@ monitor = 0 follow = none - width = (200, 600) + width = (200, 300) height = 200 origin = top-right offset = 36x48 diff --git a/scripts/dmenu-otp b/scripts/dmenu-otp index 5e9eff9..5bd5531 100755 --- a/scripts/dmenu-otp +++ b/scripts/dmenu-otp @@ -2,7 +2,7 @@ # OTP script for 'pass' # Ask for password name in vault -password=$(find ~/.password-store/ -type f -name '*.gpg' | sed 's/.*\/\(.*\)\.gpg$/\1/' | dmenu -i -p "OTP:") +password=$(find $XDG_DATA_HOME/password-store/ -type f -name '*.gpg' | sed 's/.*\/\(.*\)\.gpg$/\1/' | dmenu -i -p "OTP:") # Exit if none chosen [ -z "$password" ] && exit diff --git a/scripts/dmenu-pass b/scripts/dmenu-pass index 8718042..cf15c40 100755 --- a/scripts/dmenu-pass +++ b/scripts/dmenu-pass @@ -2,7 +2,7 @@ # Script for 'pass' # Ask for password name in vault -password=$(find ~/.password-store/ -type f -name '*.gpg' | +password=$(find $XDG_DATA_HOME/password-store/ -type f -name '*.gpg' | sed 's/.*\/\(.*\)\.gpg$/\1/' | dmenu -i -p "Password:") # Exit if none chosen diff --git a/scripts/sxiv-bkg b/scripts/sxiv-bkg index 04d6dc1..0c0aa1b 100755 --- a/scripts/sxiv-bkg +++ b/scripts/sxiv-bkg @@ -3,7 +3,7 @@ # Will display background chooser # and set it using hsetroot -img=$(find ~/Pictures/Backgrounds/* | shuf | sxiv -itoq | tail -1) +img=$(find ~/Media/Pictures/Backgrounds/* | shuf | sxiv -itoq | tail -1) # Exit if none chosen [ -z "$img" ] && exit