Compare commits

...

3 Commits

Author SHA1 Message Date
tosu 76432d511b
Save 2024-10-04 15:11:08 +02:00
tosu 98a944fd2f Add night and day aliases to bashrc (redshift) 2024-08-12 17:53:31 +02:00
tosu dd42626d60 Update 2024-08-06 07:29:07 +02:00
9 changed files with 46 additions and 24 deletions

22
.bashrc
View File

@ -141,9 +141,9 @@ elif __have vi ; then
elif __have nano ; then
alias vi="$(__path_lookup nano)"
fi
alias v='log.err use vi'
alias vim='log.err use vi'
alias nvim='log.err use vi'
alias v='log.err use vi; sleep 5 #'
alias vim='log.err use vi; sleep 5 #'
alias nvim='log.err use vi; sleep 5 #'
######################## default-option aliases (posix) ########################
alias gdb='gdb -q'
@ -165,7 +165,7 @@ alias watch='watch -tcn.1 ' # trailing space means complete aliases
alias rm='rm -Iv'
########################## overwrite aliases (posix) ###########################
alias make='compiledb make'
alias make='compiledb make -j'
alias cat='bat'
########################## navigation aliases (posix) ##########################
@ -179,6 +179,7 @@ alias svi='sudo vi'
alias open='xdg-open'
alias dp='declare -p'
alias wttr='curl -sfkSL wttr.in'
alias wttrb='curl -sfkSL wttr.in/berlin'
alias ipa='ip -br -color=auto a'
alias xcopy='xsel --clipboard --input'
alias xpaste='xsel --clipboard --output'
@ -193,6 +194,17 @@ alias ll='\ls --width="${COLUMNS:-80}" --sort=time --time=mtime --color=auto --f
alias l='\ls --width="${COLUMNS:-80}" --sort=time --time=mtime --color=auto --time-style=long-iso -bharZ1l'
alias colors='bash -c "$(curl -sfkSL "https://gist.githubusercontent.com/HaleTom/89ffe32783f89f403bba96bd7bcd1263/raw")"'
alias s='echo sudo $(fc -nl -2 | head -1 | cut -c3-) ; eval sudo $(fc -nl -2 | head -1 | cut -c3-)' # cut -c2- for bash posix mode
alias mstest="bash /home/tosuman/42_minishell_tester/tester.sh"
alias rootshell='sudo python3 -c '\''import pty, os, fcntl, termios, struct;
rows, cols = struct.unpack("hh", fcntl.ioctl(0, termios.TIOCGWINSZ, struct.pack("hh", 0, 0)));
def set_winsize(fd, rows, cols):
fcntl.ioctl(fd, termios.TIOCSWINSZ, struct.pack("HHHH", rows, cols, 0, 0))
def read(fd):
set_winsize(fd, rows, cols)
return os.read(fd, 1024)
pty.spawn("/bin/bash", read)'\'''
alias night='1>/dev/null redshift -g 1:0.99:0.99 -O 5500'
alias day='1>/dev/null redshift -x'
############################### CDPATHS (posix) ################################
CDPATH="."\
@ -666,5 +678,3 @@ complete -C backup_file backup_file
################################### sources ####################################
__source_if "${HOME}/.userbashrc"
alias mstest="bash /home/tosuman/42_minishell_tester/tester.sh"

View File

@ -38,8 +38,8 @@ local cmp_action = require('lsp-zero').cmp_action()
local cmp_mappings = lsp.defaults.cmp_mappings({
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
['<C-t>'] = cmp.mapping.confirm({ select = true }),
['<C-Space>'] = cmp.mapping.complete(),
['<C-y>'] = cmp.mapping.confirm({ select = true }),
-- ['<C-Space>'] = cmp.mapping.complete(),
})
--
lsp.set_preferences({

View File

@ -26,7 +26,11 @@ return require('packer').startup(function(use)
use('vim-airline/vim-airline-themes')
use('cacharle/c_formatter_42.vim')
-- use('m4xshen/autoclose.nvim')
use('takac/vim-hardtime')
-- use('takac/vim-hardtime')
use{
'm4xshen/hardtime.nvim',
requires = { { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" } }
}
use({
'VonHeikemen/lsp-zero.nvim',
branch = 'v2.x',

View File

@ -49,8 +49,8 @@ local function save_profiles(threshold)
end
time([[Luarocks path setup]], true)
local package_path_str = "/home/tosuman/.cache/nvim/packer_hererocks/2.1.1713773202/share/lua/5.1/?.lua;/home/tosuman/.cache/nvim/packer_hererocks/2.1.1713773202/share/lua/5.1/?/init.lua;/home/tosuman/.cache/nvim/packer_hererocks/2.1.1713773202/lib/luarocks/rocks-5.1/?.lua;/home/tosuman/.cache/nvim/packer_hererocks/2.1.1713773202/lib/luarocks/rocks-5.1/?/init.lua"
local install_cpath_pattern = "/home/tosuman/.cache/nvim/packer_hererocks/2.1.1713773202/lib/lua/5.1/?.so"
local package_path_str = "/home/tosuman/.cache/nvim/packer_hererocks/2.1.1720049189/share/lua/5.1/?.lua;/home/tosuman/.cache/nvim/packer_hererocks/2.1.1720049189/share/lua/5.1/?/init.lua;/home/tosuman/.cache/nvim/packer_hererocks/2.1.1720049189/lib/luarocks/rocks-5.1/?.lua;/home/tosuman/.cache/nvim/packer_hererocks/2.1.1720049189/lib/luarocks/rocks-5.1/?/init.lua"
local install_cpath_pattern = "/home/tosuman/.cache/nvim/packer_hererocks/2.1.1720049189/lib/lua/5.1/?.so"
if not string.find(package.path, package_path_str, 1, true) then
package.path = package.path .. ';' .. package_path_str
end
@ -94,6 +94,11 @@ _G.packer_plugins = {
path = "/home/tosuman/.local/share/nvim/site/pack/packer/start/gruvbox",
url = "https://github.com/ellisonleao/gruvbox.nvim"
},
["hardtime.nvim"] = {
loaded = true,
path = "/home/tosuman/.local/share/nvim/site/pack/packer/start/hardtime.nvim",
url = "https://github.com/m4xshen/hardtime.nvim"
},
harpoon = {
loaded = true,
path = "/home/tosuman/.local/share/nvim/site/pack/packer/start/harpoon",
@ -124,6 +129,11 @@ _G.packer_plugins = {
path = "/home/tosuman/.local/share/nvim/site/pack/packer/start/norme.nvim",
url = "https://github.com/vinicius507/norme.nvim"
},
["nui.nvim"] = {
loaded = true,
path = "/home/tosuman/.local/share/nvim/site/pack/packer/start/nui.nvim",
url = "https://github.com/MunifTanjim/nui.nvim"
},
["null-ls.nvim"] = {
loaded = true,
path = "/home/tosuman/.local/share/nvim/site/pack/packer/start/null-ls.nvim",
@ -188,11 +198,6 @@ _G.packer_plugins = {
loaded = true,
path = "/home/tosuman/.local/share/nvim/site/pack/packer/start/vim-fugitive",
url = "https://github.com/tpope/vim-fugitive"
},
["vim-hardtime"] = {
loaded = true,
path = "/home/tosuman/.local/share/nvim/site/pack/packer/start/vim-hardtime",
url = "https://github.com/takac/vim-hardtime"
}
}

View File

@ -1,7 +1,7 @@
[user]
name = tosu
email = timo42@proton.me
signingkey = C00746F2E0F36492!
signingkey = /home/tosuman/.ssh/external/external_github_git.pub
[init]
defaultBranch = main
[color]
@ -24,6 +24,9 @@
d = diff
tree = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit
[gpg]
program = gpg
program = ssh
format = ssh
[commit]
# gpgsign = true
gpgsign = true
[gpg "ssh"]
allowedSignersFile = /home/tosuman/.ssh/allowed_signers

View File

@ -9,7 +9,7 @@ if [ -t 0 ] && [ -n "${1}" ]; then
invert_flag="-v"; shift;
[ -n "${1}" ] || { echo "${0}: syntax error: expected pattern after minus"; exit 2; }
} || invert_flag=""
query="${query} | grep ${invert_flag} -F -- $(squote_escape "${1}")"
query="${query} | grep ${invert_flag} -aF -- $(squote_escape "${1}")"
shift
done

View File

@ -10,8 +10,8 @@ domain="${1-}" # ex. nosu
name="${2-}" # ex. bastion
user="${3-}" # ex. root
[ -z "${domain-}" ] && { echo "Missing domain (1st argument)"; usage; exit 1; }
[ -z "${name-}" ] && { echo "Missing name (2st argument)"; usage; exit 2; }
[ -z "${user-}" ] && { echo "Missing user (3st argument)"; usage; exit 3; }
[ -z "${name-}" ] && { echo "Missing name (2nd argument)"; usage; exit 2; }
[ -z "${user-}" ] && { echo "Missing user (3rd argument)"; usage; exit 3; }
conn="${domain-}_${name-}_${user-}"
if [ -f ~/.ssh/"${domain-}"/"${conn-}" ]; then

View File

@ -13,7 +13,7 @@ curl () {
output=$(timeout 5 curl -sfSL "$@") # strip trailing newline
err=$? # save exit status
printf '%s\n' "${output}" # add trailing newline
[ $err = 0 ] && exit 0 # exit early, we got what we wanted
[ $err = 0 ] && printf '%s' "${output}" | grep -qF -- http && exit 0 # exit early, we got what we wanted
while [ -n "$1" ] && [ "${1}" = "$(printf %s "$1" | tr -d .)" ] ; do shift; done # find domain
[ -z "$1" ] && domain="<unknown>" || domain="$1" # didn't find domain?
[ $err = 124 ] && err "Timed out" # from timeout 5

View File

@ -92,7 +92,7 @@ getVolume() {
}
getRates() {
rxtxrates="$( (cat /tmp/.datarates ; grep wlan0 /proc/net/dev) | awk '{if(l1){printf "%.3f ↑ %.3f ↓\n", ($2-l1)/1024^2*8, ($10-l2)/1024^2*8} else{l1=$2; l2=$10;}}' )"
rxtxrates="$( (cat /tmp/.datarates ; grep wlan0 /proc/net/dev) | awk '{if(l1){printf "%.3f ↓ %.3f ↑\n", ($2-l1)/1024^2*8, ($10-l2)/1024^2*8} else{l1=$2; l2=$10;}}' )"
grep wlan0 /proc/net/dev > /tmp/.datarates
fontColor="$(getColor '92ee79')"
[ -n "${rxtxrates}" ] && rxtxrates="${dlm}^c#${fontColor}1^${rxtxrates}^d^"