diff --git a/.bashrc b/.bashrc index b4a0057..1c7ae1f 100644 --- a/.bashrc +++ b/.bashrc @@ -74,6 +74,9 @@ elif 2>/dev/null 1>&2 command -v vi; then alias v='vi' fi +alias tapo_bright='ssh -t pt bash -ic tapo_bright' +alias tapo_color_ambience='ssh -t pt bash -ic tapo_color_ambience' +alias tapo_color_ambience2='ssh -t pt bash -ic tapo_color_ambience2' alias gdb='gdb -q' alias objdump='objdump --disassembler-color=extended-color -Mintel' alias v='nvim' @@ -143,6 +146,7 @@ CDPATH="${CDPATH}:${HOME}/projects/aoc" CDPATH="${CDPATH}:${HOME}/projects/aoc/2023" CDPATH="${CDPATH}:${HOME}/42ecole" CDPATH="${CDPATH}:${HOME}/42ecole/42cursus" +CDPATH="${CDPATH}:${HOME}/onnea" function paruuu () { read -p 'Do system upgrade (Y) or exit (n)' choice @@ -176,7 +180,7 @@ function paruuu () { && [ ! "${ssid-}" = "Silmaril 4 (2.4)" ] \ && [ -n "${ssid-}" ] \ && : ; then - read -p "You're connected to '${ssid-}', update anyway (Y|n)?" choice + read -p "[31mYou're connected to '${ssid-}', update anyway (Y|n)?[m" choice if [ ! "${choice}" = "y" -a ! "${choice}" = "Y" -a -n "${choice}" ]; then exit fi @@ -329,7 +333,7 @@ export MANPAGER='nvim +Man!' ###################### PROMPT STUFF ####################### # If bash runs in posix mode, if should be `cut -c2-' instead # shellcheck disable=SC2016 -PS0='$(clear -x ; printf "${PS1@P}" ; fc -nl -1 | cut -c3- ; printf "\n")' +# PS0='$(clear -x ; printf "${PS1@P}" ; fc -nl -1 | cut -c3- ; printf "\n")' if [ ! -f "${HOME}"/.bash-preexec.sh ] ; then curl --silent --location \ @@ -546,3 +550,6 @@ aocload () { tmux select-pane -l tmux send-keys "nvim './solution.py'" ENTER } + +xmodmap ~/.Xmodmap +alias q='docker run --rm -it ghcr.io/natesales/q' diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index cdb1880..00a2263 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -32,6 +32,8 @@ yellow = "#da8548" [colors.primary] background = "#282c34" foreground = "#bbc2cf" +# foreground = "#000000" +# background = "#ffffff" [colors.selection] background = "#3e4451" @@ -398,12 +400,13 @@ program = "/bin/sh" [window] dynamic_padding = false +dynamic_title = true opacity = 1.0 startup_mode = "Windowed" [window.dimensions] -columns = 100 -lines = 85 +columns = 90 +lines = 25 [window.padding] x = 0 diff --git a/.config/nvim/after/plugin/colors.lua b/.config/nvim/after/plugin/colors.lua index 9ce7c0e..6e038c2 100644 --- a/.config/nvim/after/plugin/colors.lua +++ b/.config/nvim/after/plugin/colors.lua @@ -11,4 +11,4 @@ ColorMyPencils("gruvbox") -- ColorMyPencils("habamax") -- For outside --- ColorMyPencils("peachpuff") +-- ColorMyPencils("zellner") diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index 84b9496..05c52aa 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -86,7 +86,7 @@ null_ls.setup({ } }) -require("norme").setup({ - -- Your configuration - cmd = os.getenv('HOME') .. '/.local/bin/norminette' -}) +-- require("norme").setup({ +-- -- Your configuration +-- cmd = os.getenv('HOME') .. '/.local/bin/norminette' +-- }) diff --git a/.config/nvim/after/plugin/treesitter.lua b/.config/nvim/after/plugin/treesitter.lua index 26eb6a6..1ea991f 100644 --- a/.config/nvim/after/plugin/treesitter.lua +++ b/.config/nvim/after/plugin/treesitter.lua @@ -1,32 +1,32 @@ -require 'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" (the five listed parsers should always be installed) - ensure_installed = { "vimdoc", "javascript", "typescript", "python", "bash", "c", "lua", "vim", "vimdoc", "query" }, - - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, - - -- List of parsers to ignore installing (for "all") - ignore_install = { "help" }, - - highlight = { - enable = true, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, - - incremental_selection = { - enable = true, - keymaps = { - node_incremental = "v", - node_decremental = "V", - }, - }, -} +--- require 'nvim-treesitter.configs'.setup { +--- -- A list of parser names, or "all" (the five listed parsers should always be installed) +--- ensure_installed = { "vimdoc", "javascript", "typescript", "python", "bash", "c", "lua", "vim", "vimdoc", "query" }, +--- +--- -- Install parsers synchronously (only applied to `ensure_installed`) +--- sync_install = false, +--- +--- -- Automatically install missing parsers when entering buffer +--- -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally +--- auto_install = true, +--- +--- -- List of parsers to ignore installing (for "all") +--- ignore_install = { "help" }, +--- +--- highlight = { +--- enable = true, +--- +--- -- Setting this to true will run `:h syntax` and tree-sitter at the same time. +--- -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). +--- -- Using this option may slow down your editor, and you may see some duplicate highlights. +--- -- Instead of true it can also be a list of languages +--- additional_vim_regex_highlighting = false, +--- }, +--- +--- incremental_selection = { +--- enable = true, +--- keymaps = { +--- node_incremental = "v", +--- node_decremental = "V", +--- }, +--- }, +--- } diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 2c0c48d..45f0730 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,2 +1,3 @@ require("tosu") vim.cmd('source ~/.vim/plugin/stdheader.vim') +vim.cmd('source ~/.vim/hm.vim') diff --git a/.config/nvim/lua/tosu/remap.lua b/.config/nvim/lua/tosu/remap.lua index 9b847e9..6f38a1a 100644 --- a/.config/nvim/lua/tosu/remap.lua +++ b/.config/nvim/lua/tosu/remap.lua @@ -51,3 +51,6 @@ vim.keymap.set("v", "C", "mz:s/\\/\\* \\(.*\\) \\*\\//\\1/g:noh` vim.fn.setreg("t", "m5`1v`2y`3v`4p`1v`2p`5") vim.keymap.set("n", "", "m3yiwi m2`1bviwp`2viwp`2i`3") + +-- vim.keymap.set("i", "{", "{}O") +vim.keymap.set("n", "*", "#*") diff --git a/.config/nvim/plugin/packer_compiled.lua b/.config/nvim/plugin/packer_compiled.lua index a3b497c..179e43e 100644 --- a/.config/nvim/plugin/packer_compiled.lua +++ b/.config/nvim/plugin/packer_compiled.lua @@ -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.1696795921/share/lua/5.1/?.lua;/home/tosuman/.cache/nvim/packer_hererocks/2.1.1696795921/share/lua/5.1/?/init.lua;/home/tosuman/.cache/nvim/packer_hererocks/2.1.1696795921/lib/luarocks/rocks-5.1/?.lua;/home/tosuman/.cache/nvim/packer_hererocks/2.1.1696795921/lib/luarocks/rocks-5.1/?/init.lua" -local install_cpath_pattern = "/home/tosuman/.cache/nvim/packer_hererocks/2.1.1696795921/lib/lua/5.1/?.so" +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" if not string.find(package.path, package_path_str, 1, true) then package.path = package.path .. ';' .. package_path_str end diff --git a/.inputrc b/.inputrc index 72ba42f..41d53e6 100644 --- a/.inputrc +++ b/.inputrc @@ -8,3 +8,7 @@ set page-completions off TAB: menu-complete "\e[Z": menu-complete-backward + +# "\e[A": history-substring-search-backward +# "\e[B": history-substring-search-forward +"\C-x\C-r": forward-search-history diff --git a/.local/bin/updatebar b/.local/bin/updatebar index 62c963a..44aaed2 100755 --- a/.local/bin/updatebar +++ b/.local/bin/updatebar @@ -6,16 +6,26 @@ done dlm=" | " delay=1 +whitemode='0' + +getColor() { + if [ "${whitemode}" = "1" ]; then + printf '%s' "000000" # black + else + printf '%s' "${1}" + fi +} getDate() { date="$(date +"%a %d/%m/%Y %H:%M:%S")" - # [ -n "${date}" ] && date="${dlm}^c#d08770^ ${date}^d^" - [ -n "${date}" ] && date="${dlm}^c#d08770^📅 ${date}^d^" + fontColor="$(getColor 'd08770')" + # [ -n "${date}" ] && date="${dlm}^c#${fontColor}^ ${date}^d^" + [ -n "${date}" ] && date="${dlm}^c#${fontColor}^📅 ${date}^d^" printf '%s' "${date}" } getBattery() { - battery="$(level="$(printf '%s' "$(($(cat /sys/class/power_supply/BAT1/energy_now) * 100000 / $(cat /sys/class/power_supply/BAT1/energy_full)))" | sed "s/\(...\)$/.\1%/")$([ "$(cat /sys/class/power_supply/BAT1/status)" = "Charging" ] && printf '%s' "+" || printf '%s' "-")" ; printf '%s' "${level}" ; printf '%s' "$(date "+%a %d/%m/%Y %H:%M:%S"): ${level}" >> /home/tosuman/.logs/battery.log)" + battery="$(level="$(printf '%s' "$(($(cat /sys/class/power_supply/BAT1/energy_now) * 100000 / $(cat /sys/class/power_supply/BAT1/energy_full)))" | sed "s/\(...\)$/.\1%/")$([ "$(cat /sys/class/power_supply/BAT1/status)" = "Charging" ] && printf '%s' "+" || printf '%s' "-")" ; printf '%s' "${level}" ; printf '%s\n' "$(date "+%a %d/%m/%Y %H:%M:%S"): ${level}" >> /home/tosuman/.logs/battery.log)" int_battery="$(printf '%s' "${battery}" | sed 's/\..*//')" if [ "${int_battery}" -lt 11 ] && [ -z "$(pgrep -f qutebrowser)" ] ; then xdotool key "Super_L+m" @@ -23,85 +33,98 @@ getBattery() { 1>/dev/null 2>&1 qutebrowser "/home/tosuman/infopages/battery_low.html" & fi - # [ -n "${battery}" ] && battery="${dlm}^c#43f1f1^ ${battery}^d^" - [ -n "${battery}" ] && battery="${dlm}^c#43f1f1^🔋 ${battery}^d^" + fontColor="$(getColor '43f1f1')" + # [ -n "${battery}" ] && battery="${dlm}^c#${fontColor}^ ${battery}^d^" + [ -n "${battery}" ] && battery="${dlm}^c#${fontColor}^🔋 ${battery}^d^" printf '%s' "${battery}" } getLayout() { layout="$(setxkbmap -query | grep layout | awk -F' ' '{ print $2 }')" - # [ -n "${layout}" ] && layout="${dlm}^c#a3be8c^ ${layout}^d^" - [ -n "${layout}" ] && layout="${dlm}^c#a3be8c^💻 ${layout}^d^" + fontColor="$(getColor 'a3be8c')" + # [ -n "${layout}" ] && layout="${dlm}^c#${fontColor}^ ${layout}^d^" + [ -n "${layout}" ] && layout="${dlm}^c#${fontColor}^💻 ${layout}^d^" printf '%s' "${layout}" } getWifi() { wifi="$(iw dev wlan0 link | grep SSID | sed -e 's/[[:blank:]]*SSID: //' -e 's/[[:blank:]]*$//')" - [ -n "${wifi}" ] && wifi="${dlm}^c#bf616a^ ${wifi}^d^" + fontColor="$(getColor 'bf616a')" + [ -n "${wifi}" ] && wifi="${dlm}^c#${fontColor}^ ${wifi}^d^" printf '%s' "${wifi}" } getWifi1() { wifi="$(iw dev wlan1 link | grep SSID | sed -e 's/[[:blank:]]*SSID: //' -e 's/[[:blank:]]*$//')" - [ -n "${wifi}" ] && wifi="${dlm}^c#bf616a^ ${wifi}^d^" + fontColor="$(getColor 'bf616a')" + [ -n "${wifi}" ] && wifi="${dlm}^c#${fontColor}^ ${wifi}^d^" printf '%s' "${wifi}" } getEth () { eth="$(2>/dev/null ip a show "$(ls /sys/class/net | grep enp | head -1)" | grep -v inet6 | grep inet | awk '{print $2}')" - [ -n "${eth}" ] && eth="${dlm}^c#bf616a^ ${eth}^d^" + fontColor="$(getColor 'bf616a')" + [ -n "${eth}" ] && eth="${dlm}^c#${fontColor}^ ${eth}^d^" printf '%s' "${eth}" } getNord() { # return 1 nord="$(nordvpn status | grep Status | sed 's/.*Status: //')" - # [ -n "${nord}" ] && nord="${dlm}^c#8fbcbb^嬨 ${nord}^d^" - [ -n "${nord}" ] && nord="${dlm}^c#8fbcbb^🌐 ${nord}^d^" + fontColor="$(getColor '8fbcbb')" + # [ -n "${nord}" ] && nord="${dlm}^c#${fontColor}^嬨 ${nord}^d^" + [ -n "${nord}" ] && nord="${dlm}^c#${fontColor}^🌐 ${nord}^d^" printf '%s' "${nord}" } getBluetooth() { bluetooth="$(bluetoothctl devices | cut -f2 -d' ' | while read -r uuid ; do bluetoothctl info "${uuid}" ; done | grep -e "Connected\|Name" | sed -e "s/\t//" - | perl -0777 -pe 's/Name: (.*?)\nConnected: yes/<<>>\1/' | grep "<<>>" | sed "s/<<>>//")" - [ -n "${bluetooth}" ] && bluetooth="${dlm}^c#81a1c1^ ${bluetooth}^d^" + fontColor="$(getColor '81a1c1')" + [ -n "${bluetooth}" ] && bluetooth="${dlm}^c#${fontColor}^ ${bluetooth}^d^" printf '%s' "${bluetooth}" } getVolume() { volume="$(pulsemixer --get-volume | cut -d' ' -f1)%" - [ -n "${volume}" ] && volume="${dlm}^c#93a1a1^🔊 ${volume}^d^" + fontColor="$(getColor '93a1a1')" + [ -n "${volume}" ] && volume="${dlm}^c#${fontColor}^🔊 ${volume}^d^" printf '%s' "${volume}" } 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;}}' )" grep wlan0 /proc/net/dev > /tmp/.datarates - [ -n "${rxtxrates}" ] && rxtxrates="${dlm}^c#92ee791^${rxtxrates}^d^" + fontColor="$(getColor '92ee79')" + [ -n "${rxtxrates}" ] && rxtxrates="${dlm}^c#${fontColor}1^${rxtxrates}^d^" printf '%s' "${rxtxrates}" } getCpuTemp() { temp="$(($(cat /sys/class/thermal/thermal_zone0/temp) / 1000))°C" - [ -n "${temp}" ] && temp="${dlm}^c#13a1a1^🌡️ ${temp}^d^" + fontColor="$(getColor '13a1a1')" + [ -n "${temp}" ] && temp="${dlm}^c#${fontColor}^🌡️ ${temp}^d^" printf '%s' "${temp}" } getWattage() { wattage="$(awk '{printf "%.0f", $1*10^-6}' /sys/class/power_supply/BAT1/power_now)" - [ -n "${wattage}" ] && wattage="${dlm}^c#5e81ac^⚡ ${wattage}W^d^" + fontColor="$(getColor '5e81ac')" + [ -n "${wattage}" ] && wattage="${dlm}^c#${fontColor}^⚡ ${wattage}W^d^" printf '%s' "${wattage}" } getBrightness() { brightness="$(cat /sys/class/backlight/amdgpu_bl1/brightness)/255" - [ -n "${brightness}" ] && brightness="${dlm}^c#4321f1^🔆 ${brightness}^d^" + fontColor="$(getColor '4321f1')" + [ -n "${brightness}" ] && brightness="${dlm}^c#${fontColor}^🔆 ${brightness}^d^" printf '%s' "${brightness}" } getNumberOfTmuxSessions() { numberOfSessions="$(2>/dev/null tmux ls | wc -l)" - [ ! "${numberOfSessions}" = "0" ] && numberOfSessions="${dlm}^c#92ee791^ ${numberOfSessions}^d^" + fontColor="$(getColor '92ee79')" + [ ! "${numberOfSessions}" = "0" ] && numberOfSessions="${dlm}^c#${fontColor}1^ ${numberOfSessions}^d^" printf '%s' "${numberOfSessions}" } diff --git a/.tmux.conf b/.tmux.conf index 23b7f98..c37ae64 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -54,3 +54,7 @@ bind-key -r -T prefix C-k resize-pane -U 2 bind-key -r -T prefix C-l resize-pane -R 2 bind-key -T prefix C-u popup -E '~/.local/bin/tmux_urls.py' + +set-option -g set-titles on + +run-shell ~/repos/tmux-copycat/copycat.tmux