From 45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Fri, 20 Sep 2024 14:16:56 +0200 Subject: Change dotfiles structure, and add guix-channels declaration. --- .bin/arduino-cli | 14 --- .bin/chiaki | 21 ----- .bin/clean.sh | 3 - .bin/download_music.sh | 26 ------ .bin/esp_upload.sh | 6 -- .bin/file_upload.sh | 38 -------- .bin/home-reconfigure | 3 - .bin/jd-arduino-cli.Dockerfile | 16 ---- .bin/oath | 14 --- .bin/profile-add-all | 9 -- .bin/stumpish | 196 ----------------------------------------- .bin/system-reconfigure | 3 - .bin/update.sh | 4 - .bin/whois-at-hsp | 84 ------------------ 14 files changed, 437 deletions(-) delete mode 100755 .bin/arduino-cli delete mode 100755 .bin/chiaki delete mode 100755 .bin/clean.sh delete mode 100755 .bin/download_music.sh delete mode 100755 .bin/esp_upload.sh delete mode 100755 .bin/file_upload.sh delete mode 100755 .bin/home-reconfigure delete mode 100644 .bin/jd-arduino-cli.Dockerfile delete mode 100755 .bin/oath delete mode 100755 .bin/profile-add-all delete mode 100755 .bin/stumpish delete mode 100755 .bin/system-reconfigure delete mode 100755 .bin/update.sh delete mode 100755 .bin/whois-at-hsp (limited to '.bin') diff --git a/.bin/arduino-cli b/.bin/arduino-cli deleted file mode 100755 index 7c0d41a..0000000 --- a/.bin/arduino-cli +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -if [[ $(docker images | grep jd-arduino-cli | wc -l) -eq 0 ]] -then - docker build -f "$SCRIPT_DIR/jd-arduino-cli.Dockerfile" -t jd-arduino-cli . -fi - -docker run --rm --network none -it --privileged \ - -v $(pwd):/src \ - -v jd-arduino-cli-tmp:/tmp \ - -v /dev:/dev jd-arduino-cli \ - arduino-cli $@ diff --git a/.bin/chiaki b/.bin/chiaki deleted file mode 100755 index 5fa6547..0000000 --- a/.bin/chiaki +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -CHIAKI_SHELL=/tmp/.chiaki.nix - -cat < $CHIAKI_SHELL -let - nixgl = import (fetchTarball https://github.com/guibou/nixGL/archive/main.tar.gz) { }; -in -{ nixpkgs ? import {} }: -with nixpkgs; mkShell { - buildInputs = [ - chiaki - nixgl.auto.nixGLDefault - ]; - shellHook = '' - nixGL chiaki && exit; - ''; -} -EOF - -nix-shell $CHIAKI_SHELL diff --git a/.bin/clean.sh b/.bin/clean.sh deleted file mode 100755 index 3e6bbfd..0000000 --- a/.bin/clean.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -sudo emerge --ask --depclean; diff --git a/.bin/download_music.sh b/.bin/download_music.sh deleted file mode 100755 index e3a3601..0000000 --- a/.bin/download_music.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -BOLD="\e[1"; -ENDCOLOR="\e[0m"; -Green="32"; -LightRed="31"; - -if ! [ $1 ]; then - echo "" - echo -e $BOLD";"";"$LightRed"m Please provide music url!"$ENDCOLOR - echo "" - exit -fi - -MUSIC_DIR="~/Documents/Music/%(artist)s/%(album)s/%(title)s-%(id)s.%(ext)s" -if [ $2 ]; then - MUSIC_DIR="${a}/%(artist)s/%(album)s/%(title)s-%(id)s.%(ext)s" -fi - -echo "" -echo -e $BOLD";"";"$Green"m Music will download to ${MUSIC_DIR} directory!"$ENDCOLOR -echo "" - -sleep 1 - -yt-dlp -x --audio-format mp3 --embed-metadata -o $MUSIC_DIR $1 diff --git a/.bin/esp_upload.sh b/.bin/esp_upload.sh deleted file mode 100755 index 27d8d41..0000000 --- a/.bin/esp_upload.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# rm /tmp/arduino-sketch-*/ -r -~/.local/bin/arduino-cli cache clean -~/.local/bin/arduino-cli compile --fqbn esp8266:esp8266:nodemcuv2 -~/.local/bin/arduino-cli upload -p /dev/ttyUSB0 --fqbn esp8266:esp8266:nodemcuv2 diff --git a/.bin/file_upload.sh b/.bin/file_upload.sh deleted file mode 100755 index 0ff6c57..0000000 --- a/.bin/file_upload.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -BOLD="\e[1"; -ENDCOLOR="\e[0m"; -Green="32m"; -LightRed="31m"; - -echo "" -echo -e $BOLD";"";"$Green" FILE UPLOADER"$ENDCOLOR -echo "" - -if ! [ $1 ]; then - echo "" - echo -e $BOLD";"";"$LightRed" Please provide file path!"$ENDCOLOR - echo "" - exit -fi - -if [ $1 ]; then - echo -e " Are u sure u want upload this file: "$BOLD";"";"$Green" '$1'"$ENDCOLOR"? [y/N]: " - read -p " " input - echo "" - # read -r -p " " input - case $input in - [yY][eE][sS]|[yY]) - URL=$(curl -s -F "file=@$1" https://0x0.st); - echo -e " URL: "$BOLD";"";"$Green"$URL"$ENDCOLOR; - ;; - [nN][oO]|[nN]) - echo -e $BOLD";"";"$Green" OK"$ENDCOLOR; - ;; - *) - echo -e $BOLD";"";"$LightRed" Invalid input..."$ENDCOLOR; - exit 1 - ;; - esac - echo "" -fi; diff --git a/.bin/home-reconfigure b/.bin/home-reconfigure deleted file mode 100755 index f3a4e5f..0000000 --- a/.bin/home-reconfigure +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -JD_HOME=1 guix home -L $HOME/dotfiles/guix reconfigure $HOME/dotfiles/guix/jd/desktops/$(hostname).scm diff --git a/.bin/jd-arduino-cli.Dockerfile b/.bin/jd-arduino-cli.Dockerfile deleted file mode 100644 index cb8eb91..0000000 --- a/.bin/jd-arduino-cli.Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM python:3.12-rc-slim - -RUN apt update && apt install -y wget && \ - wget https://downloads.arduino.cc/arduino-cli/nightly/arduino-cli_nightly-latest_Linux_64bit.tar.gz && \ - tar -C /usr/bin/ -xf arduino-cli_nightly-latest_Linux_64bit.tar.gz - -RUN mkdir ~/.arduino15 && \ - echo "board_manager:" > ~/.arduino15/arduino-cli.yaml && \ - echo " additional_urls:" >> ~/.arduino15/arduino-cli.yaml && \ - echo " - http://arduino.esp8266.com/stable/package_esp8266com_index.json" >> ~/.arduino15/arduino-cli.yaml - - -RUN arduino-cli core update-index && \ - arduino-cli core install esp8266:esp8266 - -WORKDIR /src \ No newline at end of file diff --git a/.bin/oath b/.bin/oath deleted file mode 100755 index 7444993..0000000 --- a/.bin/oath +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -if [[ $1 ]]; then - PASS=$(oathtool -b --totp $(pass show "oath/$1")) - printf $PASS | wl-copy - echo "pass: $PASS" - echo "Password should be in your clipboard!" -else - echo "Usage: oath " - echo "Available pass:" - pass oath -fi - - diff --git a/.bin/profile-add-all b/.bin/profile-add-all deleted file mode 100755 index bca4178..0000000 --- a/.bin/profile-add-all +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles -for i in $HOME/.config/guix/manifests/*; do - echo $i - MANIFEST_NAME=$(basename $i .scm) - mkdir -p "$GUIX_EXTRA_PROFILES"/"$MANIFEST_NAME" - guix package --manifest=$i --profile="$GUIX_EXTRA_PROFILES/$MANIFEST_NAME/$MANIFEST_NAME" -done diff --git a/.bin/stumpish b/.bin/stumpish deleted file mode 100755 index 9e95c0c..0000000 --- a/.bin/stumpish +++ /dev/null @@ -1,196 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2007 Jonathan Moore Liles -# -# Maintainer: Jonathan Moore Liles -# -# stumpish 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 2, or (at your option) -# any later version. -# -# stumpish 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 software; see the file COPYING. If not, see -# . - -### STUMPwm Interactive SHell. - -DELAY=0.01 - -if ! sleep $DELAY 2>/dev/null >&2 -then - DELAY=1 -fi - -# replace -E with -r option for old versions of GNU sed -if ! sed -E 1p /dev/null 2>/dev/null; then - sed() { shift; command sed -r "$@"; } -fi - -# parse C-style backslash sequences by default -if [ "$(echo -e foo)" = foo ]; then - echo() { builtin echo -e "$@"; } -fi - -wait_result () -{ - while true - do - RESULT=$(xprop -root -f STUMPWM_COMMAND_RESULT 8s \ - STUMPWM_COMMAND_RESULT 2>/dev/null | - sed -E 's/\\([[:digit:]]+)/\\0\1/g') - if echo "$RESULT" | grep -v -q 'not found.$' - then - break - fi - - sleep $DELAY - done - - xprop -root -remove STUMPWM_COMMAND_RESULT - - if echo "$RESULT" | grep -q '= $' - then - return 0 - fi - - echo "$RESULT" | - sed -E 's/[^"\\n]+"// - /^"[[:space:]]*$/d - s/(^|[^\\])\\n/\1\ -/g - s/\\(["\\n])/\1/g - s/\^([*[:digit:]]+|[Bbn])//g' -} - -send_cmd () -{ - local cmd="$1" - - if [ "$cmd" = "stumpwm-quit" ] - then - cmd=quit - elif [ "$cmd" = "quit" ] - then - exit - fi - - xprop -root -f STUMPWM_COMMAND 8s -set STUMPWM_COMMAND "$cmd" - - wait_result -} - -usage () -{ - cat <&2 -} - -tput () -{ - local cap1=$1 cap2=$2 - shift 2 - - command tput $cap1 $@ 2>/dev/null || - command tput $cap2 $@ 2>/dev/null -} - -READLINE=yes - -if [ "x$1" = "x-r" ] -then - READLINE=no - shift 1 -fi - -if [ $# -gt 0 ] -then - [ "$1" = "--help" ] && usage - if [ "$1" = "-e" ] - then - if [ $# -ne 2 ] - then - echo "'-e' requires exactly one argument!" - exit - fi - shift 1 - IFS='' - ARGS=$(cat /dev/stdin) - send_cmd "$1 $ARGS" - else - IFS=' ' - send_cmd "$*" - fi -else - if [ -t 0 ] - then - if ! type rlwrap 2>/dev/null >&2 - then - warn rlwrap not found, command completion won\'t work - elif [ $READLINE = yes ] - then - COMMANDS="${TMPDIR:-/tmp}/stumpish.commands.$$" - echo $(send_cmd "commands") | - sed -E 's/[[:space:]]+/\ -/g' | - sort > "$COMMANDS" - trap 'rm -f "$COMMANDS"' exit int term - rlwrap -b '' -f "$COMMANDS" "$0" -r - exit - fi - - tput AF setaf 5 - echo Welcome to the STUMPwm Interactive SHell. - tput me sgr0 - echo 'Type \c' - tput AF setaf 2 - echo 'commands\c' - tput me sgr0 - echo \ for a list of commands. - - while read -p '> ' REPLY - do - tput md bold - tput AF setaf 2 - send_cmd "$REPLY" - tput me sgr0 - done - else - while read REPLY - do - send_cmd "$REPLY" - done - fi -fi diff --git a/.bin/system-reconfigure b/.bin/system-reconfigure deleted file mode 100755 index c4c1a05..0000000 --- a/.bin/system-reconfigure +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -sudo -E guix system -L $HOME/dotfiles/guix reconfigure $HOME/dotfiles/guix/jd/desktops/$(hostname).scm \ No newline at end of file diff --git a/.bin/update.sh b/.bin/update.sh deleted file mode 100755 index e6f9f8d..0000000 --- a/.bin/update.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -sudo emerge --sync -sudo emerge --ask --verbose --update --newuse --deep @world; diff --git a/.bin/whois-at-hsp b/.bin/whois-at-hsp deleted file mode 100755 index 0cd03f7..0000000 --- a/.bin/whois-at-hsp +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env -S guix shell guile guile-json -- guile --no-auto-compile -e main -s --*- scheme -*- -!# - -(use-modules (srfi srfi-1) - (ice-9 iconv) - (ice-9 receive) - (web client) - (json)) - -(define whois-at-hsp-endpoint "https://whois.at.hsp.sh/api/now") - -(define (http-get-serialize-json url) - (receive (response data) (http-request url) - (values (json-string->scm (bytevector->string data "UTF-8")) - response))) - -(define (whois-data->users whois-data) - (assoc-ref whois-data "users")) - -(define (whois-data->unknown-devices whois-data) - (assoc-ref whois-data "unknown_devices")) - -(define (whois-data->head-count whois-data) - (assoc-ref whois-data "headcount")) - -(define (whois-data->formated-users whois-data) - (let ((users (vector->list (whois-data->users whois-data)))) - (if (> (length users) 0) - (fold-right - (lambda (a b) (string-append a " " b)) - "" - users) - "No visible users!"))) - -(define (whois-data->summary whois-data) - (string-append - "Unknown devices: " - (number->string (whois-data->unknown-devices whois-data)) - "\nUsers: [" (number->string (whois-data->head-count whois-data)) "] " - (whois-data->formated-users whois-data))) - -(define (notify data) - (system* "notify-send" - "WHOIS AT HSP" - (whois-data->summary data))) - -(define (command-line-option? option args) - (> (length (or (member option args) - '())) - 0)) - -(define-syntax-rule (command-line-args-handle args default ((option ...) body ...) ...) - (let ((option? (lambda (o) (command-line-option? o args))) - (something-executed? #f)) - (when (or (option? option) ...) - (set! something-executed? #t) - body ...) ... - (when (not something-executed?) - default))) - -(define (main args) - (let ((whois-data (http-get-serialize-json whois-at-hsp-endpoint))) - (command-line-args-handle args - (begin (display (whois-data->summary whois-data)) - (newline)) - (("-h" "--help") - (display (string-append "-h, --help Help message\n" - "-n, --notify Notification massage with whois information.\n" - "-u Get users\n" - "-H Get head count\n" - "-U Get unknown devices\n"))) - (("-n" "--notify") - (notify whois-data)) - (("-u") - (display (whois-data->formated-users whois-data)) - (newline)) - (("-H") - (display (whois-data->head-count whois-data)) - (newline)) - (("-U") - (display (whois-data->unknown-devices whois-data)) - (newline))))) - -- cgit v1.2.3