k4d3 commited on
Commit
6ec5189
·
1 Parent(s): c45b591

config changes for zsh and tmux

Browse files
Files changed (2) hide show
  1. .tmux.conf +6 -2
  2. .zshrc +102 -23
.tmux.conf CHANGED
@@ -7,6 +7,12 @@ set -g @plugin 'tmux-plugins/tmux-continuum'
7
  set -g @plugin 'sainnhe/tmux-fzf'
8
  set -g @plugin 'catppuccin/tmux'
9
 
 
 
 
 
 
 
10
  # Enable clipboard integration
11
  set -g set-clipboard on
12
 
@@ -18,8 +24,6 @@ set -g @resurrect-strategy-nvim 'session'
18
  # Disable the bell action
19
  set-option -g bell-action none
20
 
21
- # Set the default shell to zsh without global rc files
22
- set-option -g default-command "zsh --no-globalrcs"
23
  # Enable setting terminal titles
24
  set -g set-titles on
25
  # Set the format for terminal titles
 
7
  set -g @plugin 'sainnhe/tmux-fzf'
8
  set -g @plugin 'catppuccin/tmux'
9
 
10
+ # Enable focus events in tmux
11
+ # This setting allows tmux to detect when the terminal window gains or loses focus.
12
+ # It can be useful for triggering specific actions or updating the status line
13
+ # based on the focus state of the terminal.
14
+ set -g focus-events on
15
+
16
  # Enable clipboard integration
17
  set -g set-clipboard on
18
 
 
24
  # Disable the bell action
25
  set-option -g bell-action none
26
 
 
 
27
  # Enable setting terminal titles
28
  set -g set-titles on
29
  # Set the format for terminal titles
.zshrc CHANGED
@@ -1,6 +1,98 @@
1
  export LANG=ja_JP.UTF-8
2
  export LC_ALL=ja_JP.UTF-8
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  display_custom_help() {
5
  echo "----------------------------------------------------------------------------------------------------------------------"
6
  printf "%s\n" "$(conda env list)"
@@ -12,6 +104,7 @@ display_custom_help() {
12
  echo "----------------------------------------------------------------------------------------------------------------------"
13
  echo "Taggers + Captioners"
14
  echo "----------------------------------------------------------------------------------------------------------------------"
 
15
  echo "JTP2"
16
  echo "---"
17
  echo "~/toolkit/jtp2 <dir>"
@@ -53,10 +146,7 @@ display_custom_help() {
53
  # echo "----------------------------------------------------------------------------------------------------------------------"
54
  echo "- 🐺 TOOLS -"
55
  echo "----------------------------------------------------------------------------------------------------------------------"
56
- echo "nv : Returns the cuda version number."iexport LANG=ja_JP.UTF-8
57
- export LC_ALL=ja_JP.UTF-8
58
-
59
-
60
  echo "remove_repetition : Removes repetition in txt files in a target directory."
61
  echo "copy_sample_prompts : Copies ./sample-prompt.txt file from the current dir to datasets/furry."
62
  echo "remove_number_prefix : Removes all numbers prefixed by a _ from the end of every file."
@@ -124,20 +214,6 @@ remove_repetition() {
124
  # using the pip command with the --use-pep517 option.
125
  alias pie='pip install -e . --use-pep517'
126
 
127
- # Function to remove specific tags from all *.txt files in a target directory recursively
128
- remove_boys() {
129
- # Assign the first argument passed to the function to the variable target_dir
130
- local target_dir="$1"
131
-
132
- # Find all *.txt files in the target directory and its subdirectories
133
- find "$target_dir" -type f -name "*.txt" | while read -r file; do
134
- # Use sed to remove occurrences of [1-9]boy, [1-9]boys, [1-9]girl, and [1-9]girls along with a comma and space character
135
- # -i.bak creates a backup of the original file with a .bak extension
136
- # -E enables extended regular expressions
137
- sed -i.bak -E 's/, ([1-9]boy|[1-9]boys|[1-9]girl|[1-9]girls)//g' "$file"
138
- done
139
- }
140
-
141
  export DOTNET_CLI_TELEMETRY_OPTOUT=1
142
 
143
  # Organizes a sample prompt file from the current directory to datasets/furry.
@@ -197,8 +273,6 @@ llama() {
197
  ~/models/Meta-Llama-3-8B-Instruct.Q5_K_M.llamafile -cb -np 4 -a llama-3-8b --embedding --port 11434
198
  }
199
 
200
- alias gcs='git clone --recurse-submodules'
201
-
202
  # Function to copy matching .caption files
203
  copy_matching_caption_files() {
204
  # Define the target directory
@@ -442,8 +516,8 @@ png2mp4() {
442
 
443
  source $ZSH/oh-my-zsh.sh
444
 
445
- export PATH=$PATH:$HOME/.local/bin:$HOME/source/repos/dataset-tools/target/x86_64-unknown-linux-gnu/release:$HOME/.cargo/bin:$HOME/miniconda3/bin:$HOME/toolkit:$HOME/db/redis-stable/src:$HOME/db/postgresql/bin
446
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib
447
  export COMFYUI_MODEL_PATH=/home/kade/ComfyUI/models
448
 
449
  c_old() {
@@ -457,14 +531,19 @@ c() {
457
  python main.py --listen 0.0.0.0 --preview-method taesd --use-pytorch-cross-attention --disable-xformers --front-end-version Comfy-Org/ComfyUI_frontend@latest --fast
458
  }
459
 
 
460
  alias t="tensorboard --logdir=$HOME/output_dir/logs"
461
- alias nvim="vim"
462
  alias rt="vim ~/.tmux.conf && echo \"Reloading tmux config\" && tmux source ~/.tmux.conf"
463
  alias zr="vim ~/.zshrc && echo \"Reloading zsh config\" && source ~/.zshrc"
464
  alias ta="tmux att"
465
  alias ga="git add . && git commit -avs && git push"
466
  alias gs="git status"
467
  alias wd="git diff --word-diff-regex='[^,]+' --patience"
 
 
 
 
 
468
 
469
  source /home/kade/.config/broot/launcher/bash/br
470
 
 
1
  export LANG=ja_JP.UTF-8
2
  export LC_ALL=ja_JP.UTF-8
3
 
4
+ function list_word_freqs() {
5
+ local target_dir=$1
6
+ if [[ -z "$target_dir" ]]; then
7
+ echo "Usage: list_word_freqs <target_directory>"
8
+ return 1
9
+ fi
10
+
11
+ # Combine all text files into one
12
+ local combined_file=$(mktemp)
13
+ cat "$target_dir"/*.txt > "$combined_file"
14
+
15
+ # List the most frequent words, ignoring specific words
16
+ awk '
17
+ BEGIN {
18
+ ignore["a"]
19
+ ignore["the"]
20
+ ignore["and"]
21
+ ignore["is"]
22
+ ignore["with"]
23
+ ignore["of"]
24
+ ignore["in"]
25
+ ignore["or"]
26
+ ignore["on"]
27
+ ignore["to"]
28
+ ignore["has"]
29
+ ignore["he"]
30
+ ignore["from"]
31
+ }
32
+ {
33
+ for (i = 1; i <= NF; i++) {
34
+ word = tolower($i)
35
+ gsub(/[^a-z]/, "", word)
36
+ if (length(word) > 0 && !(word in ignore)) {
37
+ freq[word]++
38
+ }
39
+ }
40
+ }
41
+ END {
42
+ for (word in freq) {
43
+ print freq[word], word
44
+ }
45
+ }
46
+ ' "$combined_file" | sort -nr | head -n 40
47
+
48
+ # Clean up
49
+ rm "$combined_file"
50
+ }
51
+
52
+ sample_prompts() {
53
+ local target_directory="$1"
54
+
55
+ for file in "$target_directory"/*.txt; do
56
+ cat "$file"
57
+ echo -e "\n"
58
+ done
59
+ }
60
+
61
+ # Function: replace_comma_with_keep_tags
62
+ # Description: This function replaces the specified occurrence of a comma with " |||" in all *.txt files
63
+ # in all subdirectories of a target directory or the current directory when no path is passed.
64
+ # Usage: replace_comma_with_keep_tags <occurrence_number> [target_directory]
65
+ # Parameters:
66
+ # - occurrence_number: The occurrence number of the comma to be replaced (e.g., 1 for the first occurrence).
67
+ # - target_directory (optional): The target directory to search for *.txt files. If not provided, the current directory is used.
68
+ # Example:
69
+ # replace_comma_with_keep_tags 2 /path/to/directory
70
+ # replace_comma_with_keep_tags 1
71
+ replace_comma_with_keep_tags() {
72
+ local occurrence_number=$1
73
+ local target_directory=${2:-.}
74
+
75
+ if [[ -z "$occurrence_number" ]]; then
76
+ echo "Error: occurrence_number is required."
77
+ return 1
78
+ fi
79
+
80
+ find "$target_directory" -type f -name "*.txt" | while read -r file; do
81
+ awk -v occurrence="$occurrence_number" '{
82
+ count = 0
83
+ for (i = 1; i <= NF; i++) {
84
+ if ($i ~ /,/) {
85
+ count++
86
+ if (count == occurrence) {
87
+ gsub(/,/, " |||", $i)
88
+ }
89
+ }
90
+ }
91
+ print
92
+ }' "$file" > tmpfile && mv tmpfile "$file"
93
+ done
94
+ }
95
+
96
  display_custom_help() {
97
  echo "----------------------------------------------------------------------------------------------------------------------"
98
  printf "%s\n" "$(conda env list)"
 
104
  echo "----------------------------------------------------------------------------------------------------------------------"
105
  echo "Taggers + Captioners"
106
  echo "----------------------------------------------------------------------------------------------------------------------"
107
+ echo "gallery-dl --cookies-from-browser firefox https://x.com/whatever"
108
  echo "JTP2"
109
  echo "---"
110
  echo "~/toolkit/jtp2 <dir>"
 
146
  # echo "----------------------------------------------------------------------------------------------------------------------"
147
  echo "- 🐺 TOOLS -"
148
  echo "----------------------------------------------------------------------------------------------------------------------"
149
+ echo "nv : Returns the cuda version number."
 
 
 
150
  echo "remove_repetition : Removes repetition in txt files in a target directory."
151
  echo "copy_sample_prompts : Copies ./sample-prompt.txt file from the current dir to datasets/furry."
152
  echo "remove_number_prefix : Removes all numbers prefixed by a _ from the end of every file."
 
214
  # using the pip command with the --use-pep517 option.
215
  alias pie='pip install -e . --use-pep517'
216
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  export DOTNET_CLI_TELEMETRY_OPTOUT=1
218
 
219
  # Organizes a sample prompt file from the current directory to datasets/furry.
 
273
  ~/models/Meta-Llama-3-8B-Instruct.Q5_K_M.llamafile -cb -np 4 -a llama-3-8b --embedding --port 11434
274
  }
275
 
 
 
276
  # Function to copy matching .caption files
277
  copy_matching_caption_files() {
278
  # Define the target directory
 
516
 
517
  source $ZSH/oh-my-zsh.sh
518
 
519
+ export PATH=$PATH:$HOME/source/repos/dataset-tools/target/x86_64-unknown-linux-gnu/release:$HOME/.cargo/bin:$HOME/miniconda3/bin:$HOME/toolkit:$HOME/db/redis-stable/src:$HOME/db/postgresql/bin:$HOME/.local/bin:/opt/cuda/bin
520
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib:/opt/cuda/targets/x86_64-linux/lib
521
  export COMFYUI_MODEL_PATH=/home/kade/ComfyUI/models
522
 
523
  c_old() {
 
531
  python main.py --listen 0.0.0.0 --preview-method taesd --use-pytorch-cross-attention --disable-xformers --front-end-version Comfy-Org/ComfyUI_frontend@latest --fast
532
  }
533
 
534
+ alias cp='cp --reflinks=auto'
535
  alias t="tensorboard --logdir=$HOME/output_dir/logs"
 
536
  alias rt="vim ~/.tmux.conf && echo \"Reloading tmux config\" && tmux source ~/.tmux.conf"
537
  alias zr="vim ~/.zshrc && echo \"Reloading zsh config\" && source ~/.zshrc"
538
  alias ta="tmux att"
539
  alias ga="git add . && git commit -avs && git push"
540
  alias gs="git status"
541
  alias wd="git diff --word-diff-regex='[^,]+' --patience"
542
+ alias vim="nvim"
543
+ alias vi="nvim"
544
+ alias v="nvim"
545
+ alias grh='git reset --hard'
546
+ alias gcs='git clone --recurse-submodules'
547
 
548
  source /home/kade/.config/broot/launcher/bash/br
549