From fa7a8015feb5ff3e4d158e2d7f1b82fe94091555 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Wed, 15 Mar 2023 11:35:51 +0530 Subject: .local: adding some envscripts+udev rules for brillo --- .local/bin/curlthing | 3 +++ .local/bin/starttorr | 4 ++++ .local/bin/vimv | 44 +++++++++++++++++++++++++++++++++++++ etc/fstab | 18 +++++++++++++++ etc/udev/rules.d/90-backlight.rules | 3 +++ 5 files changed, 72 insertions(+) create mode 100755 .local/bin/curlthing create mode 100755 .local/bin/starttorr create mode 100755 .local/bin/vimv create mode 100644 etc/fstab create mode 100644 etc/udev/rules.d/90-backlight.rules diff --git a/.local/bin/curlthing b/.local/bin/curlthing new file mode 100755 index 0000000..73bb10b --- /dev/null +++ b/.local/bin/curlthing @@ -0,0 +1,3 @@ +#!/bin/sh + +curl -L https://git.io/$1 && echo diff --git a/.local/bin/starttorr b/.local/bin/starttorr new file mode 100755 index 0000000..e354edd --- /dev/null +++ b/.local/bin/starttorr @@ -0,0 +1,4 @@ +#!/bin/sh + +sudo -A systemctl start jackett +sudo -A systemctl start flaresolverr diff --git a/.local/bin/vimv b/.local/bin/vimv new file mode 100755 index 0000000..74844fc --- /dev/null +++ b/.local/bin/vimv @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +set -eu + +# Lists the current directory's files in Vim, so you can edit it and save to rename them +# USAGE: vimv [file1 file2] +# https://github.com/thameera/vimv + +declare -r FILENAMES_FILE=$(mktemp "${TMPDIR:-/tmp}/vimv.XXX") + +trap '{ rm -f "${FILENAMES_FILE}" ; }' EXIT + +if [ $# -ne 0 ]; then + src=( "$@" ) +else + IFS=$'\r\n' GLOBIGNORE='*' command eval 'src=($(ls))' +fi + +for ((i=0;i<${#src[@]};++i)); do + echo "${src[i]}" >> "${FILENAMES_FILE}" +done + +${EDITOR:-vi} "${FILENAMES_FILE}" + +IFS=$'\r\n' GLOBIGNORE='*' command eval 'dest=($(cat "${FILENAMES_FILE}"))' + +if (( ${#src[@]} != ${#dest[@]} )); then + echo "WARN: Number of files changed. Did you delete a line by accident? Aborting.." >&2 + exit 1 +fi + +declare -i count=0 +for ((i=0;i<${#src[@]};++i)); do + if [ "${src[i]}" != "${dest[i]}" ]; then + mkdir -p "$(dirname "${dest[i]}")" + if git ls-files --error-unmatch "${src[i]}" > /dev/null 2>&1; then + git mv "${src[i]}" "${dest[i]}" + else + mv "${src[i]}" "${dest[i]}" + fi + ((++count)) + fi +done + +echo "$count" files renamed. diff --git a/etc/fstab b/etc/fstab new file mode 100644 index 0000000..a46e7b9 --- /dev/null +++ b/etc/fstab @@ -0,0 +1,18 @@ +# Static information about the filesystems. +# See fstab(5) for details. + +# +# /dev/nvme0n1p3 +UUID=41e95346-68c7-4331-b4a1-bad1b5c11f50 / ext4 rw,relatime 0 1 + +# /dev/nvme0n1p1 +UUID=6196-DABA /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2 + +# /dev/nvme0n1p4 +UUID=0e676682-5f38-4244-b2be-4e0a3dd13d24 /home ext4 rw,relatime 0 2 + +# /dev/nvme0n1p2 +UUID=e4c839af-2ad3-4ca6-8858-811dca6f1361 none swap defaults 0 0 + +#hdd +UUID=7fa64ba5-33a0-4e65-842d-8c05451c2634 /mnt/hdd ext4 defaults 0 0 diff --git a/etc/udev/rules.d/90-backlight.rules b/etc/udev/rules.d/90-backlight.rules new file mode 100644 index 0000000..231c2a4 --- /dev/null +++ b/etc/udev/rules.d/90-backlight.rules @@ -0,0 +1,3 @@ +SUBSYSTEM=="backlight", ACTION=="add", +RUN+="/bin/chgrp video /sys/class/backlight/intel_backlight/brightness", +RUN+="/bin/chmod o+w /sys/class/backlight/intel_backlight/brightness" -- cgit v1.2.3