some changes (sort out later)

This commit is contained in:
stupidcomputer 2024-12-04 13:37:07 -06:00
parent ed32d2548b
commit 899f42fb88
11 changed files with 137 additions and 8 deletions

View File

@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
}; };
buildPhase = '' buildPhase = ''
make jsfw VERBOSE=1 make jsfw
''; '';
installPhase = '' installPhase = ''

BIN
lappy/background.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 KiB

View File

@ -3,6 +3,7 @@
, pkgs , pkgs
# shell scripts stuff # shell scripts stuff
, makeWrapper , makeWrapper
, kbd # for chvt
, xclip , xclip
, rbw , rbw
}: }:
@ -14,14 +15,14 @@ stdenv.mkDerivation rec {
src = ./utils; src = ./utils;
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
buildInputs = [ xclip rbw ]; buildInputs = [ xclip kbd rbw ];
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
for i in $(ls $src/); do for i in $(ls $src/); do
cp $src/$i $out/bin cp $src/$i $out/bin
wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ xclip rbw ]} wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ xclip kbd rbw ]}
done done
''; '';
} }

7
lappy/builds/utils/blackhole Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
sudo echo ""
chvt 6
sleep 2
sudo stty -echo -F /dev/tty6
sudo /run/current-system/sw/bin/jsfw server 24800 /home/usr/dots/lappy/jsfw.json >/dev/null

43
lappy/builds/utils/khalmacs Executable file
View File

@ -0,0 +1,43 @@
#!/bin/sh
print_help() {
echo "
this is khalmacs.
builtin-options:
- regular
- late
"
}
case $1 in
"regular")
khal new -g school -a home $2 07:40 08:27 AP Computer Science
khal new -g school -a home $2 08:34 09:19 Chemistry I H
khal new -g school -a home $2 09:29 10:14 AP Precalculus
khal new -g school -a home $2 10:21 11:06 AP European History
khal new -g school -a home $2 11:06 11:08 Flex Check time
khal new -g school -a home $2 11:15 12:05 Wind Ensemble H
khal new -g school -a home $2 12:12 12:37 SAIL
khal new -g school -a home $2 12:37 13:02 Lunch
khal new -g school -a home $2 13:09 13:54 English II H
khal new -g school -a home $2 14:01 14:47 Spanish III H
;;
"late")
khal new -g school -a home $2 08:25 09:08 AP Computer Science
khal new -g school -a home $2 09:15 09:56 Chemistry I H
khal new -g school -a home $2 10:06 10:47 AP Precalculus
khal new -g school -a home $2 10:54 11:33 AP European History
khal new -g school -a home $2 11:33 11:35 Flex Check time
khal new -g school -a home $2 11:41 12:22 Wind Ensemble H
khal new -g school -a home $2 12:29 13:10 Lunch
khal new -g school -a home $2 13:17 13:58 English II H
khal new -g school -a home $2 14:05 14:47 Spanish III H
;;
*)
print_help
;;
"help")
print_help
;;
esac

View File

@ -8,13 +8,61 @@ else
enable -f /lib/bash/sleep sleep enable -f /lib/bash/sleep sleep
fi fi
schedule_needs_update="yes"
get_schedule_info () {
if [ "$schedule_needs_update" = "yes" ]; then
output=$(
khal at now --format '{title}|{end-time}|{categories}' | \
awk -F'|' '{if($3 == "school") { print $1 "|" $2 }}'
)
if [ -z "$output" ]; then
schedule_needs_update="no"
schedule_status=""
return
fi
class_name=${output%%|*}
schedule_time=${output##*|}
schedule_time_hours=${schedule_time%%:*}
schedule_time_minutes=${schedule_time##*:}
schedule_time_unix=$(date --date "$schedule_time" "+%s")
schedule_needs_update="no"
fi
printf -v current_time '%(%s)T' -1
difference=$(($schedule_time_unix - $current_time))
if [ "$difference" -lt 0 ]; then
schedule_needs_update="yes"
get_schedule_info
fi
until_end=$(($difference / 60))
if [ "$until_end" -le 5 ]; then
until_end_seconds=$(($difference % 60))
schedule_status=$(printf "%02d:%02d left in %s/" "$until_end" "$until_end_seconds" "$class_name")
else
schedule_status=$(printf "%d minutes left in %s/" "$until_end" "$class_name")
fi
}
get_cmus_info () { get_cmus_info () {
if [ /dev/shm/status/cmus -nt /dev/shm/status/modified ]; then if [ /dev/shm/status/cmus -nt /dev/shm/status/modified ]; then
cmus_status=$(</dev/shm/status/cmus) cmus_status="$(</dev/shm/status/cmus)/"
touch /dev/shm/status/modified touch /dev/shm/status/modified
fi fi
} }
get_battery_info () {
battery_status=$(</sys/class/power_supply/BAT0/capacity)
}
get_time_info () {
printf -v date_status '%(%d(%a)-%m(%b)-%y)T %(%H)T:%(%M)T:%(%S)T/' -1
}
while true; do while true; do
# use /dev/shm to minimize the amount of i/o on disk # use /dev/shm to minimize the amount of i/o on disk
if [ ! -d /dev/shm/status ]; then if [ ! -d /dev/shm/status ]; then
@ -22,10 +70,11 @@ while true; do
touch /dev/shm/status/modified touch /dev/shm/status/modified
fi fi
battery=$(</sys/class/power_supply/BAT0/capacity) get_time_info
printf -v date '%(%H)T:%(%M)T' -1 get_battery_info
get_cmus_info get_cmus_info
get_schedule_info
printf "%s/%s/%s\n" "$cmus_status" "$date" "$battery" printf "%s%s%s%s\n" "$schedule_status" "$cmus_status" "$date_status" "$battery_status"
sleep 1 sleep 1
done | dwm-setstatus done | dwm-setstatus

View File

@ -57,6 +57,9 @@
mkdir -p /home/usr/.config/sx mkdir -p /home/usr/.config/sx
${pkgs.coreutils}/bin/ln -sf /home/usr/dots/lappy/config/sx/sxrc /home/usr/.config/sx/sxrc ${pkgs.coreutils}/bin/ln -sf /home/usr/dots/lappy/config/sx/sxrc /home/usr/.config/sx/sxrc
mkdir -p /home/usr/.config/todoman
${pkgs.coreutils}/bin/ln -sf /home/usr/dots/lappy/config/todoman/config.py /home/usr/.config/todoman/config.py
mkdir -p /home/usr/.config/vdirsyncer mkdir -p /home/usr/.config/vdirsyncer
${pkgs.coreutils}/bin/ln -sf /home/usr/dots/lappy/config/vdirsyncer/config /home/usr/.config/vdirsyncer/config ${pkgs.coreutils}/bin/ln -sf /home/usr/dots/lappy/config/vdirsyncer/config /home/usr/.config/vdirsyncer/config
''; '';

View File

View File

@ -0,0 +1,5 @@
path = "~/pim/calendar/personal/*"
date_format = "%m-%d-%Y"
time_format = "%H:%M"
default_due = 0
default_list = "edfbeaf1-e9f3-4d94-a512-40cdafdbc7a0"

View File

@ -70,6 +70,7 @@
neomutt neomutt
isync isync
msmtp msmtp
todoman
# utilities # utilities
htop htop
@ -92,6 +93,11 @@
powerManagement.powertop.enable = true; powerManagement.powertop.enable = true;
systemd.services."getty@tty6" = {
overrideStrategy = "asDropin";
serviceConfig.ExecStart = ["" "@${pkgs.coreutils}/bin/cat"];
};
# make sshd a `systemctl start sshd` command away # make sshd a `systemctl start sshd` command away
services.openssh.enable = true; services.openssh.enable = true;
systemd.services.sshd.wantedBy = lib.mkForce []; systemd.services.sshd.wantedBy = lib.mkForce [];

View File

@ -3,7 +3,22 @@
{ {
"tag": "keyboard", "tag": "keyboard",
"filter": { "filter": {
"name": "AT Translated Set 2 Keyboard" "vendor": "0001",
"product": "0001"
}
},
{
"tag": "mouse",
"filter": {
"vendor": "0002",
"product": "000e",
"name": "ETPS/2 Elantech Touchpad"
}
},
{
"tag": "mousebuttons",
"filter": {
"name": "ETPS/2 Elantech TrackPoint"
} }
} }
] ]