This commit is contained in:
randomuser 2024-01-18 03:54:32 -06:00
parent 22d1ba38af
commit 2a2571aae5
36 changed files with 77 additions and 76 deletions

View File

@ -10,12 +10,20 @@
../../modules/media.nix
../../modules/anki.nix
../../modules/power-control.nix
../../modules/adb.nix
];
environment.systemPackages = with pkgs; [
xscreensaver
thunderbird
];
services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="input", KERNEL=="event[0-20]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", MODE:="0666" GROUP="usr", SYMLINK+="input/touchscreen"
'';
users.users.usr.extraGroups = [ "input" ];
services.getty.autologinUser = "usr";
boot.loader = {

View File

@ -1,24 +1,50 @@
#!/bin/sh
find_card_pci() {
[ -z $pci_path ] && pci_path=$(find /sys/devices | \
grep edid | \
cut -d/ -f1-6
)
}
assert_edid() {
find_card_pci
out=$(sha256sum ${pci_path}/card0/card0-$1/edid | \
cut -d' ' -f1)
[ "$out" = "$2" ] && return 0 || return 1
}
exists() {
xrandr | grep ' connected' | grep -c "${1}"
}
if [ ! "$(hostname)" = "mainsail" ]; then
bspc monitor eDP-1 -d 1 2 3 4 5 6 7 8 9
fi
if [ "$(exists "DP-1")" -gt 1 ]; then
printf "two"
bspc monitor DP-1 -s eDP-1
xrandr --output eDP-1 --off
exit 0
fi
if [ "$(hostname)" = "mainsail" ]; then
# this is a tower, so there's only one configuration
printf "mainsail detected\n"
xrandr --output VGA-1 --left-of HDMI-1
bspc monitor VGA-1 -d 1 3 5 7 9
bspc monitor HDMI-1 -d 2 4 6 8 0
fi
case "$(hostname)" in
"mainsail")
echo "mainsail"
xrandr --output VGA-1 --left-of HDMI-1
bspc monitor VGA-1 -d 1 3 5 7 9
bspc monitor HDMI-1 -d 2 4 6 8 0
;;
"x230t")
echo "x230t"
if
assert_edid "VGA-1" "35737dc483d2c3b1b20ea2343ce13c6c42d115febdc9634f8437e1b9f7fd3f5c" &&
assert_edid "HDMI-A-1" "01887cbd23d74201e489a6334656f7db73a7b7f732a738a9f1ee2d53389f7817";
then
echo "docked"
xrandr --output LVDS-1 --primary --mode 1366x768 --pos 1194x1080 --rotate normal \
--output VGA-1 --mode 1920x1080 --pos 0x0 --rotate normal \
--output HDMI-1 --mode 1920x1080 --pos 1920x0 --rotate normal \
--output DP-1 --off \
--output HDMI-2 --off \
--output DP-2 --off
bspc monitor LVDS-1 -d 1 4 7
bspc monitor VGA-1 -d 2 5 8
bspc monitor HDMI-1 -d 3 6 9
else
bspc monitor LVDS-1 -d 1 2 3 4 5 6 7 8 9
fi
;;
esac

View File

@ -7,6 +7,8 @@ geos=$(
awk -F'[x+]' '{print $1 "x20+" $3 "+" $4}'
)
pkill statusbar
for i in $geos; do
st -c statusbar -p -g "$i" -e statusbar & disown
done

View File

@ -1,4 +0,0 @@
#!/bin/sh
st &
statusbar

View File

@ -1,32 +0,0 @@
#!/bin/sh
WALLDIR="${HOME}/.local/share/wallpapers"
BASECMD="feh --no-fehbg --bg-fill"
generate_wall () {
GENWALL=$( \
ls "$WALLDIR" | \
grep "." | \
shuf -n 1
)
GENWALL="${WALLDIR}/${GENWALL}"
}
wall () {
generate_wall
while [ "${GENWALL}" = "${1}" ]; do
generate_wall
done
}
displays () {
displays=$(xrandr | grep -c ' connected')
}
cmd=""
displays
for i in $(seq 1 "$displays"); do
wall "${tmp}"
tmp="${GENWALL}"
cmd="${cmd} ${GENWALL}"
done
eval "${BASECMD}" "${cmd}"
exit 0

View File

@ -91,12 +91,12 @@
},
"locked": {
"lastModified": 1,
"narHash": "sha256-YmGlTX2Y5d6aQzqZ1IzVp1CnbyXuHE1Fwwtf9nB40zE=",
"path": "/nix/store/arzg5zcsb349c5rz3kaflqiszdvfbqny-source/builds",
"narHash": "sha256-qcQP65622JfSlKPDPCuTCMbzCWOvKBOA3OOO426ce8I=",
"path": "/nix/store/rpjslsjwr8a8ykn3ncr91yigf9nsjcac-source/builds",
"type": "path"
},
"original": {
"path": "/nix/store/arzg5zcsb349c5rz3kaflqiszdvfbqny-source/builds",
"path": "/nix/store/rpjslsjwr8a8ykn3ncr91yigf9nsjcac-source/builds",
"type": "path"
}
}

View File

@ -1,8 +1,6 @@
#!/bin/sh
# rndusr's bspwmrc
bspc monitor -d 1 2 3 4 5 6 7 8 9
bspc rule -a st-gpg-menu state=floating
bspc rule -a statusbar border=off sticky=on state=floating manage=off
bspc rule -a tmenu-prompt border=on sticky=on state=floating
@ -11,10 +9,17 @@ bspc rule -a Zathura state=tiled
bspc rule -a generic-st-window state=floating manage=on sticky=on border=on
bspc rule -a floating-feh state=floating
set_walls() {
for i in $(xrandr | grep ' connected' | cut -d' ' -f1); do
xwallpaper --output $i --zoom ~/.local/share/pape.jpg
done
}
# post-wm boilerplate
statuswrap
wallpaper
disp
statuswrap
set_walls
pkill xscreensaver
HOME=".config/xscreensaver" xscreensaver --no-splash &
# set up the color scheme

View File

@ -13,7 +13,7 @@ super + r
# reinitialize ancillary services
super + w
disp && wallpaper && statusbar && keyboard
disp && keyboard
# control the national weather service
super + {_,shift + }n

View File

@ -2,9 +2,8 @@
{
home.file = {
".local/share/wallpapers" = {
source = ./src;
recursive = true;
".local/share/pape.jpg" = {
source = ./pape.jpg;
};
};
}

View File

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 KiB

View File

@ -1,10 +0,0 @@
{ lib, config, pkgs, home, ... }:
{
home.file = {
".local/share/wallpapers" = {
source = ./wallpapers;
recursive = true;
};
};
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 661 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 836 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 915 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

View File

@ -6,7 +6,8 @@
xcape
xscreensaver
mpv
feh
sxiv
xwallpaper
xbrightness
xdotool
];

6
modules/adb.nix Normal file
View File

@ -0,0 +1,6 @@
{ lib, config, pkgs, ...}:
{
programs.adb.enable = true;
users.users.usr.extraGroups = [ "adbusers" ];
}