-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
153 lines (139 loc) · 3.23 KB
/
.bashrc
File metadata and controls
153 lines (139 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/bin/bash
[[ $- != *i* ]] && return
date
#export GTK_THEME=Plata:dark
set -o emacs
#if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
# read -rn1 -p '> Sway?' ask
# case $ask in
# 'a'|'y'|'s')
# exec wl
# ;;
# esac
#fi
#[[ $- == *i* ]] && source /bedrock/strata/artix/usr/share/blesh/ble.sh --noattach
cpuboost() {
doas sh -c 'echo 1 > /sys/devices/system/cpu/cpufreq/boost'
}
function batt
case "$1" in
p)
printf '%s' "$(</sys/class/power_supply/BAT1/capacity)% ";;
*)
echo "$(</sys/class/power_supply/BAT1/capacity)%"
esac
function clock {
tty-clock -s -c -C 7
}
function states {
printf '\e[?25l'
get-c
((cy==LINES)) && ((cy--))
stty -echo -icanon time 0 min 0
printf '\e[;r'
{ #\e[K
printf '\e[%d;0H\e[30;47m' $LINES
printf '%s\e[37;41m▓▒░\e[30m' "$PWD"
printf '%s\e[31;43m▓▒░\e[30m' "$(date '+%T %d.%m.%+4Y')"
printf 'tty - %s\e[33;42m▓▒░\e[30m' "$(tty)"
printf 'baterie - %s%%\e[32;46m▓▒░\e[30m' "$(</sys/class/power_supply/BAT1/capacity)"
printf 'zvuk - %s\e[36;44m▓▒░\e[30m' "$(awk -F"[][]" '/dB/ { print $2 }' <(amixer sget Master))"
printf 'jas - %s%%\e[34;45m▓▒░\e[30m' "$(</sys/class/backlight/amdgpu_bl0/actual_brightness)"
printf 'wifi - %s \e[m\e[35;47m▓▒░\e[K\e[m' "$(wpa_cli status | grep '^ssid' | cut -f2 -d'=')"
}
printf '\e[?25h'
printf '\e[0;%dr' $((LINES-1))
printf '\e[%d;%dH' $cy $cx
stty sane
}
function get-c {
IFS='[;' read -p $'\e[6n' -d R -rs _ cy cx _
}
function reload {
exec bash
}
stratall()
for stratum in $(brl list)
do
printf '\e[31m%s\e[m\n' "$stratum"
strat "$stratum" "$@"
done
rat() (
match="$1"
shift
cd /bedrock/strata
strat "$match"* $@
)
function mpvn {
printf '%q\n' * | sort -n | xargs mpv --no-audio-display
}
function ge {
alacritty msg config window.padding.y=20
emacs "$@"
alacritty msg config window.padding.y=32
}
function e {
em() {
emacs "$@"
alacritty
}
em "$@" &
exit
}
function htp {
alacritty-swap htop
htop "$@"
alacritty msg config -r
}
alias htop='htp'
function das {
alacritty-swap root
doas "$@"
alacritty msg config -r
}
#alias doas='das'
function watt {
cat /sys/class/power_supply/BAT1/current_now /sys/class/power_supply/BAT1/voltage_now | xargs | awk '{print $1*$2/1e12 " W"}'
}
function eth {
doas sh -c 'echo on > "/sys/bus/pci/devices/0000:02:00.0/power/control"'
}
function cag {
XKB_DEFAULT_LAYOUT="cz,cz"\
XKB_DEFAULT_VARIANT=",rus"\
XKB_DEFAULT_NUMLOCK=enable\
XKB_DEFAULT_OPTIONS="compose:lctrl-altgr,grp:win_space_toggle"\
REPEAT_RATE=40\
REPEAT_DELAY=250\
wl cage -s -d alacritty
}
#PS1="\w \[\e[0;33m\]$\[\e[0m\] \[\e]0;\w\a\]"
PS1="\w \[\e[1m\]%\[\e[0m\] \[\e]0;\w\a\]"
#PS1="\[\e[4m\w \[\e[1m\]$\[\e[0m\] \[\e]0;\w\a\]"
shopt -u globstar
[ "$TERM" = linux ] && {
# PROMPT_COMMAND="states"
# PROMPT_COMMAND="batt -p"
# PS1="\[\e[31m\]$\[\e[0m\] \[\e]0;\w\a\]"
bash bin/setup-tty
PS1="\w % \[\e]0;\w\a\]"
}
source posix-alias
source posix-var
source mcd
mcd_index=(
[soul]="~/Hudba/soul/"
[s]="~/Hudba/soul/"
[g]="~/garbáž/"
[m]="~/mng/"
[u]="~/umen/"
[ui]="~/umen/img/"
)
mcd-index
function setupble {
bleopt filename_ls_colors="$LS_COLORS"
bind 'set completion-ignore-case on'
bleopt history_share=1
[[ ${BLE_VERSION-} ]] && ble-attach
}
#setupble