From 71b5fe99777ce96b5e970c6a4a085c212c3de520 Mon Sep 17 00:00:00 2001 From: Agnosto Dvonik Date: Sat, 1 Oct 2022 18:16:21 -0400 Subject: [PATCH] init --- .Xdefaults | 35 ++++++++++++++ .config/lemonbar/main | 11 +++++ .config/lemonbar/main.sh | 41 ++++++++++++++++ .config/zathura/zathurarc | 9 ++++ .cwmrc | 51 ++++++++++++++++++++ .exrc | 9 ++++ .gitconfig | 5 ++ .mutt/muttrc | 25 ++++++++++ .profile | 35 ++++++++++++++ .xsession | 16 +++++++ README | 15 ++++++ bin/randfile | 27 +++++++++++ bin/ufetch | 80 ++++++++++++++++++++++++++++++++ bin/ufetch.LICENSE | 13 ++++++ fsroot/etc/X11/xenodm/Xresources | 28 +++++++++++ fsroot/etc/X11/xenodm/Xsession | 77 ++++++++++++++++++++++++++++++ fsroot/etc/X11/xenodm/Xsetup_0 | 15 ++++++ fsroot/etc/apm/resume | 3 ++ fsroot/etc/apm/suspend | 3 ++ fsroot/etc/rc.conf.local | 4 ++ 20 files changed, 502 insertions(+) create mode 100644 .Xdefaults create mode 100755 .config/lemonbar/main create mode 100755 .config/lemonbar/main.sh create mode 100644 .config/zathura/zathurarc create mode 100644 .cwmrc create mode 100644 .exrc create mode 100644 .gitconfig create mode 100644 .mutt/muttrc create mode 100644 .profile create mode 100644 .xsession create mode 100644 README create mode 100755 bin/randfile create mode 100755 bin/ufetch create mode 100644 bin/ufetch.LICENSE create mode 100644 fsroot/etc/X11/xenodm/Xresources create mode 100755 fsroot/etc/X11/xenodm/Xsession create mode 100755 fsroot/etc/X11/xenodm/Xsetup_0 create mode 100755 fsroot/etc/apm/resume create mode 100755 fsroot/etc/apm/suspend create mode 100644 fsroot/etc/rc.conf.local diff --git a/.Xdefaults b/.Xdefaults new file mode 100644 index 0000000..e06cb14 --- /dev/null +++ b/.Xdefaults @@ -0,0 +1,35 @@ +! $OpenBSD: dot.Xdefaults,v 1.3 2014/07/10 10:22:59 jasper Exp $ + +XTerm.termName: xterm-256color +XTerm*loginShell:true +XTerm*font: xft:Anonymous Pro:size=12 +XTerm*scrollBar:false +XTerm*utf8:true +XTerm*internalBorder: 12 + +XTerm.vt100.translations: #override \n\ + Ctrl Shift C: copy-selection(CLIPBOARD) \n\ + Ctrl Shift V: insert-selection(CLIPBOARD) + +! hard contrast: *background: #1d2021 +! soft contrast: *background: #32302f + +*foreground: #ebdbb2 +*background: #282828 + +*color0: #282828 +*color1: #cc241d +*color2: #98971a +*color3: #d79921 +*color4: #458588 +*color5: #b16286 +*color6: #689d6a +*color7: #a89984 +*color8: #928374 +*color9: #fb4934 +*color10: #b8bb26 +*color11: #fabd2f +*color12: #83a598 +*color13: #d3869b +*color14: #8ec07c +*color15: #ebdbb2 diff --git a/.config/lemonbar/main b/.config/lemonbar/main new file mode 100755 index 0000000..803b768 --- /dev/null +++ b/.config/lemonbar/main @@ -0,0 +1,11 @@ +while true; do + me=$(echo "$USER@$(hostname)") + version=$(uname -rv) + date=$(date "+%Y-%m-%d %H:%M") + chkinet=$(ping -c 1 192.168.1.1 >/dev/null && echo "up" || echo "off") + used=$(vmstat | awk 'END {printf $3}' | tr -d "M") + batt=$(apm -l) + + echo " $date%{r}$me $version $chkinet $used $batt" + sleep 1 +done diff --git a/.config/lemonbar/main.sh b/.config/lemonbar/main.sh new file mode 100755 index 0000000..b439005 --- /dev/null +++ b/.config/lemonbar/main.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# +# dvonik's main.sh for lemonbar +# public domain +# + +mem() { + used="$(vmstat | awk 'END {printf $3}' | tr -d "M")" + all="$(( $(sysctl -n hw.physmem) / 1024 / 1024 ))" + echo "$used/$all" +} + +net() { + ip="216.21.3.77" + ping -s 2 -c 1 "$ip" > "/dev/null" & pid=$! # ip for openbsd + wait "$pid"; status="$?" + + case "$status" in + (0) echo "on"; ;; + (*) echo "off"; ;; + esac +} + +battery() { + case "$(apm -b)" in + (0) stat="+!"; ;; + (1) stat="-!"; ;; + (2) stat="--"; ;; + (3) stat="++"; ;; + esac + + echo "$(apm -l)% $stat" +} + +bg=111314 +fg=b7bbb7 +main() { + echo "%{F#$fg} $(date "+%F %H:%M %Z") %{r}$(uname -r) [$(uname -v)] $(net) [$(battery)] $(mem) " +} + +while true; do main; sleep 5; done diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc new file mode 100644 index 0000000..b4a111f --- /dev/null +++ b/.config/zathura/zathurarc @@ -0,0 +1,9 @@ +set font "Anonymous Pro 12" +set adjust-open "width" +set pages-per-row 1 +set default-fg "#ebdbb2" +set default-bg "#282828" +set statusbar-fg "#ebdbb2" +set statusbar-bg "#282828" +set inputbar-fg "#ebdbb2" +set inputbar-bg "#282828" diff --git a/.cwmrc b/.cwmrc new file mode 100644 index 0000000..6de5c22 --- /dev/null +++ b/.cwmrc @@ -0,0 +1,51 @@ +fontname "Anonymous Pro:size=12" + +ignore bar +autogroup 0 bar + +sticky yes + +borderwidth 2 + +color font "#ebdbb2" +color selfont "#282828" +color menufg "#ebdbb2" +color menubg "#282828" +color activeborder "#ebdbb2" +color inactiveborder "#928374" + +command lock slock + +command Terminal xterm +command Browser firefox +command "School Browser" "firefox -P school" +command "Tor Browser" tor-browser +command Lock slock +command Logout "pkill cwm" + +bind-key 4S-Return terminal +bind-key 4S-b firefox +bind-key 4S-t tor-browser +bind-key 4S-s "firefox -P school" # s for school/soy/suck/sad :( +bind-key 4S-Tab lock + +bind-key MS-r restart +bind-key MS-q quit + +bind-key CM-k window-cycle +bind-key CM-j window-rcycle +bind-key CM-w window-close +bind-key CM-m window-maximize +bind-key CM-f window-fullscreen + +bind-key C-1 group-only-1 +bind-key C-2 group-only-2 +bind-key C-3 group-only-3 + +bind-key CM-1 window-movetogroup-1 +bind-key CM-2 window-movetogroup-2 +bind-key CM-3 window-movetogroup-3 + +bind-mouse 4-1 window-move +bind-mouse 4-2 window-lower +bind-mouse 4-3 window-resize diff --git a/.exrc b/.exrc new file mode 100644 index 0000000..f469c36 --- /dev/null +++ b/.exrc @@ -0,0 +1,9 @@ +set autoindent +set beautify +set extended +set iclower +set report=1 +set ruler +set searchincr +set terse +set verbose diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..b561d09 --- /dev/null +++ b/.gitconfig @@ -0,0 +1,5 @@ +[user] + name = Agnosto Dvonik + email = dvonik@rslp.org +[init] + defaultBranch = trunk diff --git a/.mutt/muttrc b/.mutt/muttrc new file mode 100644 index 0000000..9871f7c --- /dev/null +++ b/.mutt/muttrc @@ -0,0 +1,25 @@ +set from = "dvonik@rslp.org" +set realname = "Agnosto Dvonik" +set imap_user = "dvonik" +set folder = "imaps://mail.rslp.org:993" +set smtp_url = "smtp://dvonik@mail.rslp.org:587/" +set spoolfile = "+INBOX" +set header_cache = ~/.mutt/cache/headers +set message_cachedir = ~/.mutt/cache/bodies +set certificate_file = ~/.mutt/certificates +set move = no +set imap_keepalive = 900 + +set pgp_use_gpg_agent = yes +set pgp_sign_as = 231E067D4E995977D82EAAF02E71AADAE25FA0EE +set pgp_timeout = 3600 +set crypt_autosign = yes +set crypt_replyencrypt = yes + +set status_format="" +color normal default default +color quoted green default +color status brightwhite black + +source "/usr/local/share/examples/mutt/gpg.rc" +source "gpg -d ~/.mutt/passwd.gpg |" diff --git a/.profile b/.profile new file mode 100644 index 0000000..c565be8 --- /dev/null +++ b/.profile @@ -0,0 +1,35 @@ +# $OpenBSD: dot.profile,v 1.7 2020/01/24 02:09:51 okan Exp $ +# +# sh/ksh initialization +# dvonik 20220412 +# + +case $TERM in +rxvt*|st*|xterm*) LANG="en_US.UTF-8"; ;; +vt*) LANG="C"; ;; +esac + +CVSROOT="$HOME/cvs" +HISTFILE="$HOME/.history" +HISTSIZE=64 +PATH=":$HOME/bin:$HOME/.local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:" +export PATH HOME LANG EDITOR CVSROOT HISTFILE HISTSIZE + +[ -e "Downloads" ] && rm -rf "Downloads" +[ -e "Desktop" ] && rm -rf "Desktop" + +alias mkdir="mkdir -p" +alias rm="rm -P" + +fenc() { + openssl enc -aes-256-cbc -in $1 -out $2 +} + +denc() { + openssl enc -d -aes-256-cbc -in $1 -out $2 +} + +# done + +fortune +biff y diff --git a/.xsession b/.xsession new file mode 100644 index 0000000..b65b40e --- /dev/null +++ b/.xsession @@ -0,0 +1,16 @@ +#!/bin/sh +# +# dvonik's .xsession +# public domain +# + +export GTK_THEME=Adwaita:dark +export LANG="en_US.UTF-8" + +xidle -program "/usr/sbin/zzz" -timeout 600 & +picom --backend glx --xrender-sync-fence --glx-no-stencil --glx-no-rebind-pixmap --vsync -f -I 0.2 -O 0.2 -c & +xwallpaper --zoom "$HOME/share/pic/wall/lucabravo-A-fubu9QJxE-unsplash.jpg" +sct 3750 & +"$HOME/.config/lemonbar/main" | lemonbar-xft -g 1920x25 -B "#282828" -F "#ebdbb2" -f "Anonymous Pro:size=12" & + +exec cwm diff --git a/README b/README new file mode 100644 index 0000000..74ca55e --- /dev/null +++ b/README @@ -0,0 +1,15 @@ +hello CVS rslp.org + +dotfiles +-------- +* apm +* cwm +* picom +* init +* lemonbar +* ufetch +* vi +* xenodm +* xterm +* xwallpaper +* zathura diff --git a/bin/randfile b/bin/randfile new file mode 100755 index 0000000..1a7fcf7 --- /dev/null +++ b/bin/randfile @@ -0,0 +1,27 @@ +#!/bin/ksh +# +# dvonik's random file grabber +# +# in public domain +# + +# randomise files +randomise() { + count=1 + + for i in $(find "$1" 2> "/dev/null"); do + arr[$count]="$i" + count="$(( count + 1 ))" + done + + size="${#arr[@]}" + index="$(( RANDOM % size ))" + echo "${arr[$index]}" +} + +[ ! -e "$1" ] && { + echo "$0: $1: no such file or directory" > "/dev/stderr" + exit 1 +} + +randomise "$1" diff --git a/bin/ufetch b/bin/ufetch new file mode 100755 index 0000000..f3aca51 --- /dev/null +++ b/bin/ufetch @@ -0,0 +1,80 @@ +#!/bin/sh +# +# ufetch-openbsd - tiny system info for openbsd + +## INFO + +# user is already defined +host="$(hostname)" +os="$(uname -sr)" +kernel="$(uname -v)" +uptime="$(uptime | awk -F, '{sub(".*up ",x,$1);print $1}' | sed -e 's/^[ \t]*//')" +packages="$(ls -d /var/db/pkg/* | wc -l | sed -e 's/^[ \t]*//')" +shell="$(basename "${SHELL}")" + +## UI DETECTION + +parse_rcs() { + for f in "${@}"; do + wm="$(tail -n 1 "${f}" 2> /dev/null | cut -d ' ' -f 2)" + [ -n "${wm}" ] && echo "${wm}" && return + done +} + +rcwm="$(parse_rcs "${HOME}/.xinitrc" "${HOME}/.xsession")" + +ui='unknown' +uitype='UI' +if [ -n "${DE}" ]; then + ui="${DE}" + uitype='de' +elif [ -n "${WM}" ]; then + ui="${WM}" + uitype='wm' +elif [ -n "${XDG_CURRENT_DESKTOP}" ]; then + ui="${XDG_CURRENT_DESKTOP}" + uitype='de' +elif [ -n "${DESKTOP_SESSION}" ]; then + ui="${DESKTOP_SESSION}" + uitype='de' +elif [ -n "${rcwm}" ]; then + ui="${rcwm}" + uitype='wm' +elif [ -n "${XDG_SESSION_TYPE}" ]; then + ui="${XDG_SESSION_TYPE}" +fi + +ui="$(basename "${ui}")" + +## DEFINE COLORS + +# probably don't change these +if [ -x "$(command -v tput)" ]; then + bold="$(tput bold)" + black="$(tput setaf 0 0 0 2>/dev/null)" + red="$(tput setaf 1 0 0 2>/dev/null)" + green="$(tput setaf 2 0 0 2>/dev/null)" + yellow="$(tput setaf 3 0 0 2>/dev/null)" + blue="$(tput setaf 4 0 0 2>/dev/null)" + magenta="$(tput setaf 5 0 0 2>/dev/null)" + cyan="$(tput setaf 6 0 0 2>/dev/null)" + white="$(tput setaf 7 0 0 2>/dev/null)" + reset="$(tput sgr0)" +fi + +# you can change these +c1="${reset}${bold}${white}" # second color + +## OUTPUT + +cat < + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/fsroot/etc/X11/xenodm/Xresources b/fsroot/etc/X11/xenodm/Xresources new file mode 100644 index 0000000..c1aa17a --- /dev/null +++ b/fsroot/etc/X11/xenodm/Xresources @@ -0,0 +1,28 @@ +! $OpenBSD: Xresources.in,v 1.3 2020/06/28 15:38:34 matthieu Exp $ +! +! dvonik 20220412 +! + +! zakaria.org's fail message is the best, and i cannot possibly replace it +xlogin.Login.fail: ya dun goofed +xlogin.Login.greeting: + +xlogin*borderWidth: 0 +xlogin.Login.height: 200 +xlogin.Login.width: 400 +xlogin.Login.y: 320 +xlogin.Login.frameWidth: 10 +xlogin.Login.innerFramesWidth: 0 +xlogin.Login.sepWidthz: 0 + +xlogin.Login.background: #282828 +xlogin.Login.foreground: #ebdbb2 +xlogin.Login.failColor: #cc231d +xlogin.Login.inpColor: #282828 +xlogin.Login.promptColor: #ebdbb2 +xlogin.Login.hiColor: #282828 +xlogin.Login.shdColor: #282828 + +xlogin.Login.face: Anonymous Pro-12 +xlogin.Login.failFace: Anonymous Pro-12 +xlogin.Login.promptFace: Anonymous Pro-12 diff --git a/fsroot/etc/X11/xenodm/Xsession b/fsroot/etc/X11/xenodm/Xsession new file mode 100755 index 0000000..626dd25 --- /dev/null +++ b/fsroot/etc/X11/xenodm/Xsession @@ -0,0 +1,77 @@ +#!/bin/sh +# +# $OpenBSD: Xsession.in,v 1.2 2022/07/01 20:42:06 naddy Exp $ +prefix="/usr/X11R6" +exec_prefix="${prefix}" + +# redirect errors to a file in user's home directory if we can + +errfile="$HOME/.xsession-errors" +if ( umask 077 && cp /dev/null "$errfile" 2> /dev/null ) +then + exec > "$errfile" 2>&1 +else + for errfile in "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER" + do + if ef="$( umask 077 && mktemp "$errfile.XXXXXX" 2> /dev/null)" + then + exec > "$ef" 2>&1 + mv "$ef" "$errfile" 2> /dev/null + break + fi + done +fi + +# if we have private ssh key(s), start ssh-agent and add the key(s) +id1=$HOME/.ssh/identity +id2=$HOME/.ssh/id_dsa +id3=$HOME/.ssh/id_rsa +id4=$HOME/.ssh/id_ecdsa +id5=$HOME/.ssh/id_ed25519 + +# if [ -z "$SSH_AGENT_PID" ]; +# then +# if [ -x /usr/bin/ssh-agent ] && [ -f $id1 -o -f $id2 -o -f $id3 -o -f $id4 -o -f $id5 ]; +# then +# eval `ssh-agent -s` +# ssh-add < /dev/null +# fi +# fi +# +# do_exit() { +# if [ "$SSH_AGENT_PID" ]; then +# ssh-add -D < /dev/null +# eval `ssh-agent -s -k` +# fi +# exit +# } + +case $# in +1) + case $1 in + failsafe) + ${exec_prefix}/bin/xterm -geometry 80x24-0-0 + do_exit + ;; + esac +esac + +# The startup script is not intended to have arguments. + +startup=$HOME/.xsession +resources=$HOME/.Xresources + +if [ -s "$startup" ]; then + if [ -x "$startup" ]; then + "$startup" + else + /bin/sh "$startup" + fi +else + if [ -f "$resources" ]; then + /usr/X11R6/bin/xrdb -load "$resources" + fi + ${exec_prefix}/bin/xterm & + ${exec_prefix}/bin/fvwm +fi +do_exit diff --git a/fsroot/etc/X11/xenodm/Xsetup_0 b/fsroot/etc/X11/xenodm/Xsetup_0 new file mode 100755 index 0000000..75d7cfe --- /dev/null +++ b/fsroot/etc/X11/xenodm/Xsetup_0 @@ -0,0 +1,15 @@ +#!/bin/sh +# +# $OpenBSD: Xsetup_0.in,v 1.1 2021/08/30 15:38:27 matthieu Exp $ +# +# dvonik 20220412 +# + +/usr/local/bin/sct 3750 +/usr/X11R6/bin/xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation" 1 +/usr/X11R6/bin/xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Button" 2 +/usr/X11R6/bin/xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Axes" 6 7 4 5 +/usr/X11R6/bin/xinput set-prop "/dev/wsmouse" "Device Accel Constant Deceleration" 0.5 + +/usr/X11R6/bin/xrandr --dpi 96 +/usr/X11R6/bin/xsetroot -solid \#282828 diff --git a/fsroot/etc/apm/resume b/fsroot/etc/apm/resume new file mode 100755 index 0000000..d6f2f5c --- /dev/null +++ b/fsroot/etc/apm/resume @@ -0,0 +1,3 @@ +#!/bin/sh + +sync diff --git a/fsroot/etc/apm/suspend b/fsroot/etc/apm/suspend new file mode 100755 index 0000000..9d36537 --- /dev/null +++ b/fsroot/etc/apm/suspend @@ -0,0 +1,3 @@ +#!/bin/sh + +pkill -USR1 xidle diff --git a/fsroot/etc/rc.conf.local b/fsroot/etc/rc.conf.local new file mode 100644 index 0000000..4647f13 --- /dev/null +++ b/fsroot/etc/rc.conf.local @@ -0,0 +1,4 @@ +apmd_flags=-Az 10 +smtpd_flags=NO +sshd_flags=NO +xenodm_flags=