Compare commits
4 commits
806d7242b9
...
d644581eb2
Author | SHA1 | Date | |
---|---|---|---|
d644581eb2 | |||
0d9a365ddc | |||
a8209d299c | |||
5282ae9679 |
4 changed files with 178 additions and 13 deletions
|
@ -1,4 +1,4 @@
|
||||||
#? Config file for btop v. 1.2.3
|
#? Config file for btop v. 1.3.0
|
||||||
|
|
||||||
#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
|
#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
|
||||||
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
|
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
|
||||||
|
@ -16,11 +16,11 @@ force_tty = False
|
||||||
|
|
||||||
#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets.
|
#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets.
|
||||||
#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box.
|
#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box.
|
||||||
#* Use withespace " " as separator between different presets.
|
#* Use whitespace " " as separator between different presets.
|
||||||
#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty"
|
#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty"
|
||||||
presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty"
|
presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty"
|
||||||
|
|
||||||
#* Set to True to enable "h,j,k,l" keys for directional control in lists.
|
#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists.
|
||||||
#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift.
|
#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift.
|
||||||
vim_keys = True
|
vim_keys = True
|
||||||
|
|
||||||
|
@ -37,6 +37,9 @@ graph_symbol = "block"
|
||||||
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
|
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
|
||||||
graph_symbol_cpu = "default"
|
graph_symbol_cpu = "default"
|
||||||
|
|
||||||
|
# Graph symbol to use for graphs in gpu box, "default", "braille", "block" or "tty".
|
||||||
|
graph_symbol_gpu = "default"
|
||||||
|
|
||||||
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
|
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
|
||||||
graph_symbol_mem = "default"
|
graph_symbol_mem = "default"
|
||||||
|
|
||||||
|
@ -46,14 +49,14 @@ graph_symbol_net = "default"
|
||||||
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
|
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
|
||||||
graph_symbol_proc = "default"
|
graph_symbol_proc = "default"
|
||||||
|
|
||||||
#* Manually set which boxes to show. Available values are "cpu mem net proc", separate values with whitespace.
|
#* Manually set which boxes to show. Available values are "cpu mem net proc" and "gpu0" through "gpu5", separate values with whitespace.
|
||||||
shown_boxes = "cpu mem net proc"
|
shown_boxes = "cpu mem net proc"
|
||||||
|
|
||||||
#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs.
|
#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs.
|
||||||
update_ms = 1000
|
update_ms = 1000
|
||||||
|
|
||||||
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu responsive",
|
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct",
|
||||||
#* "cpu lazy" sorts top process over time (easier to follow), "cpu responsive" updates top process directly.
|
#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly.
|
||||||
proc_sorting = "cpu direct"
|
proc_sorting = "cpu direct"
|
||||||
|
|
||||||
#* Reverse sorting order, True or False.
|
#* Reverse sorting order, True or False.
|
||||||
|
@ -74,12 +77,21 @@ proc_per_core = False
|
||||||
#* Show process memory as bytes instead of percent.
|
#* Show process memory as bytes instead of percent.
|
||||||
proc_mem_bytes = True
|
proc_mem_bytes = True
|
||||||
|
|
||||||
|
#* Show cpu graph for each process.
|
||||||
|
proc_cpu_graphs = True
|
||||||
|
|
||||||
#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate)
|
#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate)
|
||||||
proc_info_smaps = False
|
proc_info_smaps = False
|
||||||
|
|
||||||
#* Show proc box on left side of screen instead of right.
|
#* Show proc box on left side of screen instead of right.
|
||||||
proc_left = False
|
proc_left = False
|
||||||
|
|
||||||
|
#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop).
|
||||||
|
proc_filter_kernel = False
|
||||||
|
|
||||||
|
#* In tree-view, always accumulate child process resources in the parent process.
|
||||||
|
proc_aggregate = False
|
||||||
|
|
||||||
#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available.
|
#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available.
|
||||||
#* Select from a list of detected attributes from the options menu.
|
#* Select from a list of detected attributes from the options menu.
|
||||||
cpu_graph_upper = "total"
|
cpu_graph_upper = "total"
|
||||||
|
@ -88,6 +100,9 @@ cpu_graph_upper = "total"
|
||||||
#* Select from a list of detected attributes from the options menu.
|
#* Select from a list of detected attributes from the options menu.
|
||||||
cpu_graph_lower = "user"
|
cpu_graph_lower = "user"
|
||||||
|
|
||||||
|
#* If gpu info should be shown in the cpu box. Available values = "Auto", "On" and "Off".
|
||||||
|
show_gpu_info = "Auto"
|
||||||
|
|
||||||
#* Toggles if the lower CPU graph should be inverted.
|
#* Toggles if the lower CPU graph should be inverted.
|
||||||
cpu_invert_lower = False
|
cpu_invert_lower = False
|
||||||
|
|
||||||
|
@ -144,6 +159,9 @@ mem_graphs = True
|
||||||
#* Show mem box below net box instead of above.
|
#* Show mem box below net box instead of above.
|
||||||
mem_below_net = False
|
mem_below_net = False
|
||||||
|
|
||||||
|
#* Count ZFS ARC in cached and available memory.
|
||||||
|
zfs_arc_cached = True
|
||||||
|
|
||||||
#* If swap memory should be shown in memory box.
|
#* If swap memory should be shown in memory box.
|
||||||
show_swap = True
|
show_swap = True
|
||||||
|
|
||||||
|
@ -159,6 +177,9 @@ only_physical = True
|
||||||
#* Read disks list from /etc/fstab. This also disables only_physical.
|
#* Read disks list from /etc/fstab. This also disables only_physical.
|
||||||
use_fstab = True
|
use_fstab = True
|
||||||
|
|
||||||
|
#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool)
|
||||||
|
zfs_hide_datasets = False
|
||||||
|
|
||||||
#* Set to true to show available disk space for privileged users.
|
#* Set to true to show available disk space for privileged users.
|
||||||
disk_free_priv = False
|
disk_free_priv = False
|
||||||
|
|
||||||
|
@ -181,7 +202,7 @@ net_download = 1000
|
||||||
net_upload = 100
|
net_upload = 100
|
||||||
|
|
||||||
#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest.
|
#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest.
|
||||||
net_auto = True
|
net_auto = False
|
||||||
|
|
||||||
#* Sync the auto scaling for download and upload to whichever currently has the highest scale.
|
#* Sync the auto scaling for download and upload to whichever currently has the highest scale.
|
||||||
net_sync = True
|
net_sync = True
|
||||||
|
@ -198,3 +219,27 @@ selected_battery = "Auto"
|
||||||
#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
|
#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
|
||||||
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
|
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
|
||||||
log_level = "WARNING"
|
log_level = "WARNING"
|
||||||
|
|
||||||
|
#* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards.
|
||||||
|
nvml_measure_pcie_speeds = True
|
||||||
|
|
||||||
|
#* Horizontally mirror the GPU graph.
|
||||||
|
gpu_mirror_graph = True
|
||||||
|
|
||||||
|
#* Custom gpu0 model name, empty string to disable.
|
||||||
|
custom_gpu_name0 = ""
|
||||||
|
|
||||||
|
#* Custom gpu1 model name, empty string to disable.
|
||||||
|
custom_gpu_name1 = ""
|
||||||
|
|
||||||
|
#* Custom gpu2 model name, empty string to disable.
|
||||||
|
custom_gpu_name2 = ""
|
||||||
|
|
||||||
|
#* Custom gpu3 model name, empty string to disable.
|
||||||
|
custom_gpu_name3 = ""
|
||||||
|
|
||||||
|
#* Custom gpu4 model name, empty string to disable.
|
||||||
|
custom_gpu_name4 = ""
|
||||||
|
|
||||||
|
#* Custom gpu5 model name, empty string to disable.
|
||||||
|
custom_gpu_name5 = ""
|
|
@ -1 +1 @@
|
||||||
Subproject commit 69118b111d4cc6dc78edd64a5a724b6871cccff4
|
Subproject commit 83cd783ecd1943aea2b820b9f4d73deab8cb5969
|
|
@ -22,13 +22,13 @@
|
||||||
"dock": "right",
|
"dock": "right",
|
||||||
"version": "2"
|
"version": "2"
|
||||||
},
|
},
|
||||||
"buffer_font_size": 17,
|
"buffer_font_size": 18,
|
||||||
"format_on_save": "prettier",
|
"format_on_save": "prettier",
|
||||||
"formatter": "prettier",
|
"formatter": "prettier",
|
||||||
"buffer_font_family": "FiraCode Nerd Font",
|
"buffer_font_family": "FiraCode Nerd Font",
|
||||||
"tab_size": 4,
|
"tab_size": 4,
|
||||||
"vim_mode": true,
|
"vim_mode": true,
|
||||||
"ui_font_size": 16,
|
"ui_font_size": 15,
|
||||||
"theme": {
|
"theme": {
|
||||||
"mode": "system",
|
"mode": "system",
|
||||||
"light": "One Light",
|
"light": "One Light",
|
||||||
|
|
124
.zshrc
124
.zshrc
|
@ -1,6 +1,7 @@
|
||||||
### ENVVARS
|
### ENVVARS
|
||||||
# zmodload zsh/zprof # for profiling, also uncomment last line
|
# zmodload zsh/zprof # for profiling, also uncomment last line
|
||||||
|
|
||||||
|
|
||||||
source "$HOME/.zprofile"
|
source "$HOME/.zprofile"
|
||||||
source "$HOME/.config/user-dirs.dirs"
|
source "$HOME/.config/user-dirs.dirs"
|
||||||
export TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'
|
export TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'
|
||||||
|
@ -18,6 +19,7 @@ export VISUAL=$(which nvim)
|
||||||
|
|
||||||
|
|
||||||
### Aliases
|
### Aliases
|
||||||
|
alias e="eza -la"
|
||||||
alias l="lsd -lah --date \"$DATEFMT\" --hyperlink=auto"
|
alias l="lsd -lah --date \"$DATEFMT\" --hyperlink=auto"
|
||||||
alias ll="lsd -lh --date \"$DATEFMT\" --hyperlink=auto"
|
alias ll="lsd -lh --date \"$DATEFMT\" --hyperlink=auto"
|
||||||
alias la="lsd -a --date \"$DATEFMT\" --hyperlink=auto"
|
alias la="lsd -a --date \"$DATEFMT\" --hyperlink=auto"
|
||||||
|
@ -50,7 +52,9 @@ alias bell="tput bel"
|
||||||
alias fd=fdfind
|
alias fd=fdfind
|
||||||
alias nobak="touch .nobackup"
|
alias nobak="touch .nobackup"
|
||||||
alias securerm="shred -zun 100"
|
alias securerm="shred -zun 100"
|
||||||
# alias shutdown="confirm shutdown"
|
alias mkpatch="diff -Naru"
|
||||||
|
alias shrug="echo -ne ¯\\\_(ツ)_/¯"
|
||||||
|
alias bak=backup
|
||||||
|
|
||||||
### Functions
|
### Functions
|
||||||
function random() {
|
function random() {
|
||||||
|
@ -128,6 +132,123 @@ function confirm-important() {
|
||||||
echo "aborting"
|
echo "aborting"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
function writepatch() {
|
||||||
|
target=$1
|
||||||
|
fname=$(basename $target)
|
||||||
|
mkdir -p a b
|
||||||
|
cp -r $target a
|
||||||
|
cp -r $target b
|
||||||
|
nvim b/$fname
|
||||||
|
diff -Naru --color='auto' a/$fname b/$fname
|
||||||
|
}
|
||||||
|
backup() {
|
||||||
|
local compress=0
|
||||||
|
local src=""
|
||||||
|
|
||||||
|
# Parse options
|
||||||
|
while getopts "z" opt; do
|
||||||
|
case $opt in
|
||||||
|
z) compress=1 ;;
|
||||||
|
*) echo "Usage: backup [-z] file_or_dir"; return 1 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
|
# Get source file/dir after option processing
|
||||||
|
src="$1"
|
||||||
|
if [ -z "$src" ]; then
|
||||||
|
echo "Error: no source specified"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if source exists
|
||||||
|
if [ ! -e "$src" ]; then
|
||||||
|
echo "Error: $src does not exist"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create backup based on type and options
|
||||||
|
if [ $compress -eq 1 ]; then
|
||||||
|
tar -I zstd -cf "${src}.tar.zstd" "$src"
|
||||||
|
elif [ -d "$src" ]; then
|
||||||
|
cp -r "$src" "${src}.bak.d"
|
||||||
|
else
|
||||||
|
cp "$src" "${src}.bak"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
restore() {
|
||||||
|
local remove=0
|
||||||
|
|
||||||
|
# Parse options
|
||||||
|
while getopts "r" opt; do
|
||||||
|
case $opt in
|
||||||
|
r) remove=1 ;;
|
||||||
|
*) echo "Usage: restore [-r] backup_file"; return 1 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
|
# Check if argument was provided
|
||||||
|
local src="$1"
|
||||||
|
if [ -z "$src" ]; then
|
||||||
|
echo "Error: no backup file specified"
|
||||||
|
echo "Usage: restore [-r] backup_file"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if source exists
|
||||||
|
if [ ! -e "$src" ]; then
|
||||||
|
echo "Error: $src does not exist"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Function to handle overwrite confirmation
|
||||||
|
confirm_overwrite() {
|
||||||
|
echo -n "$1 already exists. Overwrite? [y/N] "
|
||||||
|
read answer
|
||||||
|
[[ $answer =~ ^[Yy] ]]
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
# Determine backup type and restore accordingly
|
||||||
|
if [[ "$src" == *.tar.zstd ]]; then
|
||||||
|
local dest="${src%.tar.zstd}"
|
||||||
|
if [ -e "$dest" ]; then
|
||||||
|
if ! confirm_overwrite "$dest"; then
|
||||||
|
echo "Restore cancelled"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
rm -rf "$dest"
|
||||||
|
fi
|
||||||
|
tar -I zstd -xf "$src"
|
||||||
|
[ $remove -eq 1 ] && rm "$src"
|
||||||
|
elif [[ "$src" == *.bak.d ]]; then
|
||||||
|
local dest="${src%.bak.d}"
|
||||||
|
if [ -e "$dest" ]; then
|
||||||
|
if ! confirm_overwrite "$dest"; then
|
||||||
|
echo "Restore cancelled"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
rm -rf "$dest"
|
||||||
|
fi
|
||||||
|
cp -r "$src" "$dest"
|
||||||
|
[ $remove -eq 1 ] && rm -rf "$src"
|
||||||
|
elif [[ "$src" == *.bak ]]; then
|
||||||
|
local dest="${src%.bak}"
|
||||||
|
if [ -e "$dest" ]; then
|
||||||
|
if ! confirm_overwrite "$dest"; then
|
||||||
|
echo "Restore cancelled"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
rm -f "$dest"
|
||||||
|
fi
|
||||||
|
cp "$src" "$dest"
|
||||||
|
[ $remove -eq 1 ] && rm "$src"
|
||||||
|
else
|
||||||
|
echo "Error: $src is not a recognized backup format"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
### ---- zsh options -------------------------------------
|
### ---- zsh options -------------------------------------
|
||||||
|
@ -304,7 +425,6 @@ function load_nvm() {
|
||||||
# gpg is cool actually
|
# gpg is cool actually
|
||||||
|
|
||||||
# crypto stuff with my gpg keys
|
# crypto stuff with my gpg keys
|
||||||
export IDENTITY="Christoph J. Scherr <software@cscherr.de>"
|
|
||||||
export KEY_TYPE=ed25519
|
export KEY_TYPE=ed25519
|
||||||
export KEYID=0E777B31ACC5B69B7096C050A466E5C5D6792EE9
|
export KEYID=0E777B31ACC5B69B7096C050A466E5C5D6792EE9
|
||||||
gpgencrypt() {
|
gpgencrypt() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue