Skip to content
This repository was archived by the owner on May 2, 2025. It is now read-only.

Commit 3397ee0

Browse files
committed
build: refresh config
- refactor: a lot on precmd hook functions - modify: few changes on tmux config and add new options
1 parent a635384 commit 3397ee0

3 files changed

Lines changed: 33 additions & 48 deletions

File tree

prefix/airootfs/etc/tmux.conf

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,20 @@
44
# ██║ ██║╚██╔╝██║██║ ██║ ██╔██╗
55
# ██║ ██║ ╚═╝ ██║╚██████╔╝██╔╝ ██╗
66
# ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
7+
set -g default-terminal "xterm-256color" # Set the default terminal for new window created in this session - the default value of the TERM environment variable.
8+
set -g escape-time 300 # Set the time in milliseconds for which tmux waits after an escape is input to determine if it is part of a function or meta key sequences.
9+
set -g editor "/usr/bin/nvim" # Set the command used when tmux runs an editor.
10+
set -g exit-empty on # If enabled (the default), the server will exit when there are no active sessions
11+
set -g exit-unattached off # If enabled, the server will exit when there are no attached clients.
12+
set -g extended-keys on # When on or always, the escape sequence to enable extended keys is sent to the terminal, if tmux knows that it is supported. tmux always recognises extended keys itself. If this option is on, tmux will only forward ex‐ tended keys to applications when they request them; if always, tmux will always forward the keys.
13+
# set -g focus-events on # When enabled, focus events are requested from the terminal if supported and passed through to applications running in tmux.
14+
# set -g history-file filepath # If not empty, a file to which tmux will write command prompt history on exit and load it from on start.
15+
# set -g message-limit 200 # Set the number of error or information messages to save in the message log for each client.
16+
set -g history-limit 5000
717
set -g mouse on # Supports xterm(1) mouse sequences.
818
set -g default-shell /bin/zsh # Specify the default shell.
919
set -g base-index 1 # Set the base index from which an unused index should be searched when a new window is created.
10-
set -g default-terminal "xterm-256color" # Set the default terminal for new window created in this session - the default value of the TERM environment variable.
1120
set -ga terminal-overrides ",xterm-256color*:Tc" # This fix weird color in tmux dont REMOVE this
12-
set -g escape-time 300 # Set the time in milliseconds for which tmux waits after an escape is input to determine if it is part of a function or meta key sequences.
1321
set -g repeat-time 599 # Allow multiple commands to be entered without pressing the prefix-key again in the specified time mulliseconds (the default is 500).
1422
set -g renumber-windows on # If on, when a window is closed in a session, automatically renumber the other windows in numerical order.
1523
set -g set-titles on # Attempt to set the client terminal title usign the `tsl` and `fsl` terminfo(5) entries if they exist.
@@ -40,15 +48,18 @@ setw -g window-active-style bg=#000000 # Set the pane style when it is acti
4048
setw -g window-status-format "#[fg=#000000,bg=#030303]#[fg=#b2b2b2,bg=#030303]#I#[fg=#d0d0d0,bg=#030303] #W#{?window_flags,#{window_flags}, }#[fg=#030303,bg=#000000]" # Set the format in which the window is displayed in the status line window list.
4149
setw -g window-status-current-format "#[fg=#000000,bg=#030303]#[fg=#b2b2b2,bg=#030303]#I#[fg=#d0d0d0,bg=#030303] #W#{?window_flags,#{window_flags}, }#[fg=#030303,bg=#000000]" # Set status line style for the currently active window.
4250

43-
set -g prefix2 C-Space # Set a secondary key accepted as a prefix key: Control + space
44-
bind-key k select-pane -U # Set binding-key select-pane up: prefix-key + k
45-
bind-key j select-pane -D # Set binding-key select-pane down: prefix-key + j
46-
bind-key h select-pane -L # Set binding-key select-pane left: prefix-key + h
47-
bind-key l select-pane -R # Set binding-key select-pane right: prefix-key + l
48-
bind-key , split-window -v # Set binding-key split-window vertically: prefix-key + ,
49-
bind-key . split-window -h # Set binding-key split-window horizontally: prefix-key + .
50-
bind-key -r K resize-pane -U 5 # Set binding-key resize-pane to up 5%: prefix-key + K
51-
bind-key -r J resize-pane -D 5 # Set binding-key resize-pane to down 5%: prefix-key + J
52-
bind-key -r H resize-pane -L 5 # Set binding-key resize-pane to left 5%: prefix-key + H
53-
bind-key -r L resize-pane -R 5 # Set binding-key resize-pane to right 5%: prefix-key + L
54-
bind-key r source-file /etc/tmux.conf \; display-message "Reloaded!" # Set binding-key reload tmux config file: prefix-key + r
51+
unbind C-Space # Remove bind-key of Control+Space
52+
set -g prefix C-Space # Set a secondary key accepted as a prefix key: Control + space
53+
bind-key C-Space send-prefix # send prefix keystroke to a window, useful with nested tmux sessions
54+
55+
bind-key k select-pane -U # select-pane up: prefix-key + k
56+
bind-key j select-pane -D # select-pane down: prefix-key + j
57+
bind-key h select-pane -L # select-pane left: prefix-key + h
58+
bind-key l select-pane -R # select-pane right: prefix-key + l
59+
bind-key , split-window -v # split-window vertically: prefix-key + ,
60+
bind-key . split-window -h # split-window horizontally: prefix-key + .
61+
bind-key -r K resize-pane -U 5 # resize-pane to up 5%: prefix-key + K
62+
bind-key -r J resize-pane -D 5 # resize-pane to down 5%: prefix-key + J
63+
bind-key -r H resize-pane -L 5 # resize-pane to left 5%: prefix-key + H
64+
bind-key -r L resize-pane -R 5 # resize-pane to right 5%: prefix-key + L
65+
bind-key r source-file /etc/tmux.conf \; display-message "Reloaded!" # reload tmux config file: prefix-key + r

prefix/airootfs/etc/zsh/functions/haxx/deauth_attack

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env zsh
2-
# vim:ft=sh
3-
emulate -L zsh; setopt extendedglob warncreateglobal; set -o pipefail
4-
need_installed aireplay-ng iwconfig ifconfig || return $? # Check if command installed || exit
5-
need_normal_user || return $? # Only normal user can run || exit
6-
must_have_argument $1 || return $? # Must have argument-1 passed || exit
7-
must_have_argument $2 || return $? # Must have argument-2 passed || exit
2+
emulate -L zsh; setopt extendedglob warncreateglobal pipefail nounset errreturn
3+
need_installed aireplay-ng iwconfig ifconfig # Check if command installed || exit
4+
need_normal_user # Only normal user can run || exit
5+
must_have_argument ${1:-} # Must have argument-1 passed || exit
6+
must_have_argument ${2:-} # Must have argument-2 passed || exit
87

98
local bssid="${2}" # Store argument-2 to local variable
109
local interface="${1}" # Store argument-1 to local variable
Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,6 @@
11
#!/usr/bin/env zsh
2-
emulate -L zsh; setopt extendedglob pipefail
2+
emulate -L zsh; setopt extendedglob warncreateglobal pipefail nounset errreturn
33

44
echo "" # Print string
5-
if [[ -z $NO_RPROMPT ]] || (( $NO_RPROMPT == 0 )); then # If no_prompt variable empty or 0 then:
6-
if [[ ! $TTY == /dev/tty* ]]; then # Check if TTY is not /dev/tty
7-
if [[ $start_time_execution ]]; then # Check if variable start_time_execution is available
8-
readonly -F elapsed_time=$(( EPOCHREALTIME - start_time_execution )) # Current_time-start_time_execution -> store into variable elapsed_time
9-
readonly -F second=$(( elapsed_time%60 )) # Get second from elapsed_time,formula: elapsed_time/60 -> round it the output -> output*60 -> elapsed_time-output -> result
10-
readonly -i minute=$(( (elapsed_time/60)%60 )) # Get minute from elapsed time, formula: elapsed_time/60 -> output/60 -> round it the output_2 -> output_2*60 -> elapsed_time-output_2 -> result
11-
readonly -i hour=$(( elapsed_time/3600 )) # Get hour from elapsed time, formula: elapsed_time/3600 -> result
12-
if (( hour > 0 )); then # If hour greater than 0 then:
13-
printf -v elapsed_time_execution '%ih%im' ${hour} ${minute} # Store output printf into variable elapsed_time_execution. output will be: 12h34m
14-
elif (( minute > 0 )); then # If minute greater than 0 then:
15-
printf -v elapsed_time_execution '%im%is' ${minute} ${second} # Store output printf into variable elapsed_time_execution. output will be: 12m34s
16-
elif (( second >= 10 )); then # If second greater than/equal 10 then:
17-
printf -v elapsed_time_execution '%.2fs' ${second} # Store output printf into variable elapsed_time_execution. variable second will be formated to floating point(output will be: 12.34s)
18-
elif (( second >= 1 )); then # If second greater than/equal 1 then:
19-
printf -v elapsed_time_execution '%.3fs' ${second} # Store output printf into variable elapsed_time_execution. variable second will be formated to floating point(output will be: 1.233s)
20-
else
21-
printf -v elapsed_time_execution '%ims' $(( second*1000 )) # Store output printf into variable elapsed_time_execution. Get the millisecond from elapsed_time, formula: second*1000
22-
fi
23-
unset start_time_execution # Clear the value of variable start_time_execution
24-
else
25-
unset elapsed_time_execution # Clear previous result when hitting ENTER with no command to execute
26-
fi # End if-else statement
27-
# RPROMPT="%(1j.%F{#ff6e33}▐%K{#ff6e33}%F{#803719}⚙ %K{reset}%F{#ff6e33} %j .)%(?..%F{#af0000}▐%K{#af0000}%F{#490000} %K{reset}%F{#af0000} %? )%F{#2c99ef}▐%K{#2c99ef}%F{#13456c} %K{reset}%F{#2c99ef} ${elapsed_time_execution:-}" # Set right-prompt style
28-
RPROMPT="%F{#cc0022}◆ ${elapsed_time_execution:-}%K{reset}%F{reset}" # Set right-prompt style
29-
fi # End if-else statement
30-
fi # End if-else statement
31-
print -Pn "\e]133;A\e\\"
5+
elapsed-time-execution-command # Call command
6+
RPROMPT="%F{#36a3d9}%K{#030d11}  ${elapsed_time_execution:-} %K{reset}%F{reset}" # Set right-prompt style

0 commit comments

Comments
 (0)