add typstwatch script and remove some old ones

This commit is contained in:
LordMZTE 2024-10-06 12:47:15 +02:00
parent 4aed1fc63b
commit 5d3348f615
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
4 changed files with 8 additions and 41 deletions

View file

@ -1,29 +0,0 @@
#!/usr/bin/env racket
#lang racket
(current-print void)
(define noint (make-parameter #f))
(command-line #:program "sysupdate"
#:usage-help "Update the system"
#:once-each [("-n" "--noint") "Don't require user interaction" (noint #t)])
(define failures '())
(define (cmd exe . args)
(match* ((find-executable-path exe) (cons exe args))
[(#f argv) (printf "skipping command ~a, command not found\n" argv)]
[(exepath argv)
(printf ">>> ~a\n" argv)
(unless (apply system* exepath args)
(set! failures (cons argv failures)))]))
(cmd "zupper" "update")
(cmd "rustup" "update")
(apply cmd (if (noint)
'("paru" "-Syu" "--noconfirm")
'("paru" "-Syu")))
(cmd "tldr" "--update")
(unless (empty? failures)
(raise-user-error "The following commands failed:" failures))

7
scripts/typstwatch.sh Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
tmpf=$(mktemp --suffix=.pdf)
trap 'kill $(jobs -p); rm "$tmpf"' EXIT
typst watch "$1" "$tmpf" "${@:2}" &
zathura "$tmpf"

View file

@ -1,10 +0,0 @@
#!/bin/sh
set -ex
# This is a small wrapper script that uses reflector to update the pacman mirrors
# using the fastest servers of a given country.
reflector \
--country "$1" \
--fastest 10 \
--save /etc/pacman.d/mirrorlist

View file

@ -11,8 +11,7 @@
;; Symlink interpreted scripts
(install-link "scripts/brightness.rkt" (bin-path "brightness"))
(install-link "scripts/map-touch-display.rkt" (bin-path "map-touch-display"))
(install-link "scripts/sysupdate.rkt" (bin-path "sysupdate"))
(install-link "scripts/use-country-mirrors.sh" (bin-path "use-country-mirrors"))
(install-link "scripts/typstwatch.sh" (bin-path "typstwatch"))
(install-link "scripts/videos-duration.sh" (bin-path "videos-duration"))
;; Compiled scripts