7 Commits

14 changed files with 33 additions and 19 deletions

0
cptemplate.sh Normal file → Executable file
View File

0
ddusb.py Normal file → Executable file
View File

5
drivetemp.py Normal file → Executable file
View File

@ -54,10 +54,7 @@ def convert_to_celsius(mkel_temp):
# ========== Main Script ==========
parser = argparse.ArgumentParser()
parser.add_argument(
"device",
help="device node to retrieve\
the temperature for",
metavar="dev",
"device", help="device node to retrieve the temperature for", metavar="dev"
)
args = parser.parse_args()

25
fedit.py Normal file → Executable file
View File

@ -13,6 +13,8 @@ import os
import shutil
import subprocess
from sys import platform
# ========== Constants ==========
# ----- Paths -----
BOOT_DIR = "/boot"
@ -24,16 +26,27 @@ E_NOEDITORFOUND = 2
E_NOFILESELECTED = 3
# ----- Commands -----
FIND_CMD = "/usr/bin/fd"
# Options: show hidden files, null terminator, files only
# Optional arguments: show vcs files, show every file
FIND_CMD = shutil.which("fd")
FIND_OPTS = ["--hidden", "--print0", "--type", "f"]
EXTRA_FIND_OPTS = {"no_ignore_vcs": "--no-ignore", "no_ignore": "--no-ignore-vcs"}
LOCATE_CMD = "/usr/bin/locate"
LOCATE_OPTS = ["--all", "--ignore-case", "--null"]
# Options: null terminator, ignore case, print names matching all non-option arguments
LOCATE_CMD = shutil.which("locate")
FZF_CMD = "/usr/bin/fzf"
# Options: read null terminator, auto-select if one option, exit if no options, print null terminator
FZF_CMD = shutil.which("fzf")
FZF_OPTS = ["--read0", "--select-1", "--exit-0", "--print0"]
# Platform-specific options
# macOS doesn't support GNU-style long options
if platform == "linux":
LOCATE_OPTS = ["--all", "--ignore-case", "--null"]
elif platform == "darwin":
LOCATE_OPTS = ["-0", "-i"]
# ----- Misc. -----
LOCALE = "utf-8"
@ -139,6 +152,10 @@ def locate_files(patterns):
# ========== Main Script ==========
if __name__ == "__main__":
# This script doesn't support Windows
if platform == "windows":
sys.exit(E_INTERRUPT)
parser = argparse.ArgumentParser()
parser.add_argument(
"-b",

0
fless.sh Normal file → Executable file
View File

0
gek.sh Normal file → Executable file
View File

0
getweather.py Normal file → Executable file
View File

0
lsgroups.sh Normal file → Executable file
View File

0
lsusers.sh Normal file → Executable file
View File

0
misc/quickdel.sh Normal file → Executable file
View File

0
open.sh Normal file → Executable file
View File

0
quickdel.py Normal file → Executable file
View File

View File

@ -1,15 +1,15 @@
# Fuzzy find a file and then edit it
_fedit() {
/usr/bin/fedit && zle reset-prompt
_run_fedit() {
fedit && zle reset-prompt
}
_etcedit() {
/usr/bin/fedit --etc && zle reset-prompt
_run_etcedit() {
fedit --etc && zle reset-prompt
}
zle -N _fedit
bindkey -M viins '^o' _fedit
zle -N _run_fedit
bindkey -M viins '^o' _run_fedit
zle -N _etcedit
bindkey -M viins '^e' _etcedit
zle -N _run_etcedit
bindkey -M viins '^e' _run_etcedit

View File

@ -1,7 +1,7 @@
# Fuzzy-find a file and open it in less
fless() {
_run_fless() {
/usr/bin/fless && zle reset-prompt
}
zle -N fless
bindkey -M viins '^n' fless
zle -N _run_fless
bindkey -M viins '^n' _run_fless