56 changed files with 261 additions and 2332 deletions
@ -1,23 +0,0 @@
|
||||
#!/bin/sh |
||||
|
||||
send_notification() { |
||||
backlight=$(brightnessctl -m | cut -d, -f4 | sed 's/%//' | awk '{print int($1 / 3.25)}') |
||||
# Make the bar with the special character ─ (it's not dash -) |
||||
# https://en.wikipedia.org/wiki/Box-drawing_character |
||||
bar=$(seq -s "─" "$backlight" | sed 's/[0-9]//g') |
||||
# Send the notification |
||||
makoctl dismiss |
||||
notify-send -t 1000 "mon: $bar" |
||||
} |
||||
|
||||
case $1 in |
||||
up) |
||||
brightnessctl -q set +10% |
||||
send_notification |
||||
;; |
||||
down) |
||||
brightnessctl -q set 10%- |
||||
send_notification |
||||
;; |
||||
*) echo "usage: backlight [up|down]" ;; |
||||
esac |
@ -1,23 +0,0 @@
|
||||
#!/bin/sh |
||||
|
||||
## TODO: figure out whatever the fuck is happening here |
||||
#MONITORS="$(swaymsg -t get_outputs | jq -r 'length')" |
||||
#FOCUSED="$(swaymsg -t get_workspaces | jq -r '.. | select(.focused?) | .output')" |
||||
|
||||
#case $FOCUSED in |
||||
# eDP1) |
||||
#esac |
||||
|
||||
BG="$(xrq background)" |
||||
FG="$(xrq foreground)" |
||||
BLK="$(xrq color0)" |
||||
HL="$(xrq color1)" |
||||
FONT="Source Code Pro 9" |
||||
PROMPT=">" |
||||
LINES=10 |
||||
LH=20 |
||||
|
||||
bemenu -m -1 -n -p "$PROMPT" -l "$LINES" --fn "$FONT" -H "$LH" --scrollbar always \ |
||||
--tb "$HL" --tf "$BLK" --nb "$BG" --nf "$FG" \ |
||||
--hb "$BG" --hf "$HL" --fb "$BLK" --ff "$FG" \ |
||||
--scb "$BLK" --scf "$HL" |
@ -1,5 +0,0 @@
|
||||
#!/bin/sh |
||||
export LD_LIBRARY_PATH="/nix/store/rijqazlvihgh7zvi4yam1j9jjmahjm85-cairo-1.16.0/lib:/nix/store/fylgr4s2iid2q9c0xbqr6bq07w1isi1h-fontconfig-2.13.92-lib/lib:/nix/store/ai5054xzilz0q285c0ldabmkvhyyl6yq-glib-2.64.6/lib:/nix/store/1lj2b24v408awrfxw6xxv9spm9023lva-gmp-6.2.0/lib:/nix/store/gfip3n33lnd4k9kkp5zdv44njyxrmdpp-gtk+3-3.24.21/lib:/nix/store/20lw4zx8h7yakz8l55v6dwng7cp91v0w-gsettings-desktop-schemas-3.36.1/lib:/nix/store/vxh6zqkyv44gc7561aq9niqysp2k0n7w-libedit-20191231-3.1/lib:/nix/store/1mp991q6kxpc297hfchixhbzmfnya9dr-libGL-1.3.2/lib:/nix/store/fcr65nkrmq9hv7h1acxsdsald32acvjd-glu-9.0.1/lib:/nix/store/jw87zdhwkzcbam094f1hh4cjrx7gsyj9-libjpeg-turbo-2.0.4/lib:/nix/store/yljv27xqgkcwllczzr18sc483mzpxvc4-libpng-apng-1.6.37/lib:/nix/store/9x8s0431bb3r1jvqzcmdjmwc7nagcwwg-mpfr-4.1.0/lib:/nix/store/abxvl3x7hrlmimw3ck5nx04izhb0phhg-openssl-1.1.1k/lib:/nix/store/1waaha9ax2nr660y9iz5zpdg67r2sfzj-pango-1.45.5/lib:/nix/store/cy31ln6nx94mw8nm0sr1p857bcs51gj5-poppler-glib-20.08.0/lib:/nix/store/cs7gmwifrz0dqnjl3zlnlpkzyan1bhn2-readline-6.3p08/lib:/nix/store/y66v2n3chpg0qfn402ldihi38qdxllab-sqlite-3.33.0/lib" |
||||
|
||||
|
||||
/home/hazel/src/racket/racket/bin/drracket "$@" |
@ -1,3 +0,0 @@
|
||||
#!/usr/bin/env cached-nix-shell |
||||
#!nix-shell -i bash -p appimage-run |
||||
exec appimage-run /home/hazel/.itch/itch "$@" |
@ -1,64 +0,0 @@
|
||||
#!/usr/bin/env bash |
||||
# |
||||
# Control keyboard layout and backlight (Lenovo ThinkPad tested only) |
||||
# |
||||
# Author: Dave Eddy <dave@daveeddy.com> |
||||
# Date: June 25, 2018 |
||||
# License: MIT |
||||
|
||||
|
||||
TMPFILE=/tmp/keyboard-status |
||||
|
||||
# taken from https://wiki.archlinux.org/index.php/Keyboard_backlight |
||||
setKeyboardLight() { |
||||
echo "$1" > "$TMPFILE" |
||||
|
||||
dbus-send --system --type=method_call \ |
||||
--dest='org.freedesktop.UPower' \ |
||||
'/org/freedesktop/UPower/KbdBacklight' \ |
||||
'org.freedesktop.UPower.KbdBacklight.SetBrightness' \ |
||||
"int32:$1" |
||||
} |
||||
|
||||
# cycle the current state of the keyboard backlight |
||||
cycleKeyboardLight() { |
||||
local cur |
||||
cur="$(cat $TMPFILE)" |
||||
|
||||
case "$cur" in |
||||
0) setKeyboardLight 1;; |
||||
1) setKeyboardLight 2;; |
||||
2) setKeyboardLight 0;; |
||||
*) exit 1;; |
||||
esac |
||||
} |
||||
|
||||
usage() { |
||||
local prog=${0##*/} |
||||
cat <<-EOF |
||||
Usage: $prog <command> |
||||
|
||||
Examples |
||||
# control backlight |
||||
$prog [off | dim | bright/on] |
||||
|
||||
# print help |
||||
$prog help |
||||
EOF |
||||
} |
||||
|
||||
if [[ ! -f "$TMPFILE" ]]; then |
||||
echo '0' > "$TMPFILE" |
||||
fi |
||||
|
||||
case "$1" in |
||||
# lights |
||||
off) setKeyboardLight 0;; |
||||
dim) setKeyboardLight 1;; |
||||
on|bright) setKeyboardLight 2;; |
||||
cycle) cycleKeyboardLight;; |
||||
|
||||
help|-h) usage; exit 0;; |
||||
|
||||
*) usage >&2; exit 1;; |
||||
esac |
@ -1,68 +0,0 @@
|
||||
#!/usr/bin/env bash |
||||
|
||||
GDBUS_MONITOR_PID=/tmp/notify-action-dbus-monitor.$$.pid |
||||
GDBUS_MONITOR=(gdbus monitor --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications) |
||||
|
||||
NOTIFICATION_ID="$1" |
||||
if [[ -z "$NOTIFICATION_ID" ]]; then |
||||
echo "no notification id passed: $@" |
||||
exit 1; |
||||
fi |
||||
shift |
||||
|
||||
ACTION_COMMANDS=("$@") |
||||
if [[ -z "$ACTION_COMMANDS" ]]; then |
||||
echo "no action commands passed: $@" |
||||
exit 1; |
||||
fi |
||||
|
||||
cleanup() { |
||||
rm -f "$GDBUS_MONITOR_PID" |
||||
} |
||||
|
||||
create_pid_file(){ |
||||
rm -f "$GDBUS_MONITOR_PID" |
||||
umask 077 |
||||
touch "$GDBUS_MONITOR_PID" |
||||
} |
||||
|
||||
invoke_action() { |
||||
invoked_action_id="$1" |
||||
local action="" cmd="" |
||||
for index in "${!ACTION_COMMANDS[@]}"; do |
||||
if [[ $((index % 2)) == 0 ]]; then |
||||
action="${ACTION_COMMANDS[$index]}" |
||||
else |
||||
cmd="${ACTION_COMMANDS[$index]}" |
||||
if [[ "$action" == "$invoked_action_id" ]]; then |
||||
bash -c "${cmd}" & |
||||
fi |
||||
fi |
||||
done |
||||
} |
||||
|
||||
monitor() { |
||||
|
||||
create_pid_file |
||||
( "${GDBUS_MONITOR[@]}" & echo $! >&3 ) 3>"$GDBUS_MONITOR_PID" | while read -r line |
||||
do |
||||
local closed_notification_id="$(sed '/^\/org\/freedesktop\/Notifications: org.freedesktop.Notifications.NotificationClosed (uint32 \([0-9]\+\), uint32 [0-9]\+)$/!d;s//\1/' <<< "$line")" |
||||
if [[ -n "$closed_notification_id" ]]; then |
||||
if [[ "$closed_notification_id" == "$NOTIFICATION_ID" ]]; then |
||||
invoke_action close |
||||
break |
||||
fi |
||||
else |
||||
local action_invoked="$(sed '/\/org\/freedesktop\/Notifications: org.freedesktop.Notifications.ActionInvoked (uint32 \([0-9]\+\), '\''\(.*\)'\'')$/!d;s//\1:\2/' <<< "$line")" |
||||
IFS=: read invoked_id action_id <<< "$action_invoked" |
||||
if [[ "$invoked_id" == "$NOTIFICATION_ID" ]]; then |
||||
invoke_action "$action_id" |
||||
break |
||||
fi |
||||
fi |
||||
done |
||||
kill $(<"$GDBUS_MONITOR_PID") |
||||
cleanup |
||||
} |
||||
|
||||
monitor |
@ -1,312 +0,0 @@
|
||||
#!/usr/bin/env bash |
||||
|
||||
# notify-send.sh - drop-in replacement for notify-send with more features |
||||
# Copyright (C) 2015-2019 notify-send.sh authors (see AUTHORS file) |
||||
|
||||
# This program is free software: you can redistribute it and/or modify |
||||
# it under the terms of the GNU General Public License as published by |
||||
# the Free Software Foundation, either version 3 of the License, or |
||||
# (at your option) any later version. |
||||
|
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
|
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
# Desktop Notifications Specification |
||||
# https://developer.gnome.org/notification-spec/ |
||||
|
||||
VERSION=1.0 |
||||
NOTIFY_ARGS=(--session |
||||
--dest org.freedesktop.Notifications |
||||
--object-path /org/freedesktop/Notifications) |
||||
EXPIRE_TIME=-1 |
||||
APP_NAME="${0##*/}" |
||||
REPLACE_ID=0 |
||||
URGENCY=1 |
||||
HINTS=() |
||||
SUMMARY_SET=n |
||||
|
||||
help() { |
||||
cat <<EOF |
||||
Usage: |
||||
notify-send.sh [OPTION...] <SUMMARY> [BODY] - create a notification |
||||
|
||||
Help Options: |
||||
-?|--help Show help options |
||||
|
||||
Application Options: |
||||
-u, --urgency=LEVEL Specifies the urgency level (low, normal, critical). |
||||
-t, --expire-time=TIME Specifies the timeout in milliseconds at which to expire the notification. |
||||
-f, --force-expire Forcefully closes the notification when the notification has expired. |
||||
-a, --app-name=APP_NAME Specifies the app name for the icon. |
||||
-i, --icon=ICON[,ICON...] Specifies an icon filename or stock icon to display. |
||||
-c, --category=TYPE[,TYPE...] Specifies the notification category. |
||||
-h, --hint=TYPE:NAME:VALUE Specifies basic extra data to pass. Valid types are int, double, string and byte. |
||||
-o, --action=LABEL:COMMAND Specifies an action. Can be passed multiple times. LABEL is usually a button's label. COMMAND is a shell command executed when action is invoked. |
||||
-d, --default-action=COMMAND Specifies the default action which is usually invoked by clicking the notification. |
||||
-l, --close-action=COMMAND Specifies the action invoked when notification is closed. |
||||
-p, --print-id Print the notification ID to the standard output. |
||||
-r, --replace=ID Replace existing notification. |
||||
-R, --replace-file=FILE Store and load notification replace ID to/from this file. |
||||
-s, --close=ID Close notification. |
||||
-v, --version Version of the package. |
||||
|
||||
EOF |
||||
} |
||||
|
||||
convert_type() { |
||||
case "$1" in |
||||
int) echo int32 ;; |
||||
double|string|byte) echo "$1" ;; |
||||
*) echo error; return 1 ;; |
||||
esac |
||||
} |
||||
|
||||
make_action_key() { |
||||
echo "$(tr -dc _A-Z-a-z-0-9 <<< \"$1\")${RANDOM}" |
||||
} |
||||
|
||||
make_action() { |
||||
local action_key="$1" |
||||
printf -v text "%q" "$2" |
||||
echo "\"$action_key\", \"$text\"" |
||||
} |
||||
|
||||
make_hint() { |
||||
type=$(convert_type "$1") |
||||
[[ ! $? = 0 ]] && return 1 |
||||
name="$2" |
||||
[[ "$type" = string ]] && command="\"$3\"" || command="$3" |
||||
echo "\"$name\": <$type $command>" |
||||
} |
||||
|
||||
concat_actions() { |
||||
local result="$1" |
||||
shift |
||||
for s in "$@"; do |
||||
result="$result, $s" |
||||
done |
||||
echo "[$result]" |
||||
} |
||||
|
||||
concat_hints() { |
||||
local result="$1" |
||||
shift |
||||
for s in "$@"; do |
||||
result="$result, $s" |
||||
done |
||||
echo "{$result}" |
||||
} |
||||
|
||||
parse_notification_id(){ |
||||
sed 's/(uint32 \([0-9]\+\),)/\1/g' |
||||
} |
||||
|
||||
notify() { |
||||
local actions="$(concat_actions "${ACTIONS[@]}")" |
||||
local hints="$(concat_hints "${HINTS[@]}")" |
||||
|
||||
NOTIFICATION_ID=$(gdbus call "${NOTIFY_ARGS[@]}" \ |
||||
--method org.freedesktop.Notifications.Notify \ |
||||
"$APP_NAME" "$REPLACE_ID" "$ICON" "$SUMMARY" "$BODY" \ |
||||
"${actions}" "${hints}" "int32 $EXPIRE_TIME" \ |
||||
| parse_notification_id) |
||||
|
||||
if [[ -n "$STORE_ID" ]] ; then |
||||
echo "$NOTIFICATION_ID" > $STORE_ID |
||||
fi |
||||
if [[ -n "$PRINT_ID" ]] ; then |
||||
echo "$NOTIFICATION_ID" |
||||
fi |
||||
|
||||
if [[ -n "$FORCE_EXPIRE" ]] ; then |
||||
type bc &> /dev/null || { echo "bc command not found. Please install bc package."; exit 1; } |
||||
SLEEP_TIME="$(bc <<< "scale=3; $EXPIRE_TIME / 1000")" |
||||
( sleep "$SLEEP_TIME" ; notify_close "$NOTIFICATION_ID" ) & |
||||
fi |
||||
|
||||
maybe_run_action_handler |
||||
} |
||||
|
||||
notify_close () { |
||||
gdbus call "${NOTIFY_ARGS[@]}" --method org.freedesktop.Notifications.CloseNotification "$1" >/dev/null |
||||
} |
||||
|
||||
process_urgency() { |
||||
case "$1" in |
||||
low) URGENCY=0 ;; |
||||
normal) URGENCY=1 ;; |
||||
critical) URGENCY=2 ;; |
||||
*) echo "Unknown urgency $URGENCY specified. Known urgency levels: low, normal, critical." |
||||
exit 1 |
||||
;; |
||||
esac |
||||
} |
||||
|
||||
process_category() { |
||||
IFS=, read -a categories <<< "$1" |
||||
for category in "${categories[@]}"; do |
||||
hint="$(make_hint string category "$category")" |
||||
HINTS=("${HINTS[@]}" "$hint") |
||||
done |
||||
} |
||||
|
||||
process_hint() { |
||||
IFS=: read type name command <<< "$1" |
||||
if [[ -z "$name" ]] || [[ -z "$command" ]] ; then |
||||
echo "Invalid hint syntax specified. Use TYPE:NAME:VALUE." |
||||
exit 1 |
||||
fi |
||||
hint="$(make_hint "$type" "$name" "$command")" |
||||
if [[ ! $? = 0 ]] ; then |
||||
echo "Invalid hint type \"$type\". Valid types are int, double, string and byte." |
||||
exit 1 |
||||
fi |
||||
HINTS=("${HINTS[@]}" "$hint") |
||||
} |
||||
|
||||
maybe_run_action_handler() { |
||||
if [[ -n "$NOTIFICATION_ID" ]] && [[ -n "$ACTION_COMMANDS" ]]; then |
||||
local notify_action="$(dirname ${BASH_SOURCE[0]})/notify-action.sh" |
||||
if [[ -x "$notify_action" ]] ; then |
||||
"$notify_action" "$NOTIFICATION_ID" "${ACTION_COMMANDS[@]}" & |
||||
exit 0 |
||||
else |
||||
echo "executable file not found: $notify_action" |
||||
exit 1 |
||||
fi |
||||
fi |
||||
} |
||||
|
||||
process_action() { |
||||
IFS=: read name command <<<"$1" |
||||
if [[ -z "$name" ]] || [[ -z "$command" ]]; then |
||||
echo "Invalid action syntax specified. Use NAME:COMMAND." |
||||
exit 1 |
||||
fi |
||||
|
||||
local action_key="$(make_action_key "$name")" |
||||
ACTION_COMMANDS=("${ACTION_COMMANDS[@]}" "$action_key" "$command") |
||||
|
||||
local action="$(make_action "$action_key" "$name")" |
||||
ACTIONS=("${ACTIONS[@]}" "$action") |
||||
} |
||||
|
||||
process_special_action() { |
||||
action_key="$1" |
||||
command="$2" |
||||
|
||||
if [[ -z "$action_key" ]] || [[ -z "$command" ]]; then |
||||
echo "Command must not be empty" |
||||
exit 1 |
||||
fi |
||||
|
||||
ACTION_COMMANDS=("${ACTION_COMMANDS[@]}" "$action_key" "$command") |
||||
|
||||
if [[ "$action_key" != close ]]; then |
||||
local action="$(make_action "$action_key" "$name")" |
||||
ACTIONS=("${ACTIONS[@]}" "$action") |
||||
fi |
||||
} |
||||
|
||||
process_posargs() { |
||||
if [[ "$1" = -* ]] && ! [[ "$positional" = yes ]] ; then |
||||
echo "Unknown option $1" |
||||
exit 1 |
||||
else |
||||
if [[ "$SUMMARY_SET" = n ]]; then |
||||
SUMMARY="$1" |
||||
SUMMARY_SET=y |
||||
else |
||||
BODY="$1" |
||||
fi |
||||
fi |
||||
} |
||||
|
||||
while (( $# > 0 )) ; do |
||||
case "$1" in |
||||
-\?|--help) |
||||
help |
||||
exit 0 |
||||
;; |
||||
-v|--version) |
||||
echo "${0##*/} $VERSION" |
||||
exit 0 |
||||
;; |
||||
-u|--urgency|--urgency=*) |
||||
[[ "$1" = --urgency=* ]] && urgency="${1#*=}" || { shift; urgency="$1"; } |
||||
process_urgency "$urgency" |
||||
;; |
||||
-t|--expire-time|--expire-time=*) |
||||
[[ "$1" = --expire-time=* ]] && EXPIRE_TIME="${1#*=}" || { shift; EXPIRE_TIME="$1"; } |
||||
;; |
||||
-f|--force-expire) |
||||
FORCE_EXPIRE=yes |
||||
;; |
||||
-a|--app-name|--app-name=*) |
||||
[[ "$1" = --app-name=* ]] && APP_NAME="${1#*=}" || { shift; APP_NAME="$1"; } |
||||
;; |
||||
-i|--icon|--icon=*) |
||||
[[ "$1" = --icon=* ]] && ICON="${1#*=}" || { shift; ICON="$1"; } |
||||
;; |
||||
-c|--category|--category=*) |
||||
[[ "$1" = --category=* ]] && category="${1#*=}" || { shift; category="$1"; } |
||||
process_category "$category" |
||||
;; |
||||
-h|--hint|--hint=*) |
||||
[[ "$1" = --hint=* ]] && hint="${1#*=}" || { shift; hint="$1"; } |
||||
process_hint "$hint" |
||||
;; |
||||
-o | --action | --action=*) |
||||
[[ "$1" == --action=* ]] && action="${1#*=}" || { shift; action="$1"; } |
||||
process_action "$action" |
||||
;; |
||||
-d | --default-action | --default-action=*) |
||||
[[ "$1" == --default-action=* ]] && default_action="${1#*=}" || { shift; default_action="$1"; } |
||||
process_special_action default "$default_action" |
||||
;; |
||||
-l | --close-action | --close-action=*) |
||||
[[ "$1" == --close-action=* ]] && close_action="${1#*=}" || { shift; close_action="$1"; } |
||||
process_special_action close "$close_action" |
||||
;; |
||||
-p|--print-id) |
||||
PRINT_ID=yes |
||||
;; |
||||
-r|--replace|--replace=*) |
||||
[[ "$1" = --replace=* ]] && REPLACE_ID="${1#*=}" || { shift; REPLACE_ID="$1"; } |
||||
;; |
||||
-R|--replace-file|--replace-file=*) |
||||
[[ "$1" = --replace-file=* ]] && filename="${1#*=}" || { shift; filename="$1"; } |
||||
if [[ -s "$filename" ]]; then |
||||
REPLACE_ID="$(< $filename)" |
||||
fi |
||||
STORE_ID="$filename" |
||||
;; |
||||
-s|--close|--close=*) |
||||
[[ "$1" = --close=* ]] && close_id="${1#*=}" || { shift; close_id="$1"; } |
||||
notify_close "$close_id" |
||||
exit $? |
||||
;; |
||||
--) |
||||
positional=yes |
||||
;; |
||||
*) |
||||
process_posargs "$1" |
||||
;; |
||||
esac |
||||
shift |
||||
done |
||||
|
||||
# urgency is always set |
||||
HINTS=("$(make_hint byte urgency "$URGENCY")" "${HINTS[@]}") |
||||
|
||||
if [[ "$SUMMARY_SET" = n ]] ; then |
||||
help |
||||
exit 1 |
||||
else |
||||
notify |
||||
fi |
@ -1,4 +0,0 @@
|
||||
#!/bin/sh |
||||
export LD_LIBRARY_PATH="/nix/store/rijqazlvihgh7zvi4yam1j9jjmahjm85-cairo-1.16.0/lib:/nix/store/fylgr4s2iid2q9c0xbqr6bq07w1isi1h-fontconfig-2.13.92-lib/lib:/nix/store/ai5054xzilz0q285c0ldabmkvhyyl6yq-glib-2.64.6/lib:/nix/store/1lj2b24v408awrfxw6xxv9spm9023lva-gmp-6.2.0/lib:/nix/store/gfip3n33lnd4k9kkp5zdv44njyxrmdpp-gtk+3-3.24.21/lib:/nix/store/20lw4zx8h7yakz8l55v6dwng7cp91v0w-gsettings-desktop-schemas-3.36.1/lib:/nix/store/vxh6zqkyv44gc7561aq9niqysp2k0n7w-libedit-20191231-3.1/lib:/nix/store/1mp991q6kxpc297hfchixhbzmfnya9dr-libGL-1.3.2/lib:/nix/store/fcr65nkrmq9hv7h1acxsdsald32acvjd-glu-9.0.1/lib:/nix/store/jw87zdhwkzcbam094f1hh4cjrx7gsyj9-libjpeg-turbo-2.0.4/lib:/nix/store/yljv27xqgkcwllczzr18sc483mzpxvc4-libpng-apng-1.6.37/lib:/nix/store/9x8s0431bb3r1jvqzcmdjmwc7nagcwwg-mpfr-4.1.0/lib:/nix/store/abxvl3x7hrlmimw3ck5nx04izhb0phhg-openssl-1.1.1k/lib:/nix/store/1waaha9ax2nr660y9iz5zpdg67r2sfzj-pango-1.45.5/lib:/nix/store/cy31ln6nx94mw8nm0sr1p857bcs51gj5-poppler-glib-20.08.0/lib:/nix/store/cs7gmwifrz0dqnjl3zlnlpkzyan1bhn2-readline-6.3p08/lib:/nix/store/y66v2n3chpg0qfn402ldihi38qdxllab-sqlite-3.33.0/lib" |
||||
|
||||
/home/hazel/src/racket/racket/bin/racket "$@" |
@ -1,4 +0,0 @@
|
||||
#!/bin/sh |
||||
export LD_LIBRARY_PATH="/nix/store/rijqazlvihgh7zvi4yam1j9jjmahjm85-cairo-1.16.0/lib:/nix/store/fylgr4s2iid2q9c0xbqr6bq07w1isi1h-fontconfig-2.13.92-lib/lib:/nix/store/ai5054xzilz0q285c0ldabmkvhyyl6yq-glib-2.64.6/lib:/nix/store/1lj2b24v408awrfxw6xxv9spm9023lva-gmp-6.2.0/lib:/nix/store/gfip3n33lnd4k9kkp5zdv44njyxrmdpp-gtk+3-3.24.21/lib:/nix/store/20lw4zx8h7yakz8l55v6dwng7cp91v0w-gsettings-desktop-schemas-3.36.1/lib:/nix/store/vxh6zqkyv44gc7561aq9niqysp2k0n7w-libedit-20191231-3.1/lib:/nix/store/1mp991q6kxpc297hfchixhbzmfnya9dr-libGL-1.3.2/lib:/nix/store/fcr65nkrmq9hv7h1acxsdsald32acvjd-glu-9.0.1/lib:/nix/store/jw87zdhwkzcbam094f1hh4cjrx7gsyj9-libjpeg-turbo-2.0.4/lib:/nix/store/yljv27xqgkcwllczzr18sc483mzpxvc4-libpng-apng-1.6.37/lib:/nix/store/9x8s0431bb3r1jvqzcmdjmwc7nagcwwg-mpfr-4.1.0/lib:/nix/store/abxvl3x7hrlmimw3ck5nx04izhb0phhg-openssl-1.1.1k/lib:/nix/store/1waaha9ax2nr660y9iz5zpdg67r2sfzj-pango-1.45.5/lib:/nix/store/cy31ln6nx94mw8nm0sr1p857bcs51gj5-poppler-glib-20.08.0/lib:/nix/store/cs7gmwifrz0dqnjl3zlnlpkzyan1bhn2-readline-6.3p08/lib:/nix/store/y66v2n3chpg0qfn402ldihi38qdxllab-sqlite-3.33.0/lib" |
||||
|
||||
/home/hazel/src/racket/racket/bin/raco "$@" |
@ -1,47 +0,0 @@
|
||||
#!/usr/bin/env cached-nix-shell |
||||
#!nix-shell -i bash -p wf-recorder ffmpeg-full |
||||
set -x |
||||
if ! lsmod | grep v4l2loopback > /dev/null; then |
||||
echo "Adding v42loopback module to kernel" |
||||
sudo modprobe v4l2loopback |
||||
fi |
||||
|
||||
geometry() { |
||||
window_geometries=$( |
||||
# `height - 1` is there because of: https://github.com/ammen99/wf-recorder/pull/56 (I could remove it if it's merged, maybe) |
||||
swaymsg -t get_workspaces -r | jq -r '.[] | select(.focused) | .rect | "\(.x),\(.y) \(.width)x\(.height - 1)"'; \ |
||||
swaymsg -t get_outputs -r | jq -r '.[] | select(.active) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' |
||||
) |
||||
geometry=$(slurp -b "#45858820" -c "#45858880" -w 3 -d <<< "$window_geometries") || exit $? |
||||
echo $geometry |
||||
} |
||||
|
||||
{ |
||||
if pgrep wf-recorder > /dev/null && pgrep ffplay > /dev/null |
||||
then |
||||
if pgrep ffplay > /dev/null; then |
||||
pkill ffplay > /dev/null |
||||
fi |
||||
if pgrep wf-recorder > /dev/null; then |
||||
pkill wf-recorder > /dev/null |
||||
fi |
||||
notify-send -t 2000 "Wayland recording has been stopped" |
||||
else |
||||
if ! pgrep wf-recorder > /dev/null; then |
||||
geometry=$(geometry) || exit $? |
||||
wf-recorder --muxer=v4l2 --codec=rawvideo --file=/dev/video0 --geometry="$geometry" & |
||||
fi |
||||
if ! pgrep ffplay; then |
||||
swaymsg assign [class=ffplay] workspace 11 |
||||
|
||||
unset SDL_VIDEODRIVER |
||||
ffplay /dev/video0 -fflags nobuffer & |
||||
sleep 0.5 |
||||
# a hack so FPS is not dropping |
||||
swaymsg [class=ffplay] floating enable |
||||
# swaymsg [class=ffplay] move position 1900 1000 |
||||
# swaymsg focus tiling |
||||
fi |
||||
notify-send -t 2000 "Wayland recording has been started" |
||||
fi |
||||
} > ~/.cache/wayland-share-screen.log 2>&1 |
@ -1,14 +0,0 @@
|
||||
|
||||
# WARN: this file will get overwritten by $ cachix use <name> |
||||
{ pkgs, lib, ... }: |
||||
|
||||
let |
||||
folder = ./cachix; |
||||
toImport = name: value: folder + ("/" + name); |
||||
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; |
||||
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); |
||||
in { |
||||
inherit imports; |
||||
nix.binaryCaches = ["https://cache.nixos.org/"]; |
||||
} |
||||
|
@ -1,12 +0,0 @@
|
||||
|
||||
{ |
||||
nix = { |
||||
binaryCaches = [ |
||||
"https://nix-community.cachix.org" |
||||
]; |
||||
binaryCachePublicKeys = [ |
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" |
||||
]; |
||||
}; |
||||
} |
||||
|
@ -1,50 +1,97 @@
|
||||
# flake.nix -- the glue 2: even gluier |
||||
# flake.nix: the glue, but even gluier |
||||
{ |
||||
description = "maybe you wouldn't have so many problems if you weren't on a zoomer distro"; |
||||
# -- paraphrased from sam-tobin hochstadt, 2021 |
||||
description = "maybe you'd have less problems if you weren't on a zoomer distro"; |
||||
|
||||
inputs = { |
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-20.09"; |
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; |
||||
# nixpkgs-master.url = "github:nixos/nixpkgs"; |
||||
utils.url = "github:gytis-ivaskevicius/flake-utils-plus"; |
||||
|
||||
home-manager = { |
||||
url = "github:nix-community/home-manager/release-20.09"; |
||||
inputs.nixpkgs.follows = "nixpkgs"; |
||||
}; |
||||
emacs-overlay.url = "github:nix-community/emacs-overlay/master"; |
||||
emacs-overlay.url = "github:nix-community/emacs-overlay"; |
||||
nixos-hardware.url = "github:nixos/nixos-hardware"; |
||||
|
||||
# temporary |
||||
simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-21.05"; |
||||
|
||||
zsh-syntax-highlighting = { |
||||
url = "github:zsh-users/zsh-syntax-highlighting"; |
||||
flake = false; |
||||
}; |
||||
}; |
||||
|
||||
outputs = inputs@{ self, |
||||
utils, |
||||
nixpkgs, |
||||
nixpkgs-unstable, |
||||
emacs-overlay, |
||||
home-manager, |
||||
nixos-hardware, |
||||
utils }: |
||||
utils.lib.systemFlake { |
||||
inherit self inputs; |
||||
home-manager, |
||||
simple-nixos-mailserver, ... }: |
||||
utils.lib.systemFlake { |
||||
inherit self inputs; |
||||
|
||||
supportedSystems = [ "x86_64-linux" ]; # I tried running this on aarch64, it didn't end well |
||||
supportedSystems = [ "x86_64-linux" ]; |
||||
|
||||
modules = utils.lib.modulesFromList [ ./configuration.nix ]; # fuck it |
||||
channels.unstable.input = nixpkgs-unstable; |
||||
channels.nixpkgs = { |
||||
input = nixpkgs; |
||||
|
||||
channels.nixpkgs = { |
||||
input = nixpkgs; |
||||
overlays = import ./packages; |
||||
}; |
||||
# overrides |
||||
overlaysBuilder = channels: [ |
||||
(final: prev: { |
||||
inherit (channels.unstable) |
||||
element-desktop sage rust-analyzer julia-mono; |
||||
}) |
||||
]; |
||||
}; |
||||
channelsConfig = { allowUnfree = true; }; |
||||
|
||||
# hosts = { |
||||
# hyacinth.modules = [ ./machines/hyacinth ]; |
||||
# kerria.modules = [ ./machines/kerria ]; |
||||
# lucy.modules = [ ./machines/lucy ]; |
||||
# }; |
||||
hosts = { |
||||
hyacinth.modules = [ |
||||
./configuration.nix |
||||
./machines/hyacinth |
||||
nixos-hardware.nixosModules.lenovo-thinkpad-t495 |
||||
]; |
||||
kerria.modules = [ |
||||
./configuration.nix |
||||
./machines/kerria |
||||
nixos-hardware.nixosModules.pcengines-apu |
||||
|
||||
sharedModules = with self.modules; [ |
||||
home-manager.nixosModules.home-manager |
||||
utils.nixosModules.saneFlakeDefaults |
||||
]; |
||||
}; |
||||
simple-nixos-mailserver.nixosModule |
||||
{ |
||||
mailserver = { |
||||
enable = true; |
||||
fqdn = "mail.knightsofthelambdacalcul.us"; |
||||
domains = [ "knightsofthelambdacalcul.us" ]; |
||||
|
||||
loginAccounts = { |
||||
"hazel@knightsofthelambdacalcul.us" = { |
||||
hashedPasswordFile = /etc/snm-hashed-passwd; |
||||
aliases = [ "postmaster@knightsofthelambdacalcul.us" ]; |
||||
}; |
||||
}; |
||||
|
||||
certificateScheme = 3; # use letsencrypt |
||||
|
||||
enableImap = true; |
||||
enableImapSsl = true; |
||||
enablePop3 = false; |
||||
enablePop3Ssl = false; |
||||
|
||||
enableManageSieve = true; |
||||
}; |
||||
} |
||||
]; |
||||
}; |
||||
|
||||
sharedModules = [ |
||||
nixpkgs.nixosModules.notDetected # enable nonfree firmwares |
||||
home-manager.nixosModules.home-manager |
||||
]; |
||||
|
||||
# sharedOverlays = import ./packages; |
||||
}; |
||||
} |
||||
|
@ -1,35 +0,0 @@
|
||||
{ config, lib, pkgs, ... }: |
||||
let |
||||
cfg = config.hazel.modules.hikari; |
||||
in |
||||
with lib; { |
||||
options = { |
||||
hazel.modules.hikari = { |
||||
enable = mkEnableOption "hikari"; |
||||
|
||||
config = mkOption { |
||||
type = with types; attrs; # don't know if this needs to be more specific |
||||
}; |
||||
|
||||
# TODO: make this a list? shell codegen? |
||||
autoStart = mkOption { |
||||
type = with types; str; |
||||
default = ""; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
config = mkIf cfg.enable { |
||||
security.pam.services.hikari-unlocker.text = "auth include login"; |
||||
|
||||
hazel.home.xdg.configFile."hikari/hikari.conf".text = builtins.toJSON cfg.config; |
||||
hazel.home.xdg.configFile."hikari/autostart".text = cfg.autoStart; |
||||
hazel.home.xdg.configFile."hikari/autostart".executable = true; |
||||
|
||||
hazel.home.home.packages = with pkgs; [ |
||||
hazel.hikari |
||||
xwayland |
||||
swaybg |
||||
]; |
||||
}; |
||||
} |
@ -1,123 +0,0 @@
|
||||
{ config, lib, pkgs, ... }: |
||||
with lib; let |
||||
cfg = config.hazel.modules.i3status-rust; |
||||
|
||||
mapAttrsToList = f: l: |
||||
attrValues (mapAttrs f l); |
||||
|
||||
formatLine = n: v: |
||||
let |
||||
formatValue = v: |
||||
if isList v then |
||||
"[${concatStringsSep ", " (map (x: ''"${x}"'') v)}]" |
||||
else if isBool v then |
||||
(if v then "true" else "false") |
||||
else if isString v then |
||||
''"${v}"'' |
||||
else |
||||
toString v; in |
||||
"${n} = ${formatValue v}"; |
||||
|
||||
formatAttrs = vs: |
||||
concatStringsSep "\n" (mapAttrsToList formatLine vs); |
||||
|
||||
formatBlock = vs: |
||||
'' |
||||
[[block]] |
||||
block = "${vs.name}" |
||||
${formatAttrs vs.settings} |
||||
''; |
||||
|
||||
formatSetting = b: s: vs: |
||||
'' |
||||
[${b}] |
||||
name = "${s}" |
||||
[${b}.overrides] |
||||
${formatAttrs vs} |
||||
''; |
||||
in { |
||||
options = { |
||||
hazel.modules.i3status-rust = { |
||||
enable = mkEnableOption "i3status-rust"; |
||||
|
||||
blocks = mkOption { |
||||
type = types.listOf (types.submodule { |
||||
options = { |
||||
name = mkOption { |
||||
type = with types; str; |
||||
description = '' |
||||
The name of the block. |
||||
''; |
||||
}; |
||||
|
||||
settings = mkOption { |
||||
default = {}; |
||||
type = with types; attrsOf (oneOf [ bool int str (listOf str) ]); |
||||
description = '' |
||||
The settings for this block. |
||||
''; |
||||
}; |
||||
}; |
||||
}); |
||||
}; |
||||
|
||||
icons = mkOption { |
||||
type = types.submodule { |
||||
options = { |
||||
name = mkOption { |
||||
default = "awesome"; |
||||
type = with types; str; |
||||
description = '' |
||||
The icon pack to use for the bar. |
||||
''; |
||||
}; |
||||
|
||||
overrides = mkOption { |
||||
default = {}; |
||||
type = with types; attrsOf str; |
||||
description = '' |
||||
Overridden icons for use in the given block. |
||||
''; |
||||
}; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
theme = mkOption { |
||||
type = types.submodule { |
||||
options = { |
||||
name = mkOption { |
||||
default = "solarized-dark"; |
||||
type = with types; str; |
||||
description = '' |
||||
The theme to use in the bar. |
||||
''; |
||||
}; |
||||
|
||||
overrides = mkOption { |
||||
default = {}; |
||||
type = with types; attrsOf str; |
||||
description = '' |
||||
Overridden colors for use in the given theme. |
||||
''; |
||||
}; |
||||
}; |
||||
}; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
config = mkIf cfg.enable { |
||||
hazel.home = { |
||||
home.packages = [ pkgs.i3status-rust ]; |
||||
|
||||
xdg.configFile."i3status-rust/status.toml" = { |
||||
text = concatStringsSep "\n" |
||||
([ (formatSetting "icons" cfg.icons.name cfg.icons.overrides) |
||||
(formatSetting "theme" cfg.theme.name cfg.theme.overrides) ] |
||||
++ map formatBlock cfg.blocks); |
||||
onChange = "swaymsg reload"; |
||||
}; |
||||
}; |
||||
}; |
||||
} |
@ -1,24 +0,0 @@
|
||||
{ config, lib, pkgs, ... }: |
||||
let |
||||
cfg = config.hazel.desktop.qutebrowser; |
||||
in |
||||
with lib; { |
||||
options.hazel.desktop.qutebrowser.enable = mkEnableOption "qutebrowser"; |
||||
|
||||
config = mkIf cfg.enable { |
||||
hazel.home = { |
||||
home.packages = with pkgs; [ |
||||
unstable.qutebrowser |
||||
|
||||
# bitwarden userscript |
||||
keyutils |
||||
python37Packages.tldextract |
||||
python37Packages.pyperclip |
||||
]; |
||||
home.sessionVariables = { "BROWSER" = "qutebrowser"; }; |
||||
|
||||
xdg.configFile."qutebrowser/config.py".source = |
||||
/etc/nixos/config/qutebrowser/config.py; |
||||
}; |
||||
}; |
||||
} |
@ -1,10 +0,0 @@
|
||||
{ config, lib, pkgs, ... }: |
||||
with lib; { |
||||
imports = [ |
||||
./i3status-rust.nix |
||||
./mako.nix |
||||
./rofi.nix |
||||
./waybar.nix |
||||
./wofi.nix |
||||
]; |
||||
} |
@ -1,73 +0,0 @@
|
||||
{ config, lib, pkgs, ... }: |
||||
let |
||||
cfg = config.hazel.desktop.i3status-rust; |
||||
in |
||||
with lib; { |
||||
imports = [ |
||||
/etc/nixos/modules/custom/i3status-rust.nix |
||||
]; |
||||
|
||||
options = { |
||||
hazel.desktop.i3status-rust = { |
||||
enable = mkEnableOption "i3status-rust"; |
||||
batteries = mkOption { |
||||
default = [ "BAT0" ]; |
||||
type = with types; (listOf str); |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
config = mkIf cfg.enable { |
||||
hazel.modules.i3status-rust = { |
||||
enable = true; |
||||
|
||||
icons.name = "awesome"; |
||||
theme = { |
||||
name = "solarized-dark"; |
||||