X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=bookworm%2Fsetup_scripts%2Fsetup_desktop.sh;h=637dfc242717cb9c8c2cec741504b575a3412258;hb=f628496cf28b4db65ee965218e62989d51dd7aed;hp=c306dbeedc34a66405d1f9d1c89257b801f36bde;hpb=f741879b9686ecd1d9286ff88cadde40339c4d9a;p=config diff --git a/bookworm/setup_scripts/setup_desktop.sh b/bookworm/setup_scripts/setup_desktop.sh index c306dbe..637dfc2 100755 --- a/bookworm/setup_scripts/setup_desktop.sh +++ b/bookworm/setup_scripts/setup_desktop.sh @@ -1,32 +1,26 @@ #!/bin/sh set -e -set -x -debian_version="bookworm" -legal_system_names="x220 w530" +. ./misc.sh -if [ "$#" -ne 1 ]; then - echo 'Need exactly one argument (system name).' - false -fi -found=0 -for system_name_i in $legal_system_names; do - if [ "$1" = "$system_name_i" ]; then - found=1 - system_name="${system_name_i}" - continue - fi -done -if [ "$found" = 0 ]; then - echo "Need legal system name." - false -fi +expect_n_args 1 "(system name)" "$@" +get_system_name_arg "$1" # Set up system without user environment. -config_tree_prefix="${HOME}/config/${debian_version}" -setup_scripts_dir="${config_tree_prefix}/setup_scripts" cd "${setup_scripts_dir}" -./setup.sh "${system_name}" "" user desktop thinkpad "${system_name}" +./_setup.sh "${system_name}" "" user desktop thinkpad "${system_name}" + +# Set up printer. +ppd_deb="hll2350dwpdrv-4.0.0-1.i386.deb" +wget "https://download.brother.com/welcome/dlf103566/${ppd_deb}" +dpkg --add-architecture i386 +apt update +apt install -y "./${ppd_deb}" +service cups restart +# lpadmin -p 'Brother_HLL2350DW' -m 'brother-HLL2350DW-cups-en.ppd' +rm "./${ppd_deb}" +# TODO explore potential lpadmin options like -o 'OutputMode=NormalGray' +# Set up NVIDIA eGPU config. if [ "$system_name" = "w530" ]; then cd git clone https://github.com/NVIDIA/open-gpu-kernel-modules @@ -38,8 +32,10 @@ if [ "$system_name" = "w530" ]; then driver_version=535.86.05 runscript=NVIDIA-Linux-x86_64-${driver_version}.run wget https://us.download.nvidia.com/XFree86/Linux-x86_64/${driver_version}/${runscript} + rmmod nouveau chmod u+x ${runscript} - ./${runscript} --no-kernel-modules + ./${runscript} --no-kernel-modules --silent + depmod fi # Set up user environments. @@ -48,5 +44,5 @@ cd "${setup_scripts_dir}" adduser --disabled-password --gecos "" plom usermod -a -G sudo plom passwd plom -cp setup_home.sh /home/plom -chown plom:plom /home/plom/setup_home.sh +cp -a ~/config /home/plom +chown -R plom:plom /home/plom/config