dotfiles

Dash Eclipse's dotfiles
git clone git://ezup.dev/dotfiles.git
Log | Files | Refs | README | LICENSE

commit 8c08f637da7f238c38126fa295eacf1c948a3fab
parent 7eb610a2313e9a8f2b0e24c0305420e1ffb8bfe5
Author: Dash Eclipse <dash@ezup.dev>
Date:   Sat,  3 Oct 2020 23:39:29 +0000

Add sxrc and zshrc.local

Diffstat:
A.config/sx/sxrc | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.zshrc.local | 20++++++++++++++++++++
2 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/.config/sx/sxrc b/.config/sx/sxrc @@ -0,0 +1,66 @@ +#!/bin/sh + +#start-pulseaudio-x11 & +#eval "$(dbus-launch --sh-syntax --exit-with-session)" +#XCURSOR_THEME=DMZBlackLH +#xinput set-button-map 9 3 2 1 +#xinput set-prop 9 'libinput Accel Speed' -0.3 + +run_dwm() { + #xsetroot -solid "#333333" + xrdb $HOME/.Xresources + feh --randomize \ + --bg-scale $HOME/Pictures/Wallpapers/Landscape/*.jpg \ + --bg-scale $HOME/Pictures/Wallpapers/Portrait/*.jpg + xsidle.sh slock & + dwm_update_status.sh 2>&1 >/dev/null & + #fcitx & + exec dwm +} + +run_bspwm() { + xrdb $HOME/.Xresources + feh --randomize \ + --bg-scale $HOME/Pictures/Wallpapers/Landscape/*.jpg \ + --bg-scale $HOME/Pictures/Wallpapers/Portrait/*.jpg + sxhkd & + exec bspwm +} + +run_2bwm() { + xrdb $HOME/.Xresources + feh --randomize \ + --bg-scale $HOME/Pictures/Wallpapers/Landscape/*.jpg \ + --bg-scale $HOME/Pictures/Wallpapers/Portrait/*.jpg + #setxkbmap us dvp + #setxkbmap -layout us -variant dvp -option compose:102 -option numpad:shift3 -option kpdl:semi -option keypad:atm -option caps:shift + ~/.local/bin/lemon2bstatus.sh & + exec 2bwm + +} + +run_sowm() { + xrdb $HOME/.Xresources + feh --randomize \ + --bg-scale $HOME/Pictures/Wallpapers/Landscape/*.jpg \ + --bg-scale $HOME/Pictures/Wallpapers/Portrait/*.jpg + exec sowm +} + + +export SESSION=${1:-dwm} + +case $SESSION in + dwm ) run_dwm;; + bspwm ) run_bspwm;; + openbox ) exec openbox-session;; + lxqt ) exec startlxqt;; + xmonad ) exec xmonad;; + xfce ) exec startxfce4;; + budgie ) exec budgie-desktop;; + gnome ) exec gnome-session;; + 2bwm ) run_2bwm;; + sowm ) run_sowm;; + * ) exec $SESSION;; +esac + diff --git a/.zshrc.local b/.zshrc.local @@ -0,0 +1,20 @@ +x() { echo "which session?"; read && sx $HOME/.config/sx/sxrc $REPLY; } + +# memory usage +memu() { + local CHECK=" $@" + [ -z $1 ] || [ "${CHECK#* -}" != "$CHECK" ] && { echo "Usage: memu program [program...]"; return 1; } + local PIDS=$(pidof "$@") + test -z "$PIDS" && return 0 + echo "$PIDS" \ + | xargs -I{} ps -p "{}" -o size,vsize,rss,cmd \ + | awk 'NR==1; NR>1 {print $1"K", $2"Ki", $3"K", $4}' \ + | numfmt --header --field 1,3 --from=si --to=si --suffix=B --format %.1f \ + | numfmt --header --field 2 --from=iec-i --to=iec-i --suffix=B --format %.1f \ + | sort -hk3,3 \ + | column -t -R1,2,3 \ + | GREP_COLORS='mt=1;94' egrep --color=always '.*SIZE.*VSZ.*RSS.*CMD.*|$' \ + | GREP_COLORS='mt=1;32' egrep --color=always "KB|KiB|$" \ + | GREP_COLORS='mt=0;33' egrep --color=always 'MB|MiB|$' \ + | GREP_COLORS='mt=1;31' egrep --color=always "GB|GiB|$" +}