initial commit

This commit is contained in:
Nathan Dwarshuis 2021-02-15 20:53:16 -05:00
commit 6231ba8586
143 changed files with 32275 additions and 0 deletions

1
.chezmoiignore Normal file
View File

@ -0,0 +1 @@
Virtualbox.xml

34
VirtualBox.xml Normal file
View File

@ -0,0 +1,34 @@
<?xml version="1.0"?>
<!--
** DO NOT EDIT THIS FILE.
** If you make changes to this file while any VirtualBox related application
** is running, your changes will be overwritten later, without taking effect.
** Use VBoxManage or the VirtualBox Manager GUI to make changes.
-->
<VirtualBox xmlns="http://www.virtualbox.org/" version="1.12-linux">
<Global>
<ExtraData>
<ExtraDataItem name="GUI/Details/Elements" value="general,system,preview,display,storage,audio,network,usb,sharedFolders,description"/>
<ExtraDataItem name="GUI/GroupDefinitions/" value="n=GLOBAL,m=240651f8-4242-4dfb-bcd3-e78c7926b30d,m=cd2fec0c-f0ed-4835-b849-254e41e6e803,m=21cc0d91-59fa-4e4e-80ff-56a451fe551f"/>
<ExtraDataItem name="GUI/Input/HostKeyCombination" value="65027,65517"/>
<ExtraDataItem name="GUI/LastItemSelected" value="m=win8raw"/>
<ExtraDataItem name="GUI/LastWindowPosition" value="1,21,1920,1036"/>
<ExtraDataItem name="GUI/SplitterSizes" value="634,1285"/>
<ExtraDataItem name="GUI/SuppressMessages" value="confirmGoingFullscreen,remindAboutMouseIntegration,remindAboutAutoCapture"/>
<ExtraDataItem name="GUI/Toolbar" value="false"/>
<ExtraDataItem name="GUI/Tools/LastItemsSelected" value="Welcome,Details"/>
</ExtraData>
<MachineRegistry>
<MachineEntry uuid="{240651f8-4242-4dfb-bcd3-e78c7926b30d}" src="/home/ndwar/VirtualBox VMs/win8raw/win8raw.vbox"/>
<MachineEntry uuid="{cd2fec0c-f0ed-4835-b849-254e41e6e803}" src="/home/ndwar/VirtualBox VMs/win7 stable/win7 stable.vbox"/>
<MachineEntry uuid="{21cc0d91-59fa-4e4e-80ff-56a451fe551f}" src="/home/ndwar/VirtualBox VMs/Kali-Linux-2020.2a-vbox-amd64/Kali-Linux-2020.2a-vbox-amd64.vbox"/>
</MachineRegistry>
<NetserviceRegistry>
<DHCPServers>
<DHCPServer networkName="HostInterfaceNetworking-vboxnet0" IPAddress="192.168.56.100" networkMask="255.255.255.0" lowerIP="192.168.56.101" upperIP="192.168.56.254" enabled="1"/>
</DHCPServers>
</NetserviceRegistry>
<SystemProperties defaultMachineFolder="/home/ndwar/VirtualBox VMs" defaultHardDiskFormat="VDI" VRDEAuthLibrary="VBoxAuth" webServiceAuthLibrary="VBoxAuth" LogHistoryCount="3" proxyMode="0" exclusiveHwVirt="true"/>
<USBDeviceFilters/>
</Global>
</VirtualBox>

80
dot_bin/executable_R Normal file
View File

@ -0,0 +1,80 @@
#! /bin/bash
# Run R interpreter, optionally launching inside a docker container
# Launch in docker iff a file called '.rundocker' exists and contains
# the name of a valid image in the current directory
## TODO the env args here are not DRY
system_r=(env "MAKEFLAGS=-j8" /bin/R --quiet "$@")
# launch in docker if we find a .rundocker file
if [ -f ".rundocker" ]; then
image=$(cat .rundocker)
if ! docker info > /dev/null 2>&1; then
echo "Docker daemon not running"
echo "Using Systemwide R Installation"
"${system_r[@]}"
fi
if ! docker image inspect "$image" > /dev/null 2>&1; then
echo "Invalid image: $image"
echo "Using Systemwide R Installation"
"${system_r[@]}"
fi
# TODO what about host user's environ file and such?
# TODO not all images have a docker user
# start container using the docker user
user=docker
# start container in docker's home directory
work_dir=/home/docker
# mount the current host directory to docker's user home
pwd_mnt="type=bind,source=$(pwd),target=/home/docker"
# add X11 socket/env so we can see pretty plots
# from here https://github.com/rocker-org/rocker-versioned/tree/master/X11
xsock=/tmp/.X11-unix/X0
xauth=/tmp/.docker.xauth
touch "$xauth"
xauth nlist "$DISPLAY" | sed -e 's/^..../ffff/' | \
xauth -f "$xauth" nmerge -
x11=(-v "$xsock:$xsock"
-v "$xauth:$xauth"
-e "XAUTHORITY=${xauth}"
-e "DISPLAY=$DISPLAY")
# for some reason this won't work if you aren't root
opts=(-ti --rm -w "$work_dir" --mount "$pwd_mnt" -u 0 #--user "$user"
"${x11[@]}")
# TODO not all images have the same path for R
# TODO add env vars somehow
cmd=(/usr/local/bin/R --quiet "$@")
# if we are in Emacs, do some special tricks to satisfy ESS
if [[ -n "$INSIDE_EMACS" ]]; then
# TODO do we need to pass any environmental variables?
# ESS sends some 'source' commands to the running R process
# after it starts; these are in the emacs user directory
emacs_home="$XDG_CONFIG_HOME/emacs"
emacs_mnt="type=bind,source=$emacs_home,target=$emacs_home"
opts+=(--mount "$emacs_mnt")
# ESS gets confused if lines are terminated with \r\n (which
# unfortunately is the default in docker). Set the terminal
# to not echo inputs before starting R
docker run "${opts[@]}" "$image" /bin/sh -c "stty -echo -onlcr && ${cmd[*]}"
else
docker run "${opts[@]}" "$image" "${cmd[@]}"
fi
## remove X11 auth file
rm -f "$xauth"
else
"${system_r[@]}"
fi

View File

@ -0,0 +1,21 @@
#!/bin/sh
### Add org file changes to git repo
for REPO in $1
do
echo "repository: $REPO"
eval "cd $REPO"
# check for errors
if ! git fsck --strict > /dev/null 2>&1; then
notify-send "Org git commit failed."
fi
# remove deleted files
git ls-files --deleted -z | xargs -0 git rm >/dev/null 2>&1
# add new files
git add . >/dev/null 2>&1
git commit -m "$(date)"
# push
git push origin master
done
echo Done

22
dot_bin/executable_batmon Normal file
View File

@ -0,0 +1,22 @@
#! /bin/bash
# small script to log battery usage in txt file for conky to parse
# lovingly stolen from battery-stats by petter reinholdtsen
DST_FILE="$XDG_CACHE_HOME/batmon.log"
SYS_BAT_PATH="/sys/class/power_supply/BAT0"
BAT_CAP_PATH="$SYS_BAT_PATH/charge_now"
BAT_CAP_FULL_PATH="$SYS_BAT_PATH/charge_full"
MAX_ENTRIES=1440 # number of minutes in day
read_bat_percent() {
timestamp=$(date +%s)
charge_now=$(cat "$BAT_CAP_PATH")
charge_full=$(cat "$BAT_CAP_FULL_PATH")
percent=$(echo "100 * $charge_now / $charge_full" | bc)
echo $timestamp $percent >> "$DST_FILE"
}
read_bat_percent
# truncate to most recent entries by max_entries
tail -n $MAX_ENTRIES "$DST_FILE" > /tmp/batmon.tmp.log && mv /tmp/batmon.tmp.log "$DST_FILE"

View File

@ -0,0 +1,15 @@
#!/bin/bash
# get the lifetime cpu utilization percent of pid (the one argument)
pidfile="/proc/$1/stat"
ticks=$(getconf CLK_TCK)
uptime=$(awk '{print $1}' "/proc/uptime")
utime=$(awk '{print $14}' "$pidfile")
stime=$(awk '{print $15}' "$pidfile")
cutime=$(awk '{print $16}' "$pidfile")
cstime=$(awk '{print $17}' "$pidfile")
starttime=$(awk '{print $22}' "$pidfile")
echo "($utime + $stime + $cutime + $cstime) / ($uptime * $ticks - $starttime)" | bc -l

View File

@ -0,0 +1,31 @@
#! /bin/bash
create_entry() {
local -n params=$1
efibootmgr -q -b $bootNumber -B
efibootmgr -q -b $bootNumber -d "${params[device]}" -p "${params[part]}" -c -L "${params[label]}" -l "${params[loader]}" -u "${params[args]}"
if [ $bootNumber -ne 0 ]; then bootOrder+=",$bootNumber"; else bootOrder+="0"; fi
((bootNumber+=1))
}
# must disable KMS for nvidia else X does not start :/
root="root=/dev/mapper/vg1-root rw rootfstype=btrfs rootflags=noatime,compress-force,ssd,space_cache,subvolid=5,subvol=/"
opts="resume=/dev/nvme0n1p2 systemd.unified_cgroup_hierarchy=1 libahci.ignore_sss=1 nmi_watchdog=0 vt.global_cursor_default=0 acpi_osi=\"Windows 2019\" quiet loglevel=3 rd.systemd.show_status=0 rd.udev.log-priority=3 initrd=/intel-ucode.img"
declare -A arch_lts=( ["device"]="/dev/nvme0n1" ["part"]=1 ["label"]="Arch Linux (LTS)" ["loader"]="/vmlinuz-linux-lts" ["args"]="$root $opts elevator=deadline initrd=/initramfs-linux-lts.img")
declare -A arch_lts_native=( ["device"]="/dev/nvme0n1" ["part"]=1 ["label"]="Arch Linux (LTS-native)" ["loader"]="/vmlinuz-linux-lts-native" ["args"]="$root $opts pcie_aspm=force elevator=deadline initrd=/initramfs-linux-lts-native.img")
#~ declare -A win10=( ["device"]="/dev/nvme0n1" ["part"]=2 ["label"]="Windows 10" ["loader"]="\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI" ["args"]="")
declare -a entries
bootOrder=""
bootNumber=0
# order of these commands determines boot order
create_entry arch_lts_native
create_entry arch_lts
efibootmgr -q -D
efibootmgr -q -O
efibootmgr -o $bootOrder

View File

@ -0,0 +1,5 @@
#! /bin/bash
# start the emacs daemon
emacs --fg-daemon > /dev/null 2>&1

View File

@ -0,0 +1,5 @@
#! /bin/bash
# stop the emacs daemon
emacsclient --eval "(kill-emacs)"

View File

@ -0,0 +1,27 @@
#! /bin/bash
# estimate the power usage of the cpu using different
# frequency scaling governors
SLEEPTIME=1
estimate_core_wattage() {
sudo cpupower frequency-set -g "$1"
sleep 5
echo "Estimating wattage for $1"
for i in `seq 1 60`; do
local pkg0_1=$(cat /sys/class/powercap/intel-rapl:0/energy_uj)
local core_1=$(cat /sys/class/powercap/intel-rapl:0:0/energy_uj)
local igpu_1=$(cat /sys/class/powercap/intel-rapl:0:1/energy_uj)
sleep $SLEEPTIME
local pkg0_2=$(cat /sys/class/powercap/intel-rapl:0/energy_uj)
local core_2=$(cat /sys/class/powercap/intel-rapl:0:0/energy_uj)
local igpu_2=$(cat /sys/class/powercap/intel-rapl:0:1/energy_uj)
echo $(((pkg0_2-pkg0_1)/SLEEPTIME)) $(((core_2-core_1)/SLEEPTIME)) $(((igpu_2-igpu_1)/SLEEPTIME))
done
}
estimate_core_wattage performance
estimate_core_wattage powersave
estimate_core_wattage schedutil
estimate_core_wattage conservative

View File

@ -0,0 +1,16 @@
#! /bin/env python3
# extract all images (now jpegs) from an xml
# blob (like those created for sms dumps)
import bs4
import base64
with open("sms-20190702215407.xml", "r") as f:
soup = bs4.BeautifulSoup(f.read(), "lxml")
for i in soup.findAll("part", ct="image/jpeg"):
date = i.parent.parent["date"]
pic = base64.b64decode(i["data"])
with open("out/" + date, "wb") as w:
w.write(pic)

View File

@ -0,0 +1,53 @@
#! /bin/bash
# detect crap that needs to be cleaned up
###
# Detect unused keys in dconf
###
# this only makes sense to do if we have dconf
if [ -e /usr/bin/dconf ]; then
echo -e "###\n# Unused dconf paths\n###"
SCHEMA_DIR=/usr/share/glib-2.0/schemas/
# do a dconf dump but only keep the paths and transform to form path.to.whatever.gschema.xml
dump=$(dconf dump / | sed '/^\[/!d; s/\[//g; s/\]//g')
while read -r line; do
schemaid=$(echo "$line" | sed 's/\//\./g')
# first test if the path matches a schema
if [ ! -e "$SCHEMA_DIR$schemaid.gschema.xml" ]; then
# if not, test if it is in another schema as a path
grep -Fqr "$line" "$SCHEMA_DIR"
if [ $? -eq 1 ]; then
# if it does not have its own schema and is not in another schema, print it
echo "$line"
fi
fi
done <<< "$dump"
fi
###
# Pacnew and Pacsave configs
###
pacnew=$(sudo find /etc -name "*.pacnew")
pacsave=$(sudo find /etc -name "*.pacsave")
echo -e "###\n# Pacnew files\n###\n$pacnew"
echo -e "###\n# Pacsave files\n###\n$pacsave"
###
# Detect seafile conflicts
###
## add seafile directories to this array
SEAFDIRS=(/mnt/data/Documents)
echo -e "###\n# Seafile conflicts\n###"
for i in "${SEAFDIRS[@]}"; do
find "$i" -name "*SFConflict*"
done

5
dot_bin/executable_gpg Normal file
View File

@ -0,0 +1,5 @@
#! /bin/bash
## gpg (override): mount GNUPGHOME before executing
with_gpg_mount /usr/bin/gpg "$@"

View File

@ -0,0 +1,15 @@
#! /bin/bash
# ln-replace find-string replace-string
# looks for "find-string" in links and replaces with "replace string"
for i in *
do
ln_path_old="$(readlink $i)"
if [ "$ln_path_old" != "" ]; then
ln_path_new=${ln_path_old/$1/$2}
rm "$i"
ln -s "$ln_path_new" "$i"
fi
done

View File

@ -0,0 +1,13 @@
#! /bin/bash
# list all kernal modules that are not currently loaded
all_mods="$(find /lib/modules/$(uname -r) -type f -name \*.ko -execdir basename {} .ko ';')"
all_mods=${all_mods//-/_}
loaded_mods=$(lsmod | grep -Eo '^[^ ]+')
while read -r line; do
if ! [[ "$loaded_mods" =~ "$line" ]]; then
echo "$line"
fi
done <<< "$all_mods"

View File

@ -0,0 +1,5 @@
#! /bin/sh
# xdg-base-dir override of mbsync
/bin/mbsync -c "$XDG_CONFIG_HOME/isync/mbsyncrc" "$@"

View File

@ -0,0 +1,30 @@
#! /bin/bash
## mount a veracrypt volume
## NOTE this will need the DISPLAY variable in order to prompt for the bitwarden
## password
pwd=$(dbus-send --print-reply=literal --session \
--dest=org.rofi.bitwarden \
/bitwarden org.rofi.bitwarden.session.GetPassword \
string:"$1" | \
sed -e 's/^ *//g')
## the funny evals are here to expand any literal env variables that may be
## passed because systemd didn't expand them (yuck)
volume="$(eval echo "$2")"
mountpoint="$(eval echo "$3")"
if [[ "$pwd" == "" ]]; then
echo "Could not get bitwarden password"
exit 1
else
if /usr/bin/sudo /usr/bin/veracrypt \
--text --non-interactive --stdin \
"$volume" "$mountpoint" <<< "$pwd"; then
echo "Mounted $1"
else
echo "Failed to mount $1"
exit 1
fi
fi

View File

@ -0,0 +1,12 @@
#! /bin/sh
## indexes mu depending on whether emacs mu4e is running
## assume the mu server is only started by mu4e
if pgrep -fx '/usr/bin/mu server' > /dev/null; then
echo indexing mu through emacs
emacsclient -e '(mu4e-update-index)' > /dev/null
else
echo indexing mu natively
mu index
fi

206
dot_bin/executable_mytube Normal file
View File

@ -0,0 +1,206 @@
#!/bin/bash
#a featherweight youtube piracy tool :)
help()
{
cat << EOF
help: $0 options
Use this to pirate the audio from youtube vidz.
Uses ffmpeg and youtube-dl
OPTIONS:
-h You know what this is obviously
-q Quality; 1-5 scale, defaults to 2 (~220 kbits/s)
-x Extension (default is m4a)
-f Save Folder (defaults to current working directory)
Metadata:
-a Artist name
-t Album title
-g Genre
-y Year
-n No track numbers
-i Interactive (confirm each extraction)
Note: if any metadata option is not specified,
each option will be prompted every url
EOF
}
quality= #b
extension= #x
artist= #a
album_title= #t
genre= #g
year= #y
track= #n
while getopts “hq:x:a:t:g:y:ni” OPTION
do
case $OPTION in
h)
help
exit 1
;;
q)
quality=$OPTARG
;;
x)
extension=$OPTARG
;;
f)
folder=$OPTARG
;;
a)
artist=$OPTARG
;;
t)
album_title=$OPTARG
;;
g)
genre=$OPTARG
;;
y)
year=$OPTARG
;;
n)
track=1
;;
i)
interactive=1
;;
*)
break
;;
esac
done
#set defaults
if [[ -z $quality ]]; then quality="2"; fi
if [[ -z $extension ]]; then extension="m4a"; fi
if [[ -z $folder ]]; then folder=$(pwd); fi
if [[ -z $track ]]; then track=0; fi
#set metadata if user gave them
if [[ -n $artist ]]; then a=$artist; fi
if [[ -n $album_title ]]; then t=$album_title; fi
if [[ -n $genre ]]; then g=$genre; fi
if [[ -n $year ]]; then y=$year; fi
OPTIONS="URL Done"
select opt in $OPTIONS
do
case $opt in
URL)
#get necessary stuff first
read -p "Enter URL to vid: " u
if [[ $u =~ v=(.*) ]]; then
vid_id=${u##*v=}
vid_id=${vid_id%%&*}
read -p "Enter Song Title: " s
#get other info depending on how it was given initially
if [[ -z $artist ]]; then read -p "Artist? " a; fi
if [[ -z $album_title ]]; then read -p "Album Title? " t; fi
if [[ -z $genre ]]; then read -p "Genre? " g; fi
if [[ -z $year ]]; then read -p "Year? " y; fi
if [[ $track = 0 ]]; then
read -p "Track Number? " n
if [[ "${#n}" = 1 ]]; then n="0$n"; fi
n0="$n-"
else
n=""
fi
filename="$n0$s ($a-$t).$extension"
if [[ $interactive = 1 ]]; then
echo GENERAL
echo quality: "$quality"
echo Save into: "$folder"
echo Video ID: "$vid_id"
echo
echo METADATA
echo New Filename: $filename
echo Artist: $a
echo Album Title: $t
echo Genre: $g
echo Year: $y
echo Track: $n
echo
echo Continue?
CONFIRM="Yes No"
select con in $CONFIRM
do
case $con in
Yes)
Continue=1
break
;;
No)
Continue=0
echo Starting Over
break
;;
*)
echo $con
echo Try Again
;;
esac
done
else
Continue=1
fi
if [[ $Continue = 1 ]]; then
youtube-dl $u --id
if [[ "$track" = 0 ]]; then
arg=(-q "$quality" -metadata TITLE=$s -metadata ARTIST=$a -metadata ALBUM=$t -metadata GENRE=$g -metadata DATE=$y -metadata track=$n)
else
arg=(-q "$quality" -metadata TITLE=$s -metadata ARTIST=$a -metadata ALBUM=$t -metadata GENRE=$g -metadata DATE=$y)
fi
ffmpeg -i "$vid_id".* "${arg[@]}" -vn -strict experimental "$filename"
rm "$vid_id".*
fi
else
echo "Invalid URL, no ID detected. Try again"
fi
;;
Done)
echo Exiting
exit 0
;;
*)
echo $opt
echo Try Again
;;
esac
done
#~ if [[ $address =~ $regex ]]; then
#~ video_id=${BASH_REMATCH[1]}
#~ video_id=$(echo $video_id | cut -d'&' -f1)
#~ video_title="$(youtube-dl --get-title $address)"
#~ youtube-dl $address
#~ ext="flv"
#~ ffmpeg -i $video_id.$ext "$video_title".wav
#~
#~ rm $video_id.$ext "$video_title".wav
#~ else
#~ echo "Sorry but the system encountered a problem."
#~ fi
#additional stuff
#ffmpeg -i song.flac -ab 320k -strict experimental song.mp4
#q = quality (argument?)
#ffmpeg -i video.mp4 -ab 320k -vn -metadata TITLE="" -metadata ARTIST="" -metadata GENRE="" -metadata ALBUM="" -strict experimental song.mp4
#use mp4 to allow metadata w/ aac compression :)

View File

@ -0,0 +1,5 @@
#! /bin/sh
# xdg-base-dir override of nvidia-settings
/bin/nvidia-settings --config "$XDG_CONFIG_HOME/nvidia/settings" "$@"

View File

@ -0,0 +1,13 @@
#! /bin/bash
# get an oauth access token using the refresh token
token_url="$(pass "email/$1/token_url")"
client_id="$(pass "email/$1/client_id")"
client_secret="$(pass "email/$1/client_secret")"
refresh_token="$(pass "email/$1/refresh_token")"
curl --silent \
--request POST \
--data "client_id=$client_id&client_secret=$client_secret&refresh_token=$refresh_token&grant_type=refresh_token" \
"$token_url" \
| jq -r '.access_token'

5
dot_bin/executable_pass Normal file
View File

@ -0,0 +1,5 @@
#! /bin/bash
## pass (override): mount $GNUPGHOME before executing
with_gpg_mount /usr/bin/pass "$@"

View File

@ -0,0 +1,52 @@
#!/bin/bash
# merge pdf files with ghostscript
help()
{
cat << EOF
help: $0 options
Merge PDF files together
OPTIONS:
-h You know what this is obviously
-i input files (comma separated)
-o output file
EOF
}
while getopts “hi:o:” OPTION
do
case $OPTION in
h)
help
exit 1
;;
i)
input="$OPTARG"
;;
o)
echo "$OPTARG"
output="$OPTARG"
;;
*)
break
;;
esac
done
if [ -z "$input" ]; then
echo "invalid input"
exit 1
fi
if [ -z "$output" ]; then
echo "invalid output"
exit 1
fi
input=${input//","/" "}
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile="$output" $input

View File

@ -0,0 +1,97 @@
#! /usr/bin/env ruby
# coding: utf-8
# Copyright © 2016 Quentin "Sardem FF7" Glidic
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
rofi=%w( rofi -dmenu -input /dev/null -password )
def assuan_send(t)
$stdout.puts t
$stdout.flush
end
assuan_send "OK Please go ahead"
while ( line = $stdin.readline )
ok = true
case ( line )
when /^OPTION (.+)$/
#OPTION grab
#OPTION ttyname=/dev/pts/1
#OPTION ttytype=tmux-256color
#OPTION lc-messages=C
#OPTION allow-external-password-cache
#OPTION default-ok=_OK
#OPTION default-cancel=_Cancel
#OPTION default-yes=_Yes
#OPTION default-no=_No
#OPTION default-prompt=PIN:
#OPTION default-pwmngr=_Save in password manager
#OPTION default-cf-visi=Do you really want to make your passphrase visible on the screen?
#OPTION default-tt-visi=Make passphrase visible
#OPTION default-tt-hide=Hide passphrase
#OPTION touch-file=/run/user/1000/gnupg/S.gpg-agent
when /^GETINFO (.+)$/
info = $1
case ( info )
when 'pid'
assuan_send "D #{Process.pid}"
end
when /^SETKEYINFO (.+)$/
#SETKEYINFO s/FINGERPRINT
when /^SETDESC (.+)$/
print "hi\n"
#SETDESC Please enter the passphrase for the ssh key%0A ke:yf:in:ge:rp:ri:nt
rofi << '-mesg' << $1.gsub('<', '&lt;').gsub(/%([0-9A-Fa-f]{2})/) { $1.to_i(16).chr }
when /^SETPROMPT (.+)$/
#SETPROMPT Passphrase:
rofi << '-p' << $1
when /^GETPIN$/
pass = nil
IO.popen(%w( systemctl --user show-environment )) do |io|
until ( io.eof? )
var = io.readline
var.match(/^([A-Za-z_]+)=(.+)$/)
var, val = $~[1..2]
ENV[var] = val
end
end
err_in, err_out = IO.pipe
IO.popen([*rofi, :err => err_out]) do |io|
pass = io.read
end
status = $?
err_out.close
case ( status.exitstatus )
when 0
assuan_send "D #{pass}" unless ( pass.empty? )
when 1
assuan_send "ERR 83886179 Operation cancelled <rofi>"
ok = false
end
when /^BYE(?= |$)/
exit(0)
else
assuan_send "BYE"
exit(1)
end
assuan_send "OK" if ( ok )
end

View File

@ -0,0 +1,15 @@
#! /bin/bash
# simple script to output the current current (lol) and current
# voltage of the battery every second. Record this to a file, multiply,
# and find power...absolute...POOOOOOWEEEER!!!!!!
for i in $(seq "$1"); do
## in uC
I=$(cat /sys/class/power_supply/BAT0/current_now)
## in uV
V=$(cat /sys/class/power_supply/BAT0/voltage_now)
## in pW
echo $(( I * V ))
sleep 1.0
done

View File

@ -0,0 +1,31 @@
#! /bin/bash
#~ SLEEPTIME=5
#~ estimate_core_wattage() {
#~ echo "Estimating wattage for $1"
#~ for i in `seq 1 5`; do
#~ local uJ_1=$(cat /sys/class/powercap/intel-rapl:0:0/energy_uj)
#~ sleep $SLEEPTIME
#~ local uJ_2=$(cat /sys/class/powercap/intel-rapl:0:0/energy_uj)
#~ local watts=$((uJ_2-uJ_1))
#~ watts=$((watts/SLEEPTIME))
#~ echo "Wattage consumed: $watts uW"
#~ done
#~ }
change_gov() {
sudo cpupower frequency-set -g "$1"
}
run_pts() {
change_gov "$1"
#~ estimate_core_wattage "$1"
phoronix-test-suite batch-benchmark pts/compress-7zip pts/build-php pts/c-ray pts/john-the-ripper
}
run_pts performance
run_pts powersave
run_pts schedutil
run_pts conservative

13
dot_bin/executable_rofi Normal file
View File

@ -0,0 +1,13 @@
#! /bin/bash
# super hacky script to ensure rofi always appears on the focused workspace
# current-output is a script from rofi-extras that outputs the xrandr name of
# screen showing the focused workspace
if name=$(current-output); then
# putting the -m argument first should override any other -m arguments
# later in the args list
/usr/bin/rofi -m "$name" "$@"
else
/usr/bin/rofi "$@"
fi

View File

@ -0,0 +1,35 @@
#! /bin/sh
SPICE_PORT=5924
# use this to install virtio disk drivers after installation
# -drive file=$HOME/VirtualBox\ VMs/fake.qcow2,if=virtio \
# TODO make this work
# -net nic,model=virtio \
qemu-system-x86_64 \
-enable-kvm \
-cpu host \
-smp 4 \
-m 2G \
-usb -device usb-tablet \
-soundhw hda \
-vga qxl \
-drive file=/usr/share/virtio/virtio-win.iso,index=1,media=cdrom \
-drive file=$HOME/VirtualBox\ VMs/test.img,format=raw,if=virtio
# qemu-system-x86_64 \
# -enable-kvm \
# -daemonize \
# -smp 4 \
# -m 2G \
# -usb -device usb-tablet \
# -soundhw hda \
# -vga qxl \
# -spice port=${SPICE_PORT},disable-ticketing \
# -device virtio-serial \
# -chardev spicevmc,id=vdagent,name=vdagent \
# -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \
# VirtualBox\ VMs/test.img
# exec remote-viewer --title Windows spice://127.0.0.1:${SPICE_PORT}

View File

@ -0,0 +1,55 @@
#!/bin/bash
# from http://www.jdgleaver.co.uk/blog/2014/05/23/samsung_ssds_reading_total_bytes_written_under_linux.html
# get the lifetime writes and health of an ssd
#######################################
# Variables #
#######################################
SSD_DEVICE="$1"
ON_TIME_TAG="Power_On_Hours"
WEAR_COUNT_TAG="Wear_Leveling_Count"
LBAS_WRITTEN_TAG="Total_LBAs_Written"
LBA_SIZE=512 # Value in bytes
BYTES_PER_MB=1048576
BYTES_PER_GB=1073741824
BYTES_PER_TB=1099511627776
#######################################
# Get total data written... #
#######################################
# Get SMART attributes
SMART_INFO=$(sudo /usr/sbin/smartctl -A "$SSD_DEVICE")
# Extract required attributes
ON_TIME=$(echo "$SMART_INFO" | grep "$ON_TIME_TAG" | awk '{print $10}')
WEAR_COUNT=$(echo "$SMART_INFO" | grep "$WEAR_COUNT_TAG" | awk '{print $4}' | sed 's/^0*//')
LBAS_WRITTEN=$(echo "$SMART_INFO" | grep "$LBAS_WRITTEN_TAG" | awk '{print $10}')
# Convert LBAs -> bytes
BYTES_WRITTEN=$(echo "$LBAS_WRITTEN * $LBA_SIZE" | bc)
MB_WRITTEN=$(echo "scale=3; $BYTES_WRITTEN / $BYTES_PER_MB" | bc)
GB_WRITTEN=$(echo "scale=3; $BYTES_WRITTEN / $BYTES_PER_GB" | bc)
TB_WRITTEN=$(echo "scale=3; $BYTES_WRITTEN / $BYTES_PER_TB" | bc)
# Output results...
echo "------------------------------"
echo " SSD Status: $SSD_DEVICE"
echo "------------------------------"
echo " On time: $(echo $ON_TIME | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta') hr"
echo "------------------------------"
echo " Data written:"
echo " MB: $(echo $MB_WRITTEN | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta')"
echo " GB: $(echo $GB_WRITTEN | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta')"
echo " TB: $(echo $TB_WRITTEN | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta')"
echo "------------------------------"
echo " Mean write rate:"
echo " MB/hr: $(echo "scale=3; $MB_WRITTEN / $ON_TIME" | bc | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta')"
echo "------------------------------"
echo " Drive health: ${WEAR_COUNT} %"
echo "------------------------------"

View File

@ -0,0 +1,22 @@
#! /bin/bash
## capture a screenshot using scrot
SS_DIR="$XDG_CACHE_HOME/screenshots"
while getopts ":sw" opt; do
case ${opt} in
s)
scrot "$SS_DIR/desktop/%Y-%m-%d-%H:%M:%S_desktop.png"
notify-send "Screen captured"
;;
w)
scrot -u "$SS_DIR/window/%Y-%m-%d-%H:%M:%S-\$wx\$h.png"
notify-send "Window captured"
;;
\?)
echo "invalid option, read the code"
;;
esac
done

View File

@ -0,0 +1,45 @@
#! /bin/bash
## lock the screen using i3lock
# WORKAROUND make the date show up in the right place on 2+ monitor setups
# I want it to only show up on the primary screen, so use xrandr to get the
# dimensions and position of the primary monitor and calculate the date position
# from that
geometry=$(xrandr | sed -n 's/^.*primary \([0-9]*\)x[0-9]*+\([0-9]\)*+[0-9]* .*/\1 \2/p')
width=$(echo "$geometry" | cut -f1 -d" ")
xpos=$(echo "$geometry" | cut -f2 -d" ")
xoffset=$(("$xpos" + "$width" / 2))
datepos="$xoffset:600"
i3lock --color=000000 \
--pass-media-keys \
--nofork \
--ignore-empty-password \
--screen=0 \
--indicator \
--insidecolor=00000055 \
--insidevercolor=00000055 \
--insidewrongcolor=00000055 \
--ringcolor=555555ff \
--ringwrongcolor=ff3333ff \
--ringvercolor=99ceffff \
--keyhlcolor=99ceffff \
--bshlcolor=9523ffff \
--linecolor=00000000 \
--separatorcolor=00000000 \
--clock \
--verifcolor=99ceffff \
--wrongcolor=ff8282ff \
--timecolor=ffffffff \
--timesize=72 \
--timestr="%H:%M" \
--datecolor=ffffffff \
--datesize=42 \
--datestr="%b %d, %Y" \
--date-align 0 \
--datepos="$datepos" \
--wrongsize=72 \
--verifsize=72 \
--radius=300 \
--ring-width=25

View File

@ -0,0 +1,9 @@
#!/bin/sh
# Convert all arguments (assumed SVG) to a PNG
# Requires Inkscape
for i in $@; do
BN=$(basename $i .svg)
inkscape --export-area-drawing --export-type=png --export-filename="$BN.png" --export-dpi 300 $i
done

View File

@ -0,0 +1,15 @@
#!/bin/sh
# Convert all arguments (assumed SVG) to a TIFF
# Requires Inkscape and ImageMagick 6.8 (doesn't work with 6.6.9)
# lovingly ripped off from here:
# https://gist.github.com/matsen/4263955
for i in $@; do
BN=$(basename $i .svg)
inkscape --without-gui --export-area-drawing --export-png="$BN.png" --export-dpi 300 $i
convert -compress LZW -alpha remove $BN.png $BN.tiff
convert $BN.png -background white -alpha remove $BN.png
mogrify -alpha off $BN.tiff
done

5
dot_bin/executable_svn Normal file
View File

@ -0,0 +1,5 @@
#! /bin/sh
# xdg-base-dir override of svn
/usr/bin/svn --config-dir "$XDG_CONFIG_HOME"/subversion "$@"

114
dot_bin/executable_sync_ssd Normal file
View File

@ -0,0 +1,114 @@
#! /bin/bash
#ASSUMPTIONS
#-fs on card is FAT32
#recursive file navigator to loop through everything
function sync()
{
for i in "$1"/*; do
#new file name without special chars to adhere to FAT32 limitations
fat_path=${i//"?"/""}
fat_path=${fat_path//"*"/""}
fat_path=${fat_path//"<"/""}
fat_path=${fat_path//">"/""}
fat_path=${fat_path//"|"/""}
fat_path=${fat_path//":"/""}
fat_name="${fat_path##*/}"
#if directory then call self and loop
if [ -d "$i" ]; then
if [ ! -d "$fat_name" ]; then
#mkdir "${fat_path##*/}"
mkdir "$fat_name"
fi
#cd "${fat_path##*/}"
cd "$fat_name"
sync "$i"
cd ../
#if file then check
else
if [ -f "$fat_name" ] || \
[ -f "${fat_name//.flac/.mp4}" ] || \
[ -f "${fat_name//.flac/.aac}" ] || \
[ -f "${fat_name//.flac/.m4a}" ]; then
echo skipping "$fat_name"
else
echo $fat_path
#if these then copy (remove cover art)
if [ "${i: -4}" == ".mp3" -o \
"${i: -4}" == ".mp4" -o \
"${i: -4}" == ".m4a" -o \
"${i: -4}" == ".aac" -o \
"${i: -5}" == ".opus" ]; then
#~ cp "$i" "$fat_name"
ffmpeg -i "$i" -vn -codec:a copy "$fat_name"
#if flac then convert to m4a (if flag is not raised)
elif [ "${i: -5}" == ".flac" ]; then
if [ "$conv" == 1 ]; then
trimmed_name=${fat_path##*/}
ffmpeg -i "$i" -aq $quality -vn -strict -2 "${trimmed_name%%.flac}".m4a
else
#~ cp "$i" "$fat_name"
ffmpeg -i "$i" -vn -codec:a copy "$fat_name"
fi
fi
fi
fi
done
}
help()
{
cat << EOF
help: $0 options
Sync memory device with music folder on ssd
Files will be saved/synced to current directory
If flac files are found they will be converted to m4a to conserve space
Uses ffmpeg
OPTIONS:
-h You know what this is obviously
-c Do not convert flac to mp4
-q Quality (defaults to 2; 200-250 kbps)
-f Source Folder (defaults to ~/Music)
Note: if bit is given it will be used instead of quality
EOF
}
conv=1
quality=2 #highest quality
folder="$HOME/Music"
while getopts “hcf:q:” OPTION
do
case $OPTION in
h)
help
exit 1
;;
c)
conv=0
;;
q)
quality=$OPTARG
;;
f)
folder=$OPTARG
;;
*)
break
;;
esac
done
sync "$folder"

View File

@ -0,0 +1,96 @@
#! /bin/bash
function split()
{
if [ -n "$4" ]; then
if [[ $4 == *","* ]]; then
inner_counter=1
for i in ${4//,/ }
do
pdftk "$1" cat "$i" output "$2"/$(printf "%02d" $counter)_"$3$inner_counter.pdf"
((inner_counter+=1))
((counter+=1))
done
else
pdftk "$1" cat "$4" output "$2"/$(printf "%02d" $counter)_"$3.pdf"
((counter+=1))
fi
echo "$3 $4" >> "$2/.log"
fi
}
help()
{
cat << EOF
help: $0 options
Split text book pdfs into sections.
All options except file take lists that are comma seaparated.
Examples: 1-2,3-4 (range) or 1,2-4,5 (single and range) or 1 (single)
Requires pdftk
OPTIONS:
-h You know what this is obviously
-f source file (a pdf)
-t table of contents
-c chapters
-a appendices
-i indices
-g glossary
EOF
}
while getopts “hf:t:c:a:i:g:o:” OPTION
do
case $OPTION in
h)
help
exit 1
;;
f)
src=$OPTARG
;;
t)
toc=$OPTARG
;;
c)
chapters=$OPTARG
;;
a)
appendices=$OPTARG
;;
i)
indices=$OPTARG
;;
g)
glossary=$OPTARG
;;
*)
break
;;
esac
done
if [ ! -e "$src" ]; then
echo "\"$src\" does not exist"
exit 1
fi
folder=$(basename "$src")
folder=${src%\.pdf}
mkdir "$folder"
counter=0
split "$src" "$folder" "table_of_contents" "$toc"
split "$src" "$folder" "chapter" "$chapters"
split "$src" "$folder" "appendix" "$appendices"
split "$src" "$folder" "index" "$indices"
split "$src" "$folder" "glossary" "$glossary"
# copy original
cp "$src" "$folder/.original"

View File

@ -0,0 +1,5 @@
#! /bin/sh
# xdg-base-dir override of tj3client
/bin/tj3client -c "$XDG_CONFIG_HOME/tj3/taskjugglerrc" "$@"

5
dot_bin/executable_tj3d Normal file
View File

@ -0,0 +1,5 @@
#! /bin/sh
# xdg-base-dir override of tj3d
/bin/tj3d -c "$XDG_CONFIG_HOME/tj3/taskjugglerrc" "$@"

View File

@ -0,0 +1,5 @@
#! /bin/sh
# xdg-base-dir override of tj3webd
/bin/tj3webd -c "$XDG_CONFIG_HOME/tj3/taskjugglerrc" "$@"

View File

@ -0,0 +1,14 @@
#! /bin/bash
## toggle the bluetooth power state and notify
## lazy awk usage :)
btstate="$(bluetoothctl show | grep "Powered: " | awk '{print $2}')"
btaction="off"
if [[ $btstate == "no" ]]; then
btaction="on"
fi
bluetoothctl power "$btaction" > /dev/null
notify-send "bluetooth powered $btaction"

View File

@ -0,0 +1,15 @@
#! /bin/bash
## unmount a veracrypt volume
## the funny evals are here to expand any literal env variables that may be
## passed because systemd didn't expand them (yuck)
mountpoint="$(eval echo "$1")"
if /usr/bin/sudo /usr/bin/veracrypt -d "$mountpoint"; then
echo "Unmounted $1"
else
echo "Failed to unmount $1"
exit 1
fi

View File

@ -0,0 +1,38 @@
#! /bin/bash
# start Virtualbox VM with an event hook that fires when closing
# takes one argument which is the string name of the VM to start
if [[ -z "$1" ]]; then
echo "No VM specified"
exit 1
fi
# when VBoxManage runs it spawns a new process with the machine uuid
# as part of the full command. This is the process we wish to monitor
# in order to fire an event when it closes. Therefore, need to get the
# machine uuid for the target VM from the config files (yes VBoxManage
# can do this but it seems to randomly take a long time; sed is way
# more reliable)
vbox_conf="$XDG_CONFIG_HOME/VirtualBox/VirtualBox.xml"
vbox_home=$(sed -n 's/.*defaultMachineFolder=\"\(.*\)\" defaultHardDiskFormat.*/\1/p' "$vbox_conf")
vm_conf="$vbox_home/$1/$1.vbox"
if [[ ! -e "$vm_conf" ]]; then
echo "Invalid VM specified"
exit 1
fi
machine_uuid=$(sed -n 's/.*Machine uuid=\"{\(.*\)}\".*/\1/p' "$vm_conf")
VBoxManage startvm "$1"
vm_pid=$(pgrep -f "$machine_uuid")
# ew polling...
while [ -d "/proc/$vm_pid" ]; do
sleep 0.1
done
#xitsign

View File

@ -0,0 +1,7 @@
#! /bin/bash
# make a new python environment and install some nice defaults
virtualenv "$1"
source "$1/bin/activate"
pip install ipython black flake8 pylint

View File

@ -0,0 +1,30 @@
#! /bin/bash
## with_gpg_mount: call a program after mounting GNUPGHOME
bin="$1"
shift
## TODO most of this stuff could be more easily done in the rofi-extras
## haskell code where many of the edge cases that this is hoping to avoid are
## already strictly/brutally snuffed out by GHC's iron fist
notify_error () {
notify-send --icon=dialog-error-symbolic "$1"
}
notify_info () {
notify-send --icon=dialog-information-symbolic "$1"
}
if ! systemctl --user is-active --quiet mount-veracrypt@gnupg.service; then
if systemctl --user --quiet start mount-veracrypt@gnupg.service; then
notify_info "Mounted $GNUPGHOME"
"$bin" "$@"
else
notify_error "Could not mount gnupg directory"
exit 1
fi
else
"$bin" "$@"
fi

View File

@ -0,0 +1,20 @@
#!/bin/bash
# exports the current keyboard layout as a pdf
# the sole argument is the path of the output file
# requires:
# - xorg-setxkbmap
# - xorg-setxkbcomp
# - xorg-xkbprint
# - ghostscript
if [ -z "$1" ]; then
echo no output file path given
exit 1
fi
setxkbmap -print |
xkbcomp - - |
xkbprint -label symbols -color - - |
ps2pdf - > "$1"

106
dot_bin/executable_zipbomb Normal file
View File

@ -0,0 +1,106 @@
#! /bin/bash
help()
{
cat << EOF
help: $0 options
use this classy tool to (zip)bomb the crap out of your mom, dad, ex, annoying sister, George Bush, Donald Trump, Bon Jovi, or ISIS
OPTIONS:
-c Compression algo (zip)
-d Depth (1)
-f Number of files per layer (16)
-n Number of sequences per file (512)
-s Character sequence to store ("0")
-z Name of zipbomb
Note: if any metadata option is not specified,
each option will be prompted every url
EOF
}
name="zipbomb"
comp_algo="zip"
depth=1
files=16
n_seq=512
seq="0"
while getopts “hc:d:f:n:s:z:” OPTION
do
case $OPTION in
h)
help
exit 1
;;
c)
comp_algo=$OPTARG
;;
d)
depth=$OPTARG
;;
f)
files=$OPTARG
;;
n)
n_seq=$OPTARG
;;
s)
seq=$OPTARG
;;
z)
name=$OPTARG
;;
*)
break
;;
esac
done
zipbomb_dir=/tmp/zipbomb
mkdir "$zipbomb_dir"
cd "$zipbomb_dir"
zip_layer() {
level="$1"
#bottom level
if [[ "$level" == 1 ]]; then
perl -E "print '$seq' x $n_seq" > "$zipbomb_dir"/0
for i in $(seq 1 $(($files)))
do
cp "$zipbomb_dir"/0 "$zipbomb_dir"/"$i"
done
zip -qr "$name" ./*
for i in $(seq 0 $(($files)))
do
rm "$i"
done
#above bottom level
else
zip_layer $(($level-1))
mv "$name".zip "0.zip"
for i in $(seq 1 $(($files)))
do
cp "0.zip" "$i".zip
done
zip -qr "$name" ./*
for i in $(seq 0 $(($files)))
do
rm "$i".zip
done
fi
}
zip_layer "$depth"

0
dot_config/.keep Normal file
View File

View File

@ -0,0 +1 @@
{{ .chezmoi.sourceDir }}/VirtualBox.xml

0
dot_config/X11/.keep Normal file
View File

39
dot_config/X11/xinitrc Normal file
View File

@ -0,0 +1,39 @@
#!/bin/sh
userresources="$XDG_CONFIG_HOME/X11/xresources"
systemctl --user import-environment PATH
systemctl --user import-environment DISPLAY
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
/usr/bin/prime-offload > /dev/null 2>&1
setxkbmap hypermode
KEYS="Control_L=Escape"
KEYS="$KEYS;Control_R=Return"
KEYS="$KEYS;Super_L=Tab"
KEYS="$KEYS;Super_R=backslash"
KEYS="$KEYS;Alt_R=space"
KEYS="$KEYS;ISO_Level3_Shift=XF86Search"
xman -t 500 "$KEYS" "^VirtualBox Machine$" &
greenclip daemon &
redshift > /dev/null 2>&1 &
dunst &
emacs-start &
seafile-applet > /dev/null 2>&1 &
nm-applet > /dev/null 2>&1 &
flameshot > /dev/null 2>&1 &
rofi-bw -d 3600 &
autorandr --change > /dev/null
picom --config "$XDG_CONFIG_HOME/picom.conf" -b
numlockx on
xss-lock --ignore-sleep screenlock &
exec xmonad

84
dot_config/X11/xresources Normal file
View File

@ -0,0 +1,84 @@
Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb
Xft.dpi: 96
*color0: #000000
*color8: #666666
*color1: #dd2020
*color9: #ff4040
*color2: #20cc20
*color10: #30ff30
*color3: #cccc20
*color11: #ffff30
*color4: #0070ff
*color12: #00a0ff
*color5: #cc20cc
*color13: #ff60ff
*color6: #20cccc
*color14: #30ffff
*color7: #aaaaaa
*color15: #ffffff
*.cursorBlink: False
*.cursorColor: #30ff30
*.colorUL: 11
URxvt.depth: 32
URxvt.background: [85]#000000
URxvt.foreground: 15
URxvt.font: xft:DejaVu Sans Mono:size=11:autohint=false
URxvt.boldfont: xft:DejaVu Sans Mono Bold:size=11:autohint=false
URxvt.fontItalic: xft:DejaVu Sans Mono Oblique:size=11:autohint=false
URxvt.fontBoldItalic: xft:DejaVu Sans Mono Bold Oblique:size=11:autohint=false
URxvt.tabbed.tabbar-fg: 15
URxvt.tabbed.tabbar-bg: 0
URxvt.tabbed.tab-fg: 0
URxvt.tabbed.tab-bg: 15
URxvt.tabbed.autohide: true
URxvt.tabbed.title: false
URxvt.imLocale: en_US.UTF-8
URxvt.iso14755: False
URxvt.iso14755_52: False
URxvt.saveLines: 8192
URxvt.fading: 50
URxvt.fadeColor: Grey25
URxvt.meta8: False
URxvt.scrollBar: False
URxvt.perl-ext-common: default,matcher,tabbedex,keyboard-select,selection-to-clipboard
URxvt.url-launcher: /bin/chromium
URxvt.matcher.button: 1
URxvt.keysym.M-Escape: perl:keyboard-select:activate
URxvt.keyboard-select.clipboard: True;
URxvt.keysym.Control-C: perl:clipboard:copy
URxvt.keysym.Control-V: perl:clipboard:paste
URxvt.keysym.Control-B: perl:clipboard:paste_escaped
URxvt.keysym.Control-t: perl:tabbedex:new_tab
URxvt.keysym.Control-Tab: perl:tabbedex:next_tab
URxvt.keysym.Control-ISO_Left_Tab: perl:tabbedex:prev_tab
URxvt.keysym.Control-Shift-Left: perl:tabbedex:move_tab_left
URxvt.keysym.Control-Shift-Right: perl:tabbedex:move_tab_right
URxvt.keysym.Control-Shift-R: perl:tabbedex:rename_tab
URxvt.tabbed.no-tabbedex-keys: true

View File

View File

@ -0,0 +1,6 @@
#! /bin/bash
feh --no-fehbg --bg-scale --bg-fill "$XDG_DATA_HOME/backgrounds/wallpaper.png" &
killall conky > /dev/null 2>&1
conky -d > /dev/null 2>&1

View File

@ -0,0 +1,11 @@
output HDMI-1
mode 1920x1080
left-of eDP-1
panning 0x0
output eDP-1
pos 0x0
mode 1920x1080
primary
panning 1920x1080+1920+0

View File

@ -0,0 +1,2 @@
eDP-1 *
HDMI-1 *

View File

@ -0,0 +1,11 @@
output eDP-1
pos 0x0
mode 1920x1080
panning 0x0
primary
output HDMI-1
mode 1920x1080
right-of eDP-1
panning 1920x1080+1920+0

View File

@ -0,0 +1,2 @@
eDP-1 *
HDMI-1 *

View File

@ -0,0 +1,8 @@
output eDP-1
mode 1920x1080
pos 0x0
primary
output HDMI-1
off

View File

@ -0,0 +1 @@
eDP-1 *

View File

@ -0,0 +1,18 @@
output HDMI-1-1
mode 1920x1080
pos 0x0
panning 0x0
output eDP-1-1
pos 1920x0
mode 1920x1080
panning 0x0
primary
output DP-0
mode 1920x1080
pos 3840x0
panning 1920x1080+3840+0
output DP-1
off

View File

@ -0,0 +1,3 @@
DP-0 *
HDMI-1-1 *
eDP-1-1 *

View File

@ -0,0 +1,14 @@
output DP-1
off
output HDMI-1-1
off
output eDP-1-1
mode 1920x1080
pos 0x0
primary
output DP-0
mode 2560x1440
pos 1920x0

View File

@ -0,0 +1,2 @@
DP-0 00ffffffffffff000469a328352f0100191c0104b53e22783a1cb5a3574fa0270d5054bfef00d1c0814081809500b300714f81c001014dd000a0f0703e80302035006d552100001aa36600a0f0701f80302035006d552100001a000000fd001e5018a03c041100f0f838f03c000000fc0041535553205042323837510a20013c02031c714f0102031112130414051f900e0f1d1e2309170783010000565e00a0a0a02950302035006d552100001ee26800a0a0402e60302036006d552100001a011d00bc52d01e20b82855406d552100001e8c0ad090204031200c4055006d552100001800000000000000000000000000000000000000000000000000000090
eDP-1-1 00ffffffffffff0030e4e50500000000001c0104a52213780238d5975e598e271c505400000001010101010101010101010101010101243680a070381f403020350058c210000019000000000000000000000000000000000000000000fe004c4720446973706c61790a2020000000fe004c503135365746432d53504431003e

View File

@ -0,0 +1,16 @@
output HDMI-1-1
off
output eDP-1-1
pos 0x0
mode 1920x1080
panning 0x0
primary
output DP-0
mode 1920x1080
right-of eDP-1-1
panning 1920x1080+1920+0
output DP-1
off

View File

@ -0,0 +1,3 @@
DP-0 *
HDMI-1-1 *
eDP-1-1 *

View File

@ -0,0 +1,13 @@
output DP-0
off
output DP-1
off
output HDMI-1-1
off
output eDP-1-1
#crtc 0
gamma 1.0:0.909:0.909
mode 1920x1080
pos 0x0
primary
rate 59.98

View File

@ -0,0 +1 @@
eDP-1-1 *

6
dot_config/ccache.config Normal file
View File

@ -0,0 +1,6 @@
## options for R
max_size = 5.0G
# important for R CMD INSTALL *.tar.gz as tarballs are expanded freshly -> fresh ctime
sloppiness = include_file_ctime
# also important as the (temp.) directory name will differ
hash_dir = false

View File

@ -0,0 +1,10 @@
--process-per-site
--disk-cache-dir="/tmp/chromium-cache"
--ignore-gpu-blocklist
--enable-gpu-rasterization
--enable-zero-copy
--enable-oop-rasterization
--enable-accelerated-video-decode
--use-gl=desktop
--force-dark-mode
--enable-features=WebUIDarkMode

328
dot_config/dunstrc Normal file
View File

@ -0,0 +1,328 @@
[global]
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = none
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else
# in pixels. If the width is omitted but the height is given
# ("-geometry x2"), the message window expands over the whole screen
# (dmenu-like). If width is 0, the window expands to the longest
# message displayed. A positive x is measured from the left, a
# negative from the right side of the screen. Y is measured from
# the top and down respectively.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
geometry = "300x5-30+20"
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = yes
# Shrink window if it's smaller than the width. Will be ignored if
# width is 0.
shrink = no
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.).
transparency = 20
# The height of the entire notification. If the height is smaller
# than the font height and padding combined, it will be raised
# to the font height and padding.
notification_height = 0
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 2
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 8
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 1
# Defines color of the frame around the notification window.
frame_color = "#aaaaaa"
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = frame
# Sort messages by urgency.
sort = yes
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# Transient notifications ignore this setting.
idle_threshold = 120
### Text ###
font = DejaVu Sans 10
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
# Possible values are:
# full: Allow a small subset of html markup in notifications:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
# server. Dunst will try to strip the markup but the parsing is
# simplistic so using this option outside of matching rules for
# specific applications *IS GREATLY DISCOURAGED*.
#
# no: Disable markup parsing, incoming notifications will be treated as
# plain text. Dunst will not advertise that it has the body-markup
# capability if this is set as a global setting.
#
# It's important to note that markup inside the format option will be parsed
# regardless of what this is set to.
markup = full
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%s</b>\n%b"
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = yes
# When word_wrap is set to no, specify where to ellipsize long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Merge multiple notifications with the same content
stack_duplicates = true
# Hide the count of merged notifications with the same content
hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
### Icons ###
# Align icons left/right/off
icon_position = left
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 32
# Paths to default icons.
icon_path = /usr/share/icons/Papirus/symbolic/status/:/usr/share/icons/Papirus/symbolic/devices/:/usr/share/icons/hicolor/scalable/apps
### History ###
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 20
### Misc/Advanced ###
# dmenu path.
dmenu = /usr/bin/rofi -dmenu -p dunst
# Browser for opening urls in context menu.
browser = xdg-open
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst
title = Dunst
# Define the class of the windows spawned by dunst
class = Dunst
# Print a notification on startup.
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = false
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.
# This setting is provided for compatibility with older nVidia drivers that
# do not support RandR and using it on systems that support RandR is highly
# discouraged.
#
# By enabling this setting dunst will not be able to detect when a monitor
# is connected or disconnected which might break follow mode if the screen
# layout changes.
force_xinerama = false
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = false
[shortcuts]
# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.
# Close notification.
close = mod4+shift+grave
# Close all notifications.
close_all = mod4+ctrl+grave
# Redisplay last message(s).
# On the US keyboard layout "grave" is normally above TAB and left
# of "1". Make sure this key actually exists on your keyboard layout,
# e.g. check output of 'xmodmap -pke'
history = mod4+grave
# Context menu.
context = mod4+mod1+grave
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#d6d6d6"
foreground = "#2c2c2c"
frame_color = "#b0b0b0"
timeout = 10
# Icon for notifications with low urgency, uncomment to enable
#icon = /path/to/icon
[urgency_normal]
background = "#d6d6d6"
foreground = "#2c2c2c"
frame_color = "#b0b0b0"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
#icon = /path/to/icon
[urgency_critical]
background = "#ff9090"
foreground = "#2c2c2c"
frame_color = "#ffb0b0"
timeout = 0
# Icon for notifications with critical urgency, uncomment to enable
#icon = /path/to/icon
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
# Messages can be matched by "appname", "summary", "body", "icon", "category",
# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
# "background", "new_icon" and "format".
# Shell-like globbing will get expanded.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# format = ""
#[history-ignore]
# # This notification will not be saved in history
# summary = "foobar"
# history_ignore = yes
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
# vim: ft=cfg

View File

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign">
<bool>true</bool>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintmedium</const>
</edit>
<edit name="rgba" mode="assign">
<const>rgb</const>
</edit>
<edit name="autohint" mode="assign">
<bool>false</bool>
</edit>
<edit name="lcdfilter" mode="assign">
<const>lcddefault</const>
</edit>
<edit name="dpi" mode="assign">
<double>96</double>
</edit>
</match>
</fontconfig>

0
dot_config/git/.keep Normal file
View File

11
dot_config/git/config Normal file
View File

@ -0,0 +1,11 @@
[user]
name = ndwarshuis
email = ndwar@yavin4.ch
[core]
editor = vim
[merge]
tool = vimdiff
[color]
ui = true
[credential]
helper = /usr/lib/git-core/git-credential-libsecret

0
dot_config/isync/.keep Normal file
View File

249
dot_config/isync/mbsyncrc Normal file
View File

@ -0,0 +1,249 @@
##
## overall design
##
## Each of these configurations assume that I don't use the
## web interfaces (usually) for any of my servers and that I only
## use mu4e as my email client (because I am smarter than my
## smartphone).
## Further assumptions include that that the only "folders" (or labels)
## that I care about are inbox, archive, trash, and drafts (maybe).
## Anything beyond this turns email into something it is not (a
## terrible todo list). Spam/junk are useless to sync to a client
## machine (unless something important "goes to junk" which in my
## experience is extremely rare).
## To elaborate on the folders I do care about:
## - Inbox is the main interaction point with the email server/client.
## Mail comes in and I make the decision to reply (keep thread open in
## inbox), archive (important enough to keep, but not enough to stay
## in sight), or delete (just plain useless). (Note there is instant
## delete or move to trash depending on how sure I am of the message's
## uselessness). Note that ideally the inbox is empty...as in no
## files (regardless of read/unread). This keeps it fast and
## uncluttered.
## - Archive (or whatever this is called in the server) is for old
## messages that may be useful for reference). This is where many
## messages end up and accounts for most of the size/bulk of the files.
## This is also why small inbox is important, because searching through
## all these files is sloowwww.
## - Sent is useless (just search for To:notme in archive) so don't
## bother syncing at all.
## - Trash is useful but only locally. I found it was a pain to get
## trash to sync correctly with everything else mu4e does, so I don't
## actually sync this folder. Instead, server trash is for spam/auto-
## deleted crap found by my filters. Client trash works like actual
## trash on the web interface. If I lose my laptop...oh well, it's
## just trash :)
## - Drafts works just like trash in that it only is useful locally
## and not synced with the server. Ideally it is empty (why keep empty
## drafts??).
##
## gmail server
##
## To the best of my knowledge, gmail uses one giant folder and
## a bunch of "labels" to group emails. This is frustrating because
## it does not map to on-disk filesystem paths very nicely by default.
## Specifically, "All Mail" refers to everything minus trash/spam,
## and an "Inbox" label (folder?) is applied on top of this to denote
## the inbox messages. This leads to duplicates in many vanilla IMAP
## syncing solutions. (No idea why gmail was designed this way).
## To get around this, I created a new label called "rxv" (archive,
## because apparently this name is "system reserved" in gmail) to
## denote the "non-inbox" messages. This works but assumes that these
## labels are mutually exclusive (which has no enforcement in gmail)
## so all handling is done by mu4e to ensure that these are updated
## properly (eg msgs from inbox moved to archive folder). I also
## set auto-expunge = off and set deleted/expunged messages to be
## moved to trash (it could also be set to "delete forever" but trash
## is safer).
## NOTE: this does not seem to work all that well when one move from
## archive back to inbox (eg it actually double-labels the message)
## Since I hardly ever do this...whatever
IMAPAccount gmail
Host imap.gmail.com
User natedwarshuis@gmail.com
PassCmd "oauth-refresh natedwarshuis@gmail.com"
AuthMechs XOAUTH2
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
# CertificateFile ~/.local/etc/certs/imap.gmail.com.pem
# PipelineDepth 1
IMAPStore gmail-remote
Account gmail
MaildirStore gmail-local
Subfolders Verbatim
Path /mnt/data/Mail/gmail/
Inbox /mnt/data/Mail/gmail/inbox
Channel gmail-inbox
Master :gmail-remote:"INBOX"
Slave :gmail-local:"inbox"
Create Both
Expunge Master
SyncState *
Channel gmail-all
Master :gmail-remote:"rxv"
Slave :gmail-local:"archive"
Create Both
Expunge Slave
SyncState *
Group gmail
Channel gmail-inbox
Channel gmail-all
##
## gatech office365 server
##
## this is very similar to the gmail setup except that the sent
## folder must by synced as outlook does not group sent mail
## automagically in the inbox as gmail does (as a consequence of the
## "all mail" folder behavior?)
IMAPAccount gatech
Host outlook.office365.com
User ndwarshuis3@gatech.edu
PassCmd "oauth-refresh ndwarshuis3@gatech.edu"
AuthMechs XOAUTH2
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
PipelineDepth 1
IMAPStore gatech-remote
Account gatech
MailDirStore gatech-local
Path /mnt/data/Mail/gatech/
Inbox /mnt/data/Mail/gatech/inbox
Channel gatech-inbox
Master :gatech-remote:"Inbox"
Slave :gatech-local:"inbox"
Create Both
Expunge Both
SyncState *
Channel gatech-sent
Master :gatech-remote:"Sent Items"
Slave :gatech-local:"sent"
Create Both
Expunge Both
SyncState *
Channel gatech-archive
Master :gatech-remote:"Archive"
Slave :gatech-local:"archive"
Create Both
Expunge Both
SyncState *
Group gatech
Channel gatech-inbox
Channel gatech-sent
Channel gatech-archive
##
## emory office365 server
##
## identical to gatech server except different credentials
IMAPAccount emory
Host outlook.office365.com
User ndwarsh@emory.edu
PassCmd "pass email/ndwarsh@emory.edu/plain"
AuthMechs PLAIN
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
PipelineDepth 1
IMAPStore emory-remote
Account emory
MailDirStore emory-local
Path /mnt/data/Mail/emory/
Inbox /mnt/data/Mail/emory/inbox
Channel emory-inbox
Master :emory-remote:"Inbox"
Slave :emory-local:"inbox"
Create Both
Expunge Both
SyncState *
Channel emory-sent
Master :emory-remote:"Sent Items"
Slave :emory-local:"sent"
Create Both
Expunge Both
SyncState *
Channel emory-archive
Master :emory-remote:"Archive"
Slave :emory-local:"archive"
Create Both
Expunge Both
SyncState *
Group emory
Channel emory-inbox
Channel emory-sent
Channel emory-archive
##
## test email server
##
## to eventually be my primary email server
IMAPAccount yavin4
Host portnoy4prez.yavin4.ch
User ndwar@yavin4.ch
PassCmd "pass email/ndwar@yavin4.ch/plain"
AuthMechs PLAIN
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
PipelineDepth 1
IMAPStore yavin4-remote
Account yavin4
MailDirStore yavin4-local
Path /mnt/data/Mail/yavin4/
Inbox /mnt/data/Mail/yavin4/inbox
Channel yavin4-inbox
Master :yavin4-remote:"INBOX"
Slave :yavin4-local:"inbox"
Create Both
Expunge Both
SyncState *
Channel yavin4-sent
Master :yavin4-remote:"Sent"
Slave :yavin4-local:"sent"
Create Both
Expunge Both
SyncState *
Channel yavin4-archive
Master :yavin4-remote:"Archive"
Slave :yavin4-local:"archive"
Create Both
Expunge Both
SyncState *
Group yavin4
Channel yavin4-inbox
Channel yavin4-sent
Channel yavin4-archive

View File

View File

@ -0,0 +1,8 @@
[dmenu]
dmenu_command = rofi
wifi_chars = ▂▄▆█
list_saved = true
[editor]
terminal = urxvt
gui_if_available = True

227
dot_config/picom.conf Normal file
View File

@ -0,0 +1,227 @@
# Thank you code_nomad: http://9m.no/ꪯ鵞
# and Arch Wiki contributors: https://wiki.archlinux.org/index.php/Compton
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
#################################
#
# GLX backend
#
#################################
glx-no-stencil = true;
# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified,
# but a 20% increase when only 1/4 is.
# My tests on nouveau show terrible slowdown.
glx-copy-from-front = false;
# GLX backend: Use MESA_copy_sub_buffer to do partial screen update.
# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated.
# May break VSync and is not available on some drivers.
# Overrides --glx-copy-from-front.
# glx-use-copysubbuffermesa = true;
# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
# Recommended if it works.
# glx-no-rebind-pixmap = true;
# GLX backend: GLX buffer swap method we assume.
# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
# undefined is the slowest and the safest, and the default value.
# copy is fastest, but may fail on some drivers,
# 2-6 are gradually slower but safer (6 is still faster than 0).
# Usually, double buffer means 2, triple buffer means 3.
# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
# Useless with --glx-use-copysubbuffermesa.
# Partially breaks --resize-damage.
# Defaults to undefined.
#glx-swap-method = "undefined";
#################################
#
# Shadows
#
#################################
# Enabled client-side shadows on windows.
shadow = false;
# The blur radius for shadows. (default 12)
shadow-radius = 5;
# The left offset for shadows. (default -15)
shadow-offset-x = -5;
# The top offset for shadows. (default -15)
shadow-offset-y = -5;
# The translucency for shadows. (default .75)
shadow-opacity = 0.5;
# Set if you want different colour shadows
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
# The shadow exclude options are helpful if you have shadows enabled. Due to the way picom draws its shadows, certain applications will have visual glitches
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
shadow-exclude = [
"! name~=''",
"name = 'Notification'",
"name = 'Plank'",
"name = 'Docky'",
"name = 'Kupfer'",
"name = 'xfce4-notifyd'",
"name *= 'VLC'",
"name *= 'compton'",
"name *= 'picom'",
"name *= 'Chromium'",
"name *= 'Chrome'",
"class_g = 'Firefox' && argb",
"class_g = 'Conky'",
"class_g = 'Kupfer'",
"class_g = 'Synapse'",
"class_g ?= 'Notify-osd'",
"class_g ?= 'Cairo-dock'",
"class_g ?= 'Xfce4-notifyd'",
"class_g ?= 'Xfce4-power-manager'",
"_GTK_FRAME_EXTENTS@:c",
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];
# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners)
shadow-ignore-shaped = false;
#################################
#
# Opacity
#
#################################
inactive-opacity = 1;
active-opacity = 1;
frame-opacity = 1;
inactive-opacity-override = false;
# Dim inactive windows. (0.0 - 1.0)
# inactive-dim = 0.2;
# Do not let dimness adjust based on window opacity.
# inactive-dim-fixed = true;
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
# blur-background = true;
# Blur background of opaque windows with transparent frames as well.
# blur-background-frame = true;
# Do not let blur radius adjust based on window opacity.
blur-background-fixed = false;
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'"
];
#################################
#
# Fading
#
#################################
# Fade windows during opacity changes.
fading = false;
# The time between steps in a fade in milliseconds. (default 10).
fade-delta = 4;
# Opacity change between steps while fading in. (default 0.028).
fade-in-step = 0.03;
# Opacity change between steps while fading out. (default 0.03).
fade-out-step = 0.03;
# Fade windows in/out when opening/closing
# no-fading-openclose = true;
# Specify a list of conditions of windows that should not be faded.
fade-exclude = [ ];
#################################
#
# Other
#
#################################
# Try to detect WM windows and mark them as active.
mark-wmwin-focused = true;
# Mark all non-WM but override-redirect windows active (e.g. menus).
mark-ovredir-focused = true;
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
# Usually more reliable but depends on a EWMH-compliant WM.
use-ewmh-active-win = true;
# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-rounded-corners = true;
# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows.
# This prevents opacity being ignored for some apps.
# For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
detect-client-opacity = true;
# Specify refresh rate of the screen.
# If not specified or 0, picom will try detecting this with X RandR extension.
refresh-rate = 0;
# Vertical synchronization: match the refresh rate of the monitor
vsync = true;
# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
# Reported to have no effect, though.
dbe = false;
# Limit picom to repaint at most once every 1 / refresh_rate second to boost performance.
# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already,
# unless you wish to specify a lower refresh rate than the actual value.
#sw-opti = true;
# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games.
# Known to cause flickering when redirecting/unredirecting windows.
unredir-if-possible = false;
# Specify a list of conditions of windows that should always be considered focused.
focus-exclude = [ ];
# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time.
detect-transient = true;
# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time.
# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too.
detect-client-leader = true;
#################################
#
# Window type settings
#
#################################
wintypes:
{
tooltip =
{
# fade: Fade the particular type of windows.
fade = true;
# shadow: Give those windows shadow
shadow = false;
# opacity: Default opacity for the type of windows.
opacity = 0.85;
# focus: Whether to always consider windows of this type focused.
focus = true;
};
};
######################
#
# XSync
# See: https://github.com/yshui/picom/commit/b18d46bcbdc35a3b5620d817dd46fbc76485c20d
#
######################
# Use X Sync fence to sync clients' draw calls. Needed on nvidia-drivers with GLX backend for some users.
xrender-sync-fence = true;

View File

0
dot_config/psd/.keep Normal file
View File

70
dot_config/psd/psd.conf Normal file
View File

@ -0,0 +1,70 @@
#
# $HOME/.psd/psd.conf
#
# For documentation, refer to the psd man page or the wiki page
# https://wiki.archlinux.org/index.php/Profile-sync-daemon
## NOTE the following:
## To protect data from corruption, in the event that you do make an edit while
## psd is active, any changes made will be applied the next time you start psd.
# Uncomment and set to "yes" to use overlayfs instead of a full copy to reduce
# the memory costs and to improve sync/unsync operations.
#
# You must modprobe either the 'overlayfs' or 'overlay' module prior to running
# psd if you enable this option. Distros running the linux kernel version
# >=3.18.0 are likely using the 'overlay' module while some distros shipping
# older kernels, notably Ubuntu provide the older version of this module named
# 'overlay' not 'overlayfs'.
USE_OVERLAYFS="yes"
# List browsers separated by spaces to include in the sync. Useful if you do not
# wish to have all possible browser profiles sync'ed which is the default if
# this variable is left commented.
#
# Possible values:
# chromium
# chromium-dev
# conkeror.mozdev.org
# epiphany
# firefox
# firefox-trunk
# google-chrome
# google-chrome-beta
# google-chrome-unstable
# heftig-aurora
# icecat
# inox
# luakit
# midori
# opera
# opera-beta
# opera-developer
# opera-legacy
# otter-browser
# qupzilla
# palemoon
# rekonq
# seamonkey
# vivaldi
# vivaldi-snapshot
#
BROWSERS="chromium"
# Define where browser profiles will reside in tmpfs
# This location must be mounted to tmpfs and MUST have permissions of 777
# Use NO trailing backslash!
#
# Suggested locations based on distro defaults:
# Arch Linux/Chakra, Fedora, and Gentoo leave this commented out
# Debian 8+ use a setting of "/dev/shm"
# Ubuntu 15.05+ use "/dev/shm"
#VOLATILE="/tmp"
# Uncomment and set to "no" to completely disable the crash recovery feature.
#
# The default is to create crash recovery backups if the system is ungracefully
# powered-down due to a kernel panic, hitting the reset switch, battery going
# dead, etc. Some users keep very diligent backups and don't care to have this
# feature enabled.
#USE_BACKUPS="yes"

0
dot_config/python/.keep Normal file
View File

View File

@ -0,0 +1,16 @@
#! /bin/python
import atexit
import os
import readline
datadir = os.environ["XDG_DATA_HOME"]
histfile = os.path.join(datadir, "python", "history.log")
try:
readline.read_history_file(histfile)
# default history len is -1 (infinite), which may grow unruly
readline.set_history_length(1000)
except FileNotFoundError:
pass
atexit.register(readline.write_history_file, histfile)

0
dot_config/r/.keep Normal file
View File

15
dot_config/r/Makevars Normal file
View File

@ -0,0 +1,15 @@
MAKEFLAGS=-j4
## C options
CFLAGS=-O3 -Wall -pedantic -march=native -mtune=native -pipe
CXXFLAGS=-O3 -Wall -pedantic -march=native -mtune=native -pipe
## ccache options
VER=
CCACHE=ccache
CC=$(CCACHE) gcc$(VER)
CXX=$(CCACHE) g++$(VER)
CXX11=$(CCACHE) g++$(VER)
CXX14=$(CCACHE) g++$(VER)
FC=$(CCACHE) gfortran$(VER)
F77=$(CCACHE) gfortran$(VER)

6
dot_config/r/Renviron Normal file
View File

@ -0,0 +1,6 @@
R_HOME_USER = ${XDG_DATA_HOME}/r
R_PROFILE_USER = ${XDG_CONFIG_HOME}/r/Rprofile.r
R_MAKEVARS_USER = ${XDG_CONFIG_HOME}/r/Makevars
R_LIBS_USER = ${R_HOME_USER}/x86_64-pc-linux-gnu-library/
# this shouldn't be needed because ESS overrides it
R_HISTFILE = ${XDG_HOME_USER}/session.Rhistory

10
dot_config/r/Rprofile.r Normal file
View File

@ -0,0 +1,10 @@
.First <- function() {
## message("R is the best\n","working directory is:", getwd())
}
## Set CRAN mirror:
local({
r <- getOption("repos")
r["CRAN"] <- "https://cloud.r-project.org/"
options(repos = r, Ncpus = 8)
})

View File

View File

@ -0,0 +1,70 @@
; Global settings for redshift
[redshift]
; Set the day and night screen temperatures
temp-day=6500
temp-night=2500
; Disable the smooth fade between temperatures when Redshift starts and stops.
; 0 will cause an immediate change between screen temperatures.
; 1 will gradually apply the new screen temperature over a couple of seconds.
fade=1
; Solar elevation thresholds.
; By default, Redshift will use the current elevation of the sun to determine
; whether it is daytime, night or in transition (dawn/dusk). When the sun is
; above the degrees specified with elevation-high it is considered daytime and
; below elevation-low it is considered night.
;elevation-high=3
;elevation-low=-6
; Custom dawn/dusk intervals.
; Instead of using the solar elevation, the time intervals of dawn and dusk
; can be specified manually. The times must be specified as HH:MM in 24-hour
; format.
;dawn-time=6:00-7:45
;dusk-time=18:35-20:15
; Set the screen brightness. Default is 1.0.
;brightness=0.9
; It is also possible to use different settings for day and night
; since version 1.8.
;brightness-day=0.7
;brightness-night=0.4
; Set the screen gamma (for all colors, or each color channel
; individually)
;gamma=0.8
;gamma=0.8:0.7:0.8
; This can also be set individually for day and night since
; version 1.10.
;gamma-day=0.8:0.7:0.8
;gamma-night=0.6
; Set the location-provider: 'geoclue2', 'manual'
; type 'redshift -l list' to see possible values.
; The location provider settings are in a different section.
location-provider=manual
; Set the adjustment-method: 'randr', 'vidmode'
; type 'redshift -m list' to see all possible values.
; 'randr' is the preferred method, 'vidmode' is an older API.
; but works in some cases when 'randr' does not.
; The adjustment method settings are in a different section.
adjustment-method=randr
; Configuration of the location-provider:
; type 'redshift -l PROVIDER:help' to see the settings.
; ex: 'redshift -l manual:help'
; Keep in mind that longitudes west of Greenwich (e.g. the Americas)
; are negative numbers.
[manual]
lat=33.7
lon=-84.4
; Configuration of the adjustment-method
; type 'redshift -m METHOD:help' to see the settings.
; ex: 'redshift -m randr:help'
; In this example, randr is configured to adjust only screen 0.
; Note that the numbering starts from 0, so this is actually the first screen.
; If this option is not specified, Redshift will try to adjust _all_ screens.
[randr]
screen=0

0
dot_config/rofi/.keep Normal file
View File

View File

@ -0,0 +1,153 @@
/************************************************
* ROFI Color theme
* User: portnoy4prez
* Copyright: ...
***********************************************/
* {
spacing: 2;
foreground: white;
background: black / 70%;
normal-foreground: @foreground;
active-foreground: @foreground;
urgent-foreground: @foreground;
normal-background: transparent;
urgent-background: transparent;
active-background: #cb91ff66;
alternate-normal-foreground: @foreground;
alternate-urgent-foreground: @urgent-foreground;
alternate-active-foreground: @active-foreground;
alternate-normal-background: white / 8%;
alternate-urgent-background: red / 8%;
alternate-active-background: purple / 8%;
selected-normal-foreground: @foreground;
selected-urgent-foreground: @foreground;
selected-active-foreground: @foreground;
selected-normal-background: #3399ff;
selected-urgent-background: #ff8282;
selected-active-background: #9523ff;
red: rgba ( 220, 50, 47, 100 % );
blue: rgba ( 51, 139, 210, 100 % );
lightbg: rgba ( 238, 232, 213, 100 % );
lightfg: rgba ( 88, 104, 117, 100 % );
border-color: #777;
separatorcolor: white;
background-color: transparent;
}
#window {
background-color: black / 70%;
fullscreen: true;
padding: 30%;
}
#mainbox {
border: 1;
padding: 6;
background-color: @background;
}
#message {
border: 2px 0px 0px;
border-color: @separatorcolor;
padding: 5px 1px 3px 1px;
}
#textbox {
text-color: @foreground;
}
#listview {
fixed-height: 0;
border: 2px dash 0px 0px;
border-color: @separatorcolor;
spacing: 2px;
scrollbar: true;
padding: 2px 0px 0px;
}
#element {
border: 0;
padding: 1px ;
}
#element.normal.normal {
background-color: @normal-background;
text-color: @normal-foreground;
}
#element.normal.urgent {
background-color: @urgent-background;
text-color: @urgent-foreground;
}
#element.normal.active {
background-color: @active-background;
text-color: @active-foreground;
}
#element.selected.normal {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
}
#element.selected.urgent {
background-color: @selected-urgent-background;
text-color: @selected-urgent-foreground;
}
#element.selected.active {
background-color: @selected-active-background;
text-color: @selected-active-foreground;
}
#element.alternate.normal {
background-color: @alternate-normal-background;
text-color: @alternate-normal-foreground;
}
#element.alternate.urgent {
background-color: @alternate-urgent-background;
text-color: @alternate-urgent-foreground;
}
#element.alternate.active {
background-color: @alternate-active-background;
text-color: @alternate-active-foreground;
}
#scrollbar {
width: 4px ;
border: 0;
handle-color: @normal-foreground;
handle-width: 8px ;
padding: 0;
}
#sidebar {
border: 2px 0px 0px ;
border-color: @separatorcolor;
}
#button {
spacing: 0;
text-color: @normal-foreground;
}
#button.selected {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
}
#inputbar {
spacing: 0;
text-color: @normal-foreground;
padding: 1px;
}
#case-indicator {
spacing: 0;
text-color: @normal-foreground;
}
#entry {
spacing: 0;
text-color: @normal-foreground;
}
#prompt {
spacing: 0;
text-color: @normal-foreground;
}
#inputbar {
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
}
#textbox-prompt-colon {
expand: false;
str: ":";
margin: 0px 0.3em 0em 0em ;
text-color: @normal-foreground;
}

139
dot_config/rofi/config.rasi Normal file
View File

@ -0,0 +1,139 @@
configuration {
modi: "window,run,drun";
/* width: 50;*/
/* lines: 15;*/
/* columns: 1;*/
font: "DejaVu Sans Mono 12";
/* bw: 1;*/
/* location: 0;*/
/* padding: 5;*/
/* yoffset: 0;*/
/* xoffset: 0;*/
/* fixed-num-lines: true;*/
/* show-icons: false;*/
/* terminal: "rofi-sensible-terminal";*/
/* ssh-client: "ssh";*/
/* ssh-command: "{terminal} -e {ssh-client} {host}";*/
/* run-command: "{cmd}";*/
/* run-list-command: "";*/
/* run-shell-command: "{terminal} -e {cmd}";*/
/* window-command: "xkill -id {window}";*/
/* window-match-fields: "all";*/
/* drun-icon-theme: ;*/
/* drun-match-fields: "name,generic,exec,categories";*/
/* disable-history: false;*/
/* sort: false;*/
/* levenshtein-sort: false;*/
/* case-sensitive: false;*/
/* cycle: true;*/
/* sidebar-mode: false;*/
/* eh: 1;*/
/* auto-select: false;*/
/* parse-hosts: false;*/
/* parse-known-hosts: true;*/
/* combi-modi: "window,run";*/
/* matching: "normal";*/
/* tokenize: true;*/
/* m: "-5";*/
/* line-margin: 2;*/
/* line-padding: 1;*/
/* filter: ;*/
/* separator-style: "dash";*/
/* hide-scrollbar: false;*/
/* fullscreen: false;*/
/* fake-transparency: false;*/
/* dpi: -1;*/
/* threads: 0;*/
/* scrollbar-width: 8;*/
/* scroll-method: 0;*/
/* fake-background: "screenshot";*/
/* window-format: "{w} {i}{c} {t}";*/
/* click-to-exit: true;*/
/* show-match: true;*/
theme: "blackice";
/* color-normal: ;*/
/* color-urgent: ;*/
/* color-active: ;*/
/* color-window: ;*/
/* max-history-size: 25;*/
/* combi-hide-mode-prefix: false;*/
/* pid: "/run/user/1000/rofi.pid";*/
/* display-window: ;*/
/* display-windowcd: ;*/
/* display-run: ;*/
/* display-ssh: ;*/
/* display-drun: ;*/
/* display-combi: ;*/
/* display-keys: ;*/
/* kb-primary-paste: "Control+V,Shift+Insert";*/
/* kb-secondary-paste: "Control+v,Insert";*/
/* kb-clear-line: "Control+w";*/
/* kb-move-front: "Control+a";*/
/* kb-move-end: "Control+e";*/
/* kb-move-word-back: "Alt+b";*/
/* kb-move-word-forward: "Alt+f";*/
/* kb-move-char-back: "Left,Control+b";*/
/* kb-move-char-forward: "Right,Control+f";*/
/* kb-remove-word-back: "Control+Alt+h,Control+BackSpace";*/
/* kb-remove-word-forward: "Control+Alt+d";*/
/* kb-remove-char-forward: "Delete,Control+d";*/
/* kb-remove-char-back: "BackSpace,Control+h";*/
/* kb-remove-to-eol: "Control+k";*/
/* kb-remove-to-sol: "Control+u";*/
/* kb-accept-entry: "Control+j,Control+m,Return,KP_Enter";*/
/* kb-accept-custom: "Control+Return";*/
/* kb-accept-alt: "Shift+Return";*/
/* kb-delete-entry: "Shift+Delete";*/
/* kb-mode-next: "Shift+Right,Control+Tab";*/
/* kb-mode-previous: "Shift+Left,Control+ISO_Left_Tab";*/
/* kb-row-left: "Control+Page_Up";*/
/* kb-row-right: "Control+Page_Down";*/
/* kb-row-up: "Up,Control+p,ISO_Left_Tab";*/
/* kb-row-down: "Down,Control+n";*/
/* kb-row-tab: "Tab";*/
/* kb-page-prev: "Page_Up";*/
/* kb-page-next: "Page_Down";*/
/* kb-row-first: "Home,KP_Home";*/
/* kb-row-last: "End,KP_End";*/
/* kb-row-select: "Control+space";*/
/* kb-screenshot: "Alt+S";*/
/* kb-toggle-case-sensitivity: "grave,dead_grave";*/
/* kb-toggle-sort: "Alt+grave";*/
kb-cancel: "Escape,XF86Search,Control+g,Control+bracketleft";
/* kb-custom-1: "Alt+1";*/
/* kb-custom-2: "Alt+2";*/
/* kb-custom-3: "Alt+3";*/
/* kb-custom-4: "Alt+4";*/
/* kb-custom-5: "Alt+5";*/
/* kb-custom-6: "Alt+6";*/
/* kb-custom-7: "Alt+7";*/
/* kb-custom-8: "Alt+8";*/
/* kb-custom-9: "Alt+9";*/
/* kb-custom-10: "Alt+0";*/
/* kb-custom-11: "Alt+exclam";*/
/* kb-custom-12: "Alt+at";*/
/* kb-custom-13: "Alt+numbersign";*/
/* kb-custom-14: "Alt+dollar";*/
/* kb-custom-15: "Alt+percent";*/
/* kb-custom-16: "Alt+dead_circumflex";*/
/* kb-custom-17: "Alt+ampersand";*/
/* kb-custom-18: "Alt+asterisk";*/
/* kb-custom-19: "Alt+parenleft";*/
/* kb-select-1: "Super+1";*/
/* kb-select-2: "Super+2";*/
/* kb-select-3: "Super+3";*/
/* kb-select-4: "Super+4";*/
/* kb-select-5: "Super+5";*/
/* kb-select-6: "Super+6";*/
/* kb-select-7: "Super+7";*/
/* kb-select-8: "Super+8";*/
/* kb-select-9: "Super+9";*/
/* kb-select-10: "Super+0";*/
/* ml-row-left: "ScrollLeft";*/
/* ml-row-right: "ScrollRight";*/
/* ml-row-up: "ScrollUp";*/
/* ml-row-down: "ScrollDown";*/
/* me-select-entry: "MousePrimary";*/
/* me-accept-entry: "MouseDPrimary";*/
/* me-accept-custom: "Control+MouseDPrimary";*/
}

View File

@ -0,0 +1,9 @@
[Unit]
Description=Sync git repos
[Service]
Type=oneshot
ExecStart=%h/.bin/autogit "$REPOS"
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,2 @@
[Service]
Environment="REPOS=\"~/Org ~/Org/journal\""

View File

@ -0,0 +1,9 @@
[Unit]
Description=Run auto every hour
[Timer]
Persistent=true
OnCalendar=hourly
[Install]
WantedBy=timers.target

View File

@ -0,0 +1,9 @@
[Unit]
Description=Batmon service
[Service]
Type=oneshot
ExecStart=%h/.local/bin/batmon
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,10 @@
[Unit]
Description=Run batmon every minute
[Timer]
OnBootSec=0min
Persistent=true
OnCalendar=*:0/1
[Install]
WantedBy=timers.target

View File

@ -0,0 +1,9 @@
[Unit]
Description=Conky Pacman Stats Update Service
[Service]
Type=oneshot
ExecStart=%h/.config/conky/scripts/pacman_stats
[Install]
WantedBy=default.target

View File

@ -0,0 +1,9 @@
[Unit]
Description=Conky Pacman Stats Update Timer
[Timer]
OnBootSec=0s
OnUnitActiveSec=1m
[Install]
WantedBy=timers.target

Some files were not shown because too many files have changed in this diff Show More