Compare commits
No commits in common. "d67d89a6eff0165a2634a06e0038b066ff49520e" and "5b9d9d3e506cf89e3838fc6007ba5de991286376" have entirely different histories.
d67d89a6ef
...
5b9d9d3e50
15 changed files with 30 additions and 183 deletions
|
@ -1,8 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#/usr/bin/env bash
|
||||||
# docstring=simple mixer gui app, for the desktop
|
# docstring=simple mixer gui app, for the desktop
|
||||||
set -E -o pipefail
|
set -E -o pipefail
|
||||||
shopt -s failglob
|
|
||||||
export LC_ALL=C.UTF8
|
|
||||||
|
|
||||||
mixxc \
|
mixxc \
|
||||||
--anchor right \
|
--anchor right \
|
||||||
|
|
2
battery
2
battery
|
@ -1,7 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# docstring=just shows the current capacity
|
# docstring=just shows the current capacity
|
||||||
set -E -o pipefail
|
set -E -o pipefail
|
||||||
shopt -s failglob
|
|
||||||
export LC_ALL=C.UTF8
|
|
||||||
|
|
||||||
cat /sys/class/power_supply/BAT0/capacity
|
cat /sys/class/power_supply/BAT0/capacity
|
||||||
|
|
2
brght
2
brght
|
@ -1,8 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# docstring=simplifies the brightnessctl command
|
# docstring=simplifies the brightnessctl command
|
||||||
set -E -o pipefail
|
set -E -o pipefail
|
||||||
shopt -s failglob
|
|
||||||
export LC_ALL=C.UTF8
|
|
||||||
|
|
||||||
# when invoked without parameter will print current brightness in percent
|
# when invoked without parameter will print current brightness in percent
|
||||||
# it accepts a parameter from 0 to 100 for brightness. Please ommit the % symbol.
|
# it accepts a parameter from 0 to 100 for brightness. Please ommit the % symbol.
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# docstring=transcript of youtube videos
|
# docstring=transcript of youtube videos
|
||||||
set -E -o pipefail
|
set -E -o pipefail
|
||||||
shopt -s failglob
|
|
||||||
export LC_ALL=C.UTF8
|
|
||||||
|
|
||||||
TEMP_FOLDER='/tmp/dlp-trnsrpt'
|
TEMP_FOLDER='/tmp/dlp-trnsrpt'
|
||||||
mkdir -p "$TEMP_FOLDER"
|
mkdir -p "$TEMP_FOLDER"
|
||||||
|
|
24
hyprperf
24
hyprperf
|
@ -1,23 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env bash
|
||||||
# docstring=disable hyprland blur for performance
|
# docstring=disable hyprland blur for performance
|
||||||
import subprocess as sp
|
set -E -o pipefail
|
||||||
import json
|
|
||||||
|
|
||||||
def getoption(optionstring):
|
hyprctl keyword decoration:blur:enabled false
|
||||||
json_str = sp.run(["hyprctl", "-j", "getoption", optionstring],
|
|
||||||
capture_output=True,
|
|
||||||
text=True).stdout
|
|
||||||
|
|
||||||
return json.loads(json_str)
|
|
||||||
|
|
||||||
def set_blur(setstr):
|
|
||||||
return sp.run(["hyprctl", "keyword", "decoration:blur:enabled", setstr])
|
|
||||||
|
|
||||||
def main():
|
|
||||||
if getoption("decoration:blur:enabled")["int"] == 1:
|
|
||||||
set_blur("false")
|
|
||||||
else:
|
|
||||||
set_blur("true")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
|
|
46
list_ips
46
list_ips
|
@ -1,46 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
#docstring=dirty tool to simplify the output of ip dramaticly
|
|
||||||
import subprocess as sp
|
|
||||||
import json
|
|
||||||
|
|
||||||
CFG = {
|
|
||||||
"iface_allow_list": ["eth", "enp", "wlp", "wlan"],
|
|
||||||
"show_ip4": True,
|
|
||||||
"show_ip6": False,
|
|
||||||
}
|
|
||||||
|
|
||||||
def filter_interfaces():
|
|
||||||
output = json.loads(
|
|
||||||
sp.run(["ip", "-j", "addr", "show"],
|
|
||||||
text=True,
|
|
||||||
capture_output=True).stdout)
|
|
||||||
filtered_list=[]
|
|
||||||
for interface in output:
|
|
||||||
for allowed in CFG["iface_allow_list"]:
|
|
||||||
if allowed in interface["ifname"]:
|
|
||||||
filtered_list.append(interface)
|
|
||||||
return filtered_list
|
|
||||||
|
|
||||||
def ip_string(interface):
|
|
||||||
conn_list = ""
|
|
||||||
for conn in interface["addr_info"]:
|
|
||||||
if conn["family"] == "inet" and CFG["show_ip4"] or conn["family"] == "inet6" and CFG["show_ip6"]:
|
|
||||||
conn_list += (conn["local"] + "/" + str(conn["prefixlen"])) + ", "
|
|
||||||
return conn_list.rstrip(", ")
|
|
||||||
|
|
||||||
def pretty(interfaces):
|
|
||||||
longest_member = 0
|
|
||||||
for interface in interfaces:
|
|
||||||
if len(interface["ifname"]) > longest_member:
|
|
||||||
longest_member = len(interface["ifname"])
|
|
||||||
|
|
||||||
for interface in interfaces:
|
|
||||||
len_diff = longest_member - len(interface["ifname"])
|
|
||||||
print(interface["ifname"], ": ", " " * len_diff, ip_string(interface), sep="")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
pretty(filter_interfaces())
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
45
mserve
45
mserve
|
@ -1,40 +1,15 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env bash
|
||||||
# docstring=serve files with http.
|
# docstring=serve files with http.
|
||||||
|
set -E -o pipefail
|
||||||
|
|
||||||
import subprocess as sp
|
miniserve \
|
||||||
import argparse
|
--auth=guest:Super9000! \
|
||||||
|
--color-scheme-dark=monokai \
|
||||||
|
--qrcode \
|
||||||
|
--dirs-first \
|
||||||
|
--hide-version-footer \
|
||||||
|
--show-wget-footer \
|
||||||
|
--title="Rano's quick share"
|
||||||
|
|
||||||
CFG = {
|
|
||||||
"base": [
|
|
||||||
"miniserve",
|
|
||||||
"--auth=guest:Super9000!",
|
|
||||||
"--color-scheme-dark=monokai",
|
|
||||||
"--qrcode",
|
|
||||||
"--dirs-first",
|
|
||||||
"--hide-version-footer",
|
|
||||||
"--show-wget-footer",
|
|
||||||
"--title=Rano's quick share",
|
|
||||||
],
|
|
||||||
"folder": "./"
|
|
||||||
}
|
|
||||||
|
|
||||||
def main():
|
|
||||||
ap = argparse.ArgumentParser()
|
|
||||||
ap.add_argument("-u", "--upload", help="enable upload", action="store_true")
|
|
||||||
args = ap.parse_args()
|
|
||||||
|
|
||||||
cmd = CFG["base"]
|
|
||||||
|
|
||||||
if args.upload:
|
|
||||||
cmd.extend(["--upload-files=./", "--overwrite-files"])
|
|
||||||
|
|
||||||
cmd.append(CFG["folder"])
|
|
||||||
|
|
||||||
try:
|
|
||||||
sp.run(cmd)
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
print("\ninterrupted by user")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
# implement a switch for easy --upload-files=DIR
|
# implement a switch for easy --upload-files=DIR
|
||||||
|
|
21
mytools
21
mytools
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# docstring=lists all tools and their docstrings
|
# docstring=lists all tools and their docstrings
|
||||||
import argparse
|
|
||||||
import os
|
import os
|
||||||
import os.path as path
|
import os.path as path
|
||||||
|
|
||||||
|
@ -8,8 +7,6 @@ CFG = {
|
||||||
"max_lines": 20,
|
"max_lines": 20,
|
||||||
"offset": 20
|
"offset": 20
|
||||||
}
|
}
|
||||||
SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__))
|
|
||||||
|
|
||||||
|
|
||||||
def parse_docstring(file_path, max_lines=CFG["max_lines"]):
|
def parse_docstring(file_path, max_lines=CFG["max_lines"]):
|
||||||
"""
|
"""
|
||||||
|
@ -41,14 +38,15 @@ def offset(element, offset=CFG["offset"]):
|
||||||
return " " * (offset - element_length)
|
return " " * (offset - element_length)
|
||||||
|
|
||||||
|
|
||||||
def list_tools():
|
def main():
|
||||||
"""
|
"""
|
||||||
lists all tools and their docstring from the same directory this sits in
|
lists all tools and their docstring from the same directory this sits in
|
||||||
"""
|
"""
|
||||||
list_dir = sorted(os.listdir(SCRIPT_PATH))
|
script_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
list_dir = sorted(os.listdir(script_path))
|
||||||
|
|
||||||
for element in list_dir:
|
for element in list_dir:
|
||||||
element_path = path.join(SCRIPT_PATH, element)
|
element_path = path.join(script_path, element)
|
||||||
if path.isfile(element_path):
|
if path.isfile(element_path):
|
||||||
print(element, end="")
|
print(element, end="")
|
||||||
docstring = parse_docstring(element_path)
|
docstring = parse_docstring(element_path)
|
||||||
|
@ -57,16 +55,5 @@ def list_tools():
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
ap = argparse.ArgumentParser()
|
|
||||||
ap.add_argument("-p", "--path", help="output path to tools directory", action="store_true")
|
|
||||||
args = ap.parse_args()
|
|
||||||
|
|
||||||
if args.path:
|
|
||||||
print(SCRIPT_PATH)
|
|
||||||
else:
|
|
||||||
list_tools()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# docstring=searches the nix store with find
|
# docstring=searches the nix store with find
|
||||||
set -E -o pipefail
|
set -E -o pipefail
|
||||||
shopt -s failglob
|
|
||||||
export LC_ALL=C.UTF8
|
|
||||||
|
|
||||||
find /nix/store/ -maxdepth 1 -iname '*'"$@"'*'
|
find /nix/store/ -maxdepth 1 -iname '*'"$@"'*'
|
||||||
|
|
20
nswitch
20
nswitch
|
@ -2,27 +2,21 @@
|
||||||
# from https://github.com/0atman/noboilerplate/blob/main/scripts/38-nixos.md#dont-use-nix-env
|
# from https://github.com/0atman/noboilerplate/blob/main/scripts/38-nixos.md#dont-use-nix-env
|
||||||
# docstring=quick edit (or ling xD) for nixos config
|
# docstring=quick edit (or ling xD) for nixos config
|
||||||
set -E -o pipefail
|
set -E -o pipefail
|
||||||
shopt -s failglob
|
|
||||||
export LC_ALL=C.UTF8
|
|
||||||
|
|
||||||
cd ~/Projects/NixOS/
|
cd ~/Projects/NixOS/
|
||||||
nvim
|
nvim
|
||||||
|
|
||||||
printf ">>> auto formating ..."
|
|
||||||
nix fmt . &>/dev/null
|
nix fmt . &>/dev/null
|
||||||
printf " DONE!\n"
|
git diff -U0 *.nix
|
||||||
|
|
||||||
git diff -U0 # "*.nix"
|
echo "Do you want to rebuild NixOS? [y/N]"
|
||||||
|
read -r YESNO
|
||||||
printf ">>> Do you want to rebuild NixOS? [y/N]\n"
|
|
||||||
printf "<<< " && read -r YESNO
|
|
||||||
if ! [[ "${YESNO,,}" == "y" ]]; then
|
if ! [[ "${YESNO,,}" == "y" ]]; then
|
||||||
printf ">>> Exiting ...\n"
|
echo "Exiting ..."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf ">>> Rebuilding NixOS\n"
|
echo "Rebuilding NixOS"
|
||||||
sudo nixos-rebuild switch | tee nixos-switch.log || (
|
sudo nixos-rebuild switch &>nixos-switch.log || (
|
||||||
grep --color error nixos-switch.log && false)
|
cat nixos-switch.log | grep --color error && false)
|
||||||
gen=$(nixos-rebuild list-generations | grep current)
|
gen=$(nixos-rebuild list-generations | grep current)
|
||||||
git commit -am "$gen"
|
git commit -am "$gen"
|
||||||
|
|
30
remote-audio
30
remote-audio
|
@ -1,30 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
#docstring=remote audio through roc-toolkit
|
|
||||||
#!TODO! use list_ips
|
|
||||||
#roc-recv -s rtp+rs8m://0.0.0.0:10001 -r rs8m://0.0.0.0:10002 -o alsa://default
|
|
||||||
#roc-send -s rtp+rs8m://192.168.178.40:10001 -r rs8m://192.168.178.40:10002 -i alsa://default
|
|
||||||
set -E -o pipefail
|
|
||||||
shopt -s failglob
|
|
||||||
export LC_ALL=C.UTF8
|
|
||||||
|
|
||||||
start() {
|
|
||||||
roc-recv -s rtp+rs8m://0.0.0.0:10001 -r rs8m://0.0.0.0:10002 -o alsa://default &
|
|
||||||
roc-send -s rtp+rs8m://192.168.178.40:10001 -r rs8m://192.168.178.40:10002 -i alsa://default &
|
|
||||||
}
|
|
||||||
|
|
||||||
stop() {
|
|
||||||
killall roc-send
|
|
||||||
killall roc-recv
|
|
||||||
}
|
|
||||||
|
|
||||||
stop9() {
|
|
||||||
killall -9 roc-send
|
|
||||||
killall -9 roc-recv
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ -z "$1" ]]; then
|
|
||||||
#start()
|
|
||||||
start
|
|
||||||
else
|
|
||||||
$1
|
|
||||||
fi
|
|
|
@ -1,8 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# docstring=have and create multiple rustdesk profiles
|
# docstring=have and create multiple rustdesk profiles
|
||||||
set -E -o pipefail
|
set -E -o pipefail
|
||||||
shopt -s failglob
|
|
||||||
export LC_ALL=C.UTF8
|
|
||||||
|
|
||||||
# define frist element in argument list as profile name
|
# define frist element in argument list as profile name
|
||||||
RUSTDESK_PROFILE="$1"
|
RUSTDESK_PROFILE="$1"
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# docstring=do a screenshots on wayland compositors
|
# docstring=do a screenshots on wayland compositors
|
||||||
set -E -o pipefail
|
set -E -o pipefail
|
||||||
shopt -s failglob
|
|
||||||
export LC_ALL=C.UTF8
|
|
||||||
|
|
||||||
grim -g "$(slurp -o -r -c '#ff0000ff')" - | satty --filename - --fullscreen --output-filename ~/Media/Pictures/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png
|
grim -g "$(slurp -o -r -c '#ff0000ff')" - | satty --filename - --fullscreen --output-filename ~/Media/Pictures/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png
|
||||||
|
|
7
scrnl
7
scrnl
|
@ -4,7 +4,8 @@
|
||||||
from os import environ
|
from os import environ
|
||||||
import os.path as path
|
import os.path as path
|
||||||
import subprocess as sp
|
import subprocess as sp
|
||||||
import sys
|
from sys import exit as sysexit
|
||||||
|
from sys import argv as sysargv
|
||||||
|
|
||||||
SCRIPT_FILENAME = path.basename(__file__)
|
SCRIPT_FILENAME = path.basename(__file__)
|
||||||
HOME = environ["HOME"]
|
HOME = environ["HOME"]
|
||||||
|
@ -26,7 +27,7 @@ def kctl(*args):
|
||||||
print(f"Wrapped options form {SCRIPT_FILENAME}:")
|
print(f"Wrapped options form {SCRIPT_FILENAME}:")
|
||||||
print(" list list all available profiles")
|
print(" list list all available profiles")
|
||||||
|
|
||||||
sys.exit(completed.returncode)
|
sysexit(completed.returncode)
|
||||||
|
|
||||||
|
|
||||||
def list_profiles(config_path=CFG["config_path"]):
|
def list_profiles(config_path=CFG["config_path"]):
|
||||||
|
@ -38,7 +39,7 @@ def list_profiles(config_path=CFG["config_path"]):
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
arguments = sys.argv[1:]
|
arguments = sysargv[1:]
|
||||||
match arguments[0]:
|
match arguments[0]:
|
||||||
case "list":
|
case "list":
|
||||||
list_profiles()
|
list_profiles()
|
||||||
|
|
2
webcam
2
webcam
|
@ -1,8 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# docstring=open the webcam or v4l2 /dev/video* device
|
# docstring=open the webcam or v4l2 /dev/video* device
|
||||||
set -E -o pipefail
|
set -E -o pipefail
|
||||||
shopt -s failglob
|
|
||||||
export LC_ALL=C.UTF8
|
|
||||||
|
|
||||||
if [[ "-h" == "$1" ]]; then
|
if [[ "-h" == "$1" ]]; then
|
||||||
echo "-l list devices"
|
echo "-l list devices"
|
||||||
|
|
Loading…
Add table
Reference in a new issue