Compare commits
20
Commits
8533f6a3ab
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb08d5da26
|
||
|
|
c618c411a5
|
||
|
|
7a89dd6813
|
||
|
|
0bbebf1438
|
||
|
|
bf80b5054a
|
||
|
|
ef2bff1dd2
|
||
|
|
9d84415002
|
||
|
|
7a6130cb81
|
||
|
|
784f2d6ca3
|
||
|
|
b1adc518b9
|
||
|
|
49420ede7e
|
||
|
|
f5034cee38
|
||
|
|
6c408487f5
|
||
|
|
c32d635378
|
||
|
|
a8c9098959
|
||
|
|
48b42495b2
|
||
|
|
6a919b09e3 | ||
|
|
bb922a8ac1 | ||
|
|
daca5f4b90 | ||
|
|
06c3d86934 |
+12
@@ -1,3 +1,15 @@
|
|||||||
[submodule "neovim"]
|
[submodule "neovim"]
|
||||||
path = neovim
|
path = neovim
|
||||||
url = https://github.com/Legrems/nv-chad.git
|
url = https://github.com/Legrems/nv-chad.git
|
||||||
|
[submodule "scripts"]
|
||||||
|
path = scripts
|
||||||
|
url = ../scripts.git
|
||||||
|
[submodule "scripts-hidden"]
|
||||||
|
path = scripts-hidden
|
||||||
|
url = ../scripts-hidden.git
|
||||||
|
[submodule "neovim-config"]
|
||||||
|
path = neovim-config
|
||||||
|
url = ../neovim-config.git
|
||||||
|
[submodule "hyprland-config"]
|
||||||
|
path = hyprland-config
|
||||||
|
url = ../hyprland-config.git
|
||||||
|
|||||||
+1
-1
@@ -320,7 +320,7 @@ tiling_drag modifier titlebar
|
|||||||
## Syntax:
|
## Syntax:
|
||||||
#exec [--no-startup-id] <command>
|
#exec [--no-startup-id] <command>
|
||||||
#exec_always [--no-startup-id] <command>
|
#exec_always [--no-startup-id] <command>
|
||||||
exec_always --no-startup-id setxkbmap -option caps:swapescape
|
# exec_always --no-startup-id setxkbmap us
|
||||||
exec_always --no-startup-id ~/.screenlayout/default.sh
|
exec_always --no-startup-id ~/.screenlayout/default.sh
|
||||||
exec_always --no-startup-id ~/.config/i3/scripts/i3_autostart
|
exec_always --no-startup-id ~/.config/i3/scripts/i3_autostart
|
||||||
|
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ set $i3_gaps_smart off
|
|||||||
#~ Colors
|
#~ Colors
|
||||||
set $i3_cl_col_bg #1E2128
|
set $i3_cl_col_bg #1E2128
|
||||||
set $i3_cl_col_fg #ABB2BF
|
set $i3_cl_col_fg #ABB2BF
|
||||||
set $i3_cl_col_in #98C379
|
set $i3_cl_col_in #1786e8
|
||||||
set $i3_cl_col_afoc #5294E2
|
set $i3_cl_col_afoc #96cf6e
|
||||||
set $i3_cl_col_ifoc #62AEEF
|
set $i3_cl_col_ifoc #a2cff6
|
||||||
set $i3_cl_col_ufoc #292d37
|
set $i3_cl_col_ufoc #292d37
|
||||||
set $i3_cl_col_urgt #C778DD
|
set $i3_cl_col_urgt #C778DD
|
||||||
set $i3_cl_col_phol #1E2128
|
set $i3_cl_col_phol #1E2128
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ set $web_browser firefox
|
|||||||
|
|
||||||
## -- Terminal --
|
## -- Terminal --
|
||||||
bindsym $MOD+Return exec --no-startup-id $terminal
|
bindsym $MOD+Return exec --no-startup-id $terminal
|
||||||
bindsym $MOD+Shift+Return exec --no-startup-id $terminal --float
|
# bindsym $MOD+Shift+Return exec --no-startup-id "$terminal --float"
|
||||||
bindsym $MOD+$ALT+Return exec --no-startup-id $terminal --full
|
# bindsym $MOD+$ALT+Return exec --no-startup-id "$terminal --full"
|
||||||
|
|
||||||
## -- GUI Apps --
|
## -- GUI Apps --
|
||||||
bindsym $MOD+Shift+f exec --no-startup-id $file_manager
|
bindsym $MOD+Shift+f exec --no-startup-id $file_manager
|
||||||
@@ -47,10 +47,8 @@ bindsym $MOD+Shift+e exec --no-startup-id $text_editor
|
|||||||
bindsym $MOD+Shift+w exec --no-startup-id $web_browser
|
bindsym $MOD+Shift+w exec --no-startup-id $web_browser
|
||||||
|
|
||||||
## -- CLI Apps --
|
## -- CLI Apps --
|
||||||
bindsym $ALT+Control+v exec --no-startup-id "$alacritty -e vim"
|
bindsym $MOD+Shift+Return exec --no-startup-id "$terminal --float -e tmux new-session nvim"
|
||||||
bindsym $ALT+Control+r exec --no-startup-id "$alacritty -e ranger"
|
# bindsym $MOD+Control+h exec --no-startup-id "$terminal -e tmux new-session htop"
|
||||||
bindsym $ALT+Control+h exec --no-startup-id "$alacritty -e htop"
|
|
||||||
bindsym $ALT+Control+m exec --no-startup-id $music_player
|
|
||||||
|
|
||||||
## -- Rofi Applets --
|
## -- Rofi Applets --
|
||||||
bindsym $MOD+p exec --no-startup-id $rofi_applets/rofi_launcher -dpi 1
|
bindsym $MOD+p exec --no-startup-id $rofi_applets/rofi_launcher -dpi 1
|
||||||
@@ -137,10 +135,13 @@ bindsym $MOD+Left focus left
|
|||||||
bindsym $MOD+Down focus down
|
bindsym $MOD+Down focus down
|
||||||
bindsym $MOD+Up focus up
|
bindsym $MOD+Up focus up
|
||||||
bindsym $MOD+Right focus right
|
bindsym $MOD+Right focus right
|
||||||
|
|
||||||
|
bindsym $MOD+a focus left
|
||||||
|
bindsym $MOD+d focus right
|
||||||
## Sets focus to the parent container of the current container.
|
## Sets focus to the parent container of the current container.
|
||||||
bindsym $MOD+a focus parent
|
# bindsym $MOD+a focus parent
|
||||||
## The opposite of `focus parent`, sets the focus to the last focused child container.
|
## The opposite of `focus parent`, sets the focus to the last focused child container.
|
||||||
bindsym $MOD+d focus child
|
# bindsym $MOD+d focus child
|
||||||
## Automatically sets focus to the adjacent container.
|
## Automatically sets focus to the adjacent container.
|
||||||
bindsym $MOD+Tab focus next
|
bindsym $MOD+Tab focus next
|
||||||
## Toggles focus between floating/tiling containers.
|
## Toggles focus between floating/tiling containers.
|
||||||
|
|||||||
@@ -49,4 +49,4 @@ xsetroot -cursor_name left_ptr
|
|||||||
"$idir"/scripts/i3_comp
|
"$idir"/scripts/i3_comp
|
||||||
|
|
||||||
# Start mpd
|
# Start mpd
|
||||||
exec mpd &
|
# exec mpd &
|
||||||
|
|||||||
@@ -9,12 +9,14 @@ DIR="$HOME/.config/i3"
|
|||||||
CONFIG="$DIR/alacritty/alacritty.toml"
|
CONFIG="$DIR/alacritty/alacritty.toml"
|
||||||
|
|
||||||
if [ "$1" == "--float" ]; then
|
if [ "$1" == "--float" ]; then
|
||||||
alacritty --class 'alacritty-float,alacritty-float' --config-file "$CONFIG"
|
shift
|
||||||
|
alacritty --class 'alacritty-float,alacritty-float' --config-file "$CONFIG" $@
|
||||||
elif [ "$1" == "--full" ]; then
|
elif [ "$1" == "--full" ]; then
|
||||||
|
shift
|
||||||
alacritty --class 'Fullscreen,Fullscreen' --config-file "$CONFIG" \
|
alacritty --class 'Fullscreen,Fullscreen' --config-file "$CONFIG" \
|
||||||
-o window.startup_mode=fullscreen \
|
-o window.startup_mode=fullscreen \
|
||||||
window.padding.x=30 window.padding.y=30 \
|
window.padding.x=30 window.padding.y=30 \
|
||||||
window.opacity=0.95 font.size=14
|
window.opacity=0.95 font.size=14 $@
|
||||||
else
|
else
|
||||||
alacritty --config-file "$CONFIG"
|
alacritty --config-file "$CONFIG" $@
|
||||||
fi
|
fi
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
dir=/home/legrems/Documents/dotfiles # dotfiles directory
|
dir=/home/legrems/Documents/dotfiles # dotfiles directory
|
||||||
olddir=~/dotfiles_old # old dotfiles backup directory
|
olddir=~/dotfiles_old # old dotfiles backup directory
|
||||||
|
|
||||||
files="vim vimrc zsh zshrc tmux.conf zpreztorc gitconfig gitignore_global Xresources xprofile zprofile xinitrc" # list of files/folders to symlink in homedir
|
files="vim zsh zshrc tmux.conf zpreztorc gitconfig gitignore_global Xresources xprofile zprofile xinitrc" # list of files/folders to symlink in homedir
|
||||||
|
|
||||||
configdirs="i3 keepassxc nvim rofi trizen polybar"
|
configdirs="i3 keepassxc nvim rofi trizen polybar"
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
;signingkey = C6424C524F8B4D0B0C6F9380ACD9F65FA7E19986;USB-C
|
;signingkey = C6424C524F8B4D0B0C6F9380ACD9F65FA7E19986;USB-C
|
||||||
token = REPLACE HERE TOKEN
|
token = REPLACE HERE TOKEN
|
||||||
[commit]
|
[commit]
|
||||||
gpgSign = false
|
gpgSign = true
|
||||||
[gpg]
|
[gpg]
|
||||||
program = gpg2
|
program = gpg2
|
||||||
[tag]
|
[tag]
|
||||||
@@ -37,3 +37,5 @@
|
|||||||
utmostDiscretion = 1
|
utmostDiscretion = 1
|
||||||
[branch]
|
[branch]
|
||||||
sort = -committerdate
|
sort = -committerdate
|
||||||
|
[submodule]
|
||||||
|
recurse = true
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
.autoenv_leave.zsh
|
.autoenv_leave.zsh
|
||||||
tags
|
tags
|
||||||
Session.vim
|
Session.vim
|
||||||
|
.exrc
|
||||||
*.rest
|
*.rest
|
||||||
cert.crt
|
cert.crt
|
||||||
cert.key
|
cert.key
|
||||||
@@ -22,3 +23,16 @@ returner-consumer-stderr.log
|
|||||||
returner-consumer-stdout.log
|
returner-consumer-stdout.log
|
||||||
|
|
||||||
celery-exporter
|
celery-exporter
|
||||||
|
|
||||||
|
.gitlab.nvim
|
||||||
|
.prettierrc
|
||||||
|
|
||||||
|
*.sqlite3
|
||||||
|
|
||||||
|
pyrightconfig.json
|
||||||
|
|
||||||
|
arcanite_gestion/lib/
|
||||||
|
dependencies.html
|
||||||
|
|
||||||
|
shadow_script.py
|
||||||
|
flower_db*
|
||||||
|
|||||||
Submodule
+1
Submodule hyprland-config added at 3d9ba69c56
+22
-15
@@ -1,28 +1,35 @@
|
|||||||
|
# Trizen
|
||||||
|
cd ~
|
||||||
|
|
||||||
|
git clone https://aur.archlinux.org/trizen.git
|
||||||
|
cd trizen
|
||||||
|
makepkg -si
|
||||||
|
|
||||||
# Generic
|
# Generic
|
||||||
sudo apt install zsh neovim silversearcher-ag fzf nnn vifm thefuck ripgrep
|
trizen -S neovim zsh fzf nnn vifm thefuck ripgrep zoxide cargo locate
|
||||||
|
|
||||||
# SSH Key
|
# SSH Key
|
||||||
ssh-keygen -t ed25519 -C "flamelegrems@gmail.com"
|
ssh-keygen -t ed25519 -C "flamelegrems@gmail.com"
|
||||||
|
|
||||||
# DotFiles
|
|
||||||
git clone git@github.com:Legrems/dotfiles.git ~/Documents/dotfiles
|
|
||||||
mkdir .config/nvim
|
|
||||||
~/Documents/dotfiles/create_symlinks.sh
|
|
||||||
ln -s /home/legrems/Documents/dotfiles/vim/colors /home/legrems/.config/nvim/colors
|
|
||||||
ln -s /home/legrems/.vimrc /home/legrems/.config/nvim/init.vim
|
|
||||||
|
|
||||||
# Zprezto
|
# Zprezto
|
||||||
git clone --recursive git@github.com:Legrems/zpresto.git ~/.zprezto
|
git clone --recursive git@github.com:Legrems/zpresto.git ~/.zprezto
|
||||||
|
|
||||||
chsh -s /bin/zsh
|
chsh -s /bin/zsh
|
||||||
|
|
||||||
|
# DotFiles
|
||||||
|
git clone git@github.com:Legrems/dotfiles.git ~/Documents/dotfiles --recurse-submodules
|
||||||
|
mkdir .config/nvim
|
||||||
|
~/Documents/dotfiles/create_symlinks.sh
|
||||||
|
|
||||||
|
ln -s /home/legrems/Documents/dotfiles/neovim /home/legrems/.config/nvim
|
||||||
|
ln -s /home/legrems/Documents/dotfiles/prompt_sorin_setup /home/legrems/.zprezto/modules/prompt/functions/
|
||||||
|
|
||||||
|
# Cdwe
|
||||||
|
cargo install cdwe
|
||||||
|
cdwe init zsh
|
||||||
|
|
||||||
|
source <(fzf --zsh)
|
||||||
|
|
||||||
# MiniConda
|
# MiniConda
|
||||||
wget -O miniconda-latest-install.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
|
wget -O miniconda-latest-install.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
|
||||||
# wget -O miniconda-latest-install.sh https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-pyp3-Linux-aarch64.sh
|
# wget -O miniconda-latest-install.sh https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-pyp3-Linux-aarch64.sh
|
||||||
bash miniconda-latest-install.sh
|
bash miniconda-latest-install.sh
|
||||||
|
|
||||||
# MiniForge for Rpi
|
|
||||||
wget -O
|
|
||||||
|
|
||||||
# AutoEnv
|
|
||||||
git clone git://github.com/inishchith/autoenv.git ~/.autoenv
|
|
||||||
|
|||||||
+2
-1
@@ -5,7 +5,7 @@ import json
|
|||||||
def i3_command(command, *args, **kwargs):
|
def i3_command(command, *args, **kwargs):
|
||||||
try:
|
try:
|
||||||
return json.loads(sh.i3_msg(command, *args, **kwargs).stdout)
|
return json.loads(sh.i3_msg(command, *args, **kwargs).stdout)
|
||||||
except:
|
except Exception:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@@ -18,5 +18,6 @@ def get_output():
|
|||||||
def test():
|
def test():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
print(get_workspaces())
|
print(get_workspaces())
|
||||||
print(get_output())
|
print(get_output())
|
||||||
|
|||||||
+1
-1
Submodule neovim updated: 19c17b583b...822b092d15
Submodule
+1
Submodule neovim-config added at 3d9677192a
Submodule
+1
Submodule scripts added at 36bd56bcc4
Submodule
+1
Submodule scripts-hidden added at 92ba9d1c4b
File diff suppressed because it is too large
Load Diff
-3743
File diff suppressed because it is too large
Load Diff
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
selected=`cat ~/.tmux-cht-languages ~/.tmux-cht-command | fzf`
|
|
||||||
if [[ -z $selected ]]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
read -p "Enter Query: " query
|
|
||||||
|
|
||||||
if grep -qs "$selected" ~/.tmux-cht-languages; then
|
|
||||||
query=`echo $query | tr ' ' '+'`
|
|
||||||
tmux neww bash -c "echo \"curl cht.sh/$selected/$query/\" & curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done"
|
|
||||||
else
|
|
||||||
tmux neww bash -c "curl -s cht.sh/$selected~$query | less"
|
|
||||||
fi
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# ssh-multi
|
|
||||||
# D.Kovalov
|
|
||||||
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
|
|
||||||
|
|
||||||
# a script to ssh multiple servers over multiple tmux panes
|
|
||||||
|
|
||||||
|
|
||||||
starttmux() {
|
|
||||||
if [ -z "$HOSTS" ]; then
|
|
||||||
echo -n "Please provide of list of hosts separated by spaces [ENTER]: "
|
|
||||||
read HOSTS
|
|
||||||
fi
|
|
||||||
|
|
||||||
local hosts=( $HOSTS )
|
|
||||||
local target="ssh-multi ${host[0]}"
|
|
||||||
|
|
||||||
tmux new-window -n "${target}" ssh ${hosts[0]}
|
|
||||||
unset hosts[0];
|
|
||||||
for i in "${hosts[@]}"; do
|
|
||||||
tmux split-window -t :"${target}" -h "ssh $i"
|
|
||||||
tmux select-layout -t :"${target}" tiled > /dev/null
|
|
||||||
done
|
|
||||||
tmux select-pane -t 0
|
|
||||||
tmux set-window-option -t :"${target}" synchronize-panes on > /dev/null
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
HOSTS=${HOSTS:=$*}
|
|
||||||
|
|
||||||
starttmux
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
if [[ $# -eq 1 ]]; then
|
|
||||||
selected=$1
|
|
||||||
else
|
|
||||||
selected=$(find ~/Documents/Arcanite/ ~/Documents/PolyLAN/ ~/Documents/Python ~/Documents/ -mindepth 1 -maxdepth 1 -type d | fzf)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $selected ]]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
selected_name=$(basename "$selected" | tr . _)
|
|
||||||
tmux_running=$(pgrep tmux)
|
|
||||||
|
|
||||||
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
|
|
||||||
tmux new-session -s $selected_name -c $selected
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! tmux has-session -t=$selected_name 2> /dev/null; then
|
|
||||||
tmux new-session -ds $selected_name -c $selected
|
|
||||||
fi
|
|
||||||
|
|
||||||
tmux switch-client -t $selected_name
|
|
||||||
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
import configparser
|
|
||||||
import sys
|
|
||||||
import time
|
|
||||||
import libtmux
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from pyfzf.pyfzf import FzfPrompt
|
|
||||||
|
|
||||||
|
|
||||||
config = configparser.ConfigParser()
|
|
||||||
config_path = Path("~/.ssh-tmux-multi.ini").expanduser()
|
|
||||||
config.read(config_path)
|
|
||||||
|
|
||||||
fav_key = "Favourite servers"
|
|
||||||
|
|
||||||
fzf = FzfPrompt()
|
|
||||||
|
|
||||||
|
|
||||||
def get_all_known_ssh_hosts():
|
|
||||||
servers = set()
|
|
||||||
|
|
||||||
# Check known hosts on ssh folder
|
|
||||||
with open(Path("~/.ssh/known_hosts").expanduser(), "r") as file:
|
|
||||||
lines = file.read().strip().split("\n")
|
|
||||||
|
|
||||||
for line in lines:
|
|
||||||
servers.add(line.split(" ")[0])
|
|
||||||
|
|
||||||
# Check previous ssh command on histfile
|
|
||||||
with open(Path("~/.histfile").expanduser(), "r", encoding="utf-8", errors="ignore") as file:
|
|
||||||
lines = file.read().strip().split("\n")
|
|
||||||
|
|
||||||
for line in lines:
|
|
||||||
if line[15:].startswith("ssh "):
|
|
||||||
server = line[19:].strip()
|
|
||||||
if server:
|
|
||||||
servers.add(server)
|
|
||||||
|
|
||||||
return sorted(list(servers), reverse=True)
|
|
||||||
|
|
||||||
|
|
||||||
def get_favourite_servers_first():
|
|
||||||
servers = get_all_known_ssh_hosts()
|
|
||||||
|
|
||||||
if fav_key not in config.sections():
|
|
||||||
return servers
|
|
||||||
|
|
||||||
order = {}
|
|
||||||
for server in servers:
|
|
||||||
order[server] = '0'
|
|
||||||
|
|
||||||
for server, uses in config[fav_key].items():
|
|
||||||
if server in order:
|
|
||||||
order[server] = uses
|
|
||||||
|
|
||||||
# Return the most used servers first
|
|
||||||
return [x[0] for x in sorted(order.items(), key=lambda x: int(x[1]), reverse=True)]
|
|
||||||
|
|
||||||
|
|
||||||
def write_choosen_servers(servers):
|
|
||||||
"""Write the servers usage in the config file."""
|
|
||||||
|
|
||||||
if fav_key not in config.sections():
|
|
||||||
config[fav_key] = {}
|
|
||||||
|
|
||||||
for server in servers:
|
|
||||||
if server in config[fav_key]:
|
|
||||||
config[fav_key][server] = str(int(config[fav_key][server]) + 1)
|
|
||||||
|
|
||||||
else:
|
|
||||||
config[fav_key][server] = '1'
|
|
||||||
|
|
||||||
with open(config_path, "w") as file:
|
|
||||||
config.write(file)
|
|
||||||
|
|
||||||
servers = fzf.prompt(get_favourite_servers_first(), "--cycle --multi --print-query")
|
|
||||||
|
|
||||||
# Strip from query if found else, use the query
|
|
||||||
if len(servers) > 1:
|
|
||||||
servers = servers[1:]
|
|
||||||
|
|
||||||
if not servers:
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
write_choosen_servers(servers)
|
|
||||||
|
|
||||||
srv = libtmux.Server()
|
|
||||||
active_session = srv.sessions.filter(session_attached='1')[0]
|
|
||||||
window = active_session.new_window(f"ssh-multis {','.join(servers)}", window_shell=f"ssh {servers[0]}")
|
|
||||||
|
|
||||||
for server in servers[1:]:
|
|
||||||
window.select_layout("tiled")
|
|
||||||
pane = window.split(shell=f"ssh {server}")
|
|
||||||
|
|
||||||
# Wait until tmux finished working
|
|
||||||
time.sleep(0.1)
|
|
||||||
|
|
||||||
# Confirm connection on asking panes
|
|
||||||
confirmation_needed_text = "Are you sure you want to continue connecting (yes/no/[fingerprint])?"
|
|
||||||
for pane in window.panes:
|
|
||||||
pane_content = pane.capture_pane()
|
|
||||||
if pane_content and confirmation_needed_text == pane_content[-1]:
|
|
||||||
pane.send_keys("yes")
|
|
||||||
|
|
||||||
window.set_window_option("synchronize-panes", "on")
|
|
||||||
pane = window.panes[0]
|
|
||||||
pane.send_keys("sudo su -")
|
|
||||||
window.set_window_option("synchronize-panes", "off")
|
|
||||||
|
|
||||||
window.select()
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
import libtmux
|
|
||||||
import configparser
|
|
||||||
import time
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from pyfzf.pyfzf import FzfPrompt
|
|
||||||
|
|
||||||
|
|
||||||
BASE_PATH = Path("~/.ssh-tmux/").expanduser()
|
|
||||||
|
|
||||||
configs = {}
|
|
||||||
sections = {}
|
|
||||||
for subconffile in os.listdir(BASE_PATH):
|
|
||||||
config = configparser.ConfigParser()
|
|
||||||
config.read(BASE_PATH / subconffile)
|
|
||||||
|
|
||||||
configs[subconffile] = config
|
|
||||||
|
|
||||||
for section in config.sections():
|
|
||||||
sections[section] = subconffile
|
|
||||||
|
|
||||||
|
|
||||||
fzf = FzfPrompt()
|
|
||||||
selected_group = fzf.prompt(sections.keys(), "--cycle")[0]
|
|
||||||
|
|
||||||
config = configs[sections[selected_group]]
|
|
||||||
|
|
||||||
servers = config[selected_group]["servers"].split("\n")
|
|
||||||
|
|
||||||
extra_commands = []
|
|
||||||
if "commands" in config[selected_group].keys():
|
|
||||||
extra_commands = config[selected_group]["commands"].split("\n")
|
|
||||||
|
|
||||||
if not servers:
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
srv = libtmux.Server()
|
|
||||||
active_sessions = srv.sessions.filter(session_attached='1')
|
|
||||||
|
|
||||||
if active_sessions:
|
|
||||||
active_session = active_sessions[0]
|
|
||||||
|
|
||||||
else:
|
|
||||||
raw_try = srv.cmd("display", "-p", "#{session_name}").stdout
|
|
||||||
if raw_try:
|
|
||||||
active_session = srv.sessions.filter(name=raw_try[0])[0]
|
|
||||||
|
|
||||||
else:
|
|
||||||
active_session = srv.sessions[0]
|
|
||||||
|
|
||||||
window = active_session.new_window(f"ssh-multig {','.join(servers)}", window_shell=f"ssh {servers[0]}")
|
|
||||||
|
|
||||||
for server in servers[1:]:
|
|
||||||
window.select_layout("tiled")
|
|
||||||
pane = window.split(shell=f"ssh {server}")
|
|
||||||
|
|
||||||
# Wait until tmux finished working
|
|
||||||
time.sleep(0.1)
|
|
||||||
|
|
||||||
# Confirm connection on asking panes
|
|
||||||
confirmation_needed_text = "Are you sure you want to continue connecting (yes/no/[fingerprint])?"
|
|
||||||
for pane in window.panes:
|
|
||||||
pane_content = pane.capture_pane()
|
|
||||||
if pane_content and confirmation_needed_text == pane_content[-1]:
|
|
||||||
pane.send_keys("yes")
|
|
||||||
|
|
||||||
window.set_window_option("synchronize-panes", "on")
|
|
||||||
pane = window.panes[0]
|
|
||||||
pane.send_keys("sudo su -")
|
|
||||||
|
|
||||||
for command in extra_commands:
|
|
||||||
pane.send_keys(command)
|
|
||||||
|
|
||||||
window.set_window_option("synchronize-panes", "off")
|
|
||||||
|
|
||||||
window.select()
|
|
||||||
srv.cmd("select-layout", "tiled")
|
|
||||||
@@ -6,9 +6,9 @@ bind-key C-a send-prefix
|
|||||||
# split panes
|
# split panes
|
||||||
bind | split-window -h -c "#{pane_current_path}"
|
bind | split-window -h -c "#{pane_current_path}"
|
||||||
bind - split-window -v -c "#{pane_current_path}"
|
bind - split-window -v -c "#{pane_current_path}"
|
||||||
bind s split-window -h -p 20 -c "#{pane_current_path}"
|
# bind s split-window -h -p 20 -c "#{pane_current_path}"
|
||||||
bind g split-window -h -p 20 -c "#{pane_current_path}" -b
|
# bind g split-window -h -p 20 -c "#{pane_current_path}" -b
|
||||||
bind v split-window -v -p 30 -c "#{pane_current_path}"
|
# bind v split-window -v -p 30 -c "#{pane_current_path}"
|
||||||
|
|
||||||
# Switch to last sesions, usefull for cross-project (since i'm using a session per project, with tmux-sessionizer script)
|
# Switch to last sesions, usefull for cross-project (since i'm using a session per project, with tmux-sessionizer script)
|
||||||
bind k switch-client -l
|
bind k switch-client -l
|
||||||
@@ -20,27 +20,29 @@ bind -n M-s select-pane -D
|
|||||||
bind -n M-d select-pane -R
|
bind -n M-d select-pane -R
|
||||||
|
|
||||||
# reload conf
|
# reload conf
|
||||||
bind r source-file ~/.tmux.conf
|
bind r source-file ~/.tmux.conf; display-message "Tmux source file reloaded!"
|
||||||
|
|
||||||
|
# VI mode for keys, not sure i'm using this
|
||||||
set-window-option -g mode-keys vi
|
set-window-option -g mode-keys vi
|
||||||
bind -T copy-mode-vi v send-keys -X begin-selection
|
bind -T copy-mode-vi v send-keys -X begin-selection
|
||||||
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
|
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
|
||||||
|
|
||||||
|
# Color terminal, it's probably the default
|
||||||
set -g default-terminal "tmux-256color"
|
set -g default-terminal "tmux-256color"
|
||||||
set -ag terminal-overrides ",*:RGB"
|
set -ag terminal-overrides ",*:RGB"
|
||||||
|
|
||||||
# change color
|
# Change color if the panes are synchronized (since it can be deadly)
|
||||||
#set -g pane-border-style 'fg=#660033'
|
set -g pane-border-style '#{?pane_synchronized, fg=yellow, fg=black}'
|
||||||
#set -g pane-active-border-style 'fg=#990033 bg=default'
|
set -g pane-active-border-style '#{?pane_synchronized, fg=red, fg=#52862d}'
|
||||||
set -g pane-border-style 'fg=#000055'
|
|
||||||
set -g pane-active-border-style 'fg=#6a00aa'
|
|
||||||
|
|
||||||
|
|
||||||
# status bar
|
# Status bar
|
||||||
set -g status-position top
|
set -g status-position top
|
||||||
set -g status-justify left
|
set -g status-justify centre
|
||||||
#set -g status-style 'fg=#660033 bg=#202020'
|
# Change color if the panes are synchronized (since it can be deadly)
|
||||||
set -g status-style 'fg=#a000ff bg=#202020'
|
set -g status-style 'fg=#ffffff #{?pane_synchronized, bg=red, bg=default}'
|
||||||
|
set -g status-left "[#{session_name}] "
|
||||||
|
set -g status-left-length 60
|
||||||
|
|
||||||
# native xterm scrolling
|
# native xterm scrolling
|
||||||
set -g mouse on
|
set -g mouse on
|
||||||
@@ -56,6 +58,7 @@ set -g @resurrect-strategy-nvim 'session'
|
|||||||
set -g @resurrect-processes 'ssh vim nvim django-run "~manage.py"'
|
set -g @resurrect-processes 'ssh vim nvim django-run "~manage.py"'
|
||||||
|
|
||||||
set -g @plugin 'tmux-plugins/tmux-yank'
|
set -g @plugin 'tmux-plugins/tmux-yank'
|
||||||
|
set -g @yank_selection_mouse 'clipboard'
|
||||||
|
|
||||||
run -b '~/.tmux/plugins/tpm/tpm'
|
run -b '~/.tmux/plugins/tpm/tpm'
|
||||||
# run-shell ~/tmux-resurrect/resurrect.tmux
|
# run-shell ~/tmux-resurrect/resurrect.tmux
|
||||||
@@ -63,8 +66,10 @@ run -b '~/.tmux/plugins/tpm/tpm'
|
|||||||
set -s escape-time 0
|
set -s escape-time 0
|
||||||
set-option -g default-terminal "screen-256color"
|
set-option -g default-terminal "screen-256color"
|
||||||
|
|
||||||
bind-key -r f run-shell "tmux neww ~/Documents/dotfiles/scripts/tmux-sessionizer"
|
bind f run-shell "tmux neww /home/legrems/miniconda3/bin/python ~/Documents/dotfiles/scripts/tmux_sessionizer.py"
|
||||||
bind-key -r m run-shell "tmux neww ~/Documents/dotfiles/scripts/tmux-multi-ssh"
|
bind g run-shell "tmux neww /home/legrems/miniconda3/bin/python ~/Documents/dotfiles/scripts/tmux_select_session.py"
|
||||||
bind-key -r m run-shell "tmux neww /home/legrems/miniconda3/bin/python ~/Documents/dotfiles/scripts/tmux_ssh_group.py"
|
bind h run-shell "tmux neww /home/legrems/miniconda3/bin/python ~/Documents/dotfiles/scripts/tmux_select_pane.py"
|
||||||
bind-key -r j run-shell "tmux neww /home/legrems/miniconda3/bin/python ~/Documents/dotfiles/scripts/tmux_multi_ssh.py"
|
bind m run-shell "tmux neww /home/legrems/miniconda3/bin/python ~/Documents/dotfiles/scripts/tmux_ssh_group.py"
|
||||||
bind-key -r i set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized, #[bg=red]!! ON !!,OFF}"
|
bind j run-shell "tmux neww /home/legrems/miniconda3/bin/python ~/Documents/dotfiles/scripts/tmux_multi_ssh.py"
|
||||||
|
bind i set-window-option synchronize-panes\;
|
||||||
|
# bind i set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized, #[bg=red]!! ON !!,OFF}"
|
||||||
|
|||||||
+3
-2
@@ -3,6 +3,7 @@ alias la='ls -A'
|
|||||||
alias l='ls -CF'
|
alias l='ls -CF'
|
||||||
alias lla='ls -al'
|
alias lla='ls -al'
|
||||||
alias mux='tmuxinator'
|
alias mux='tmuxinator'
|
||||||
|
alias i="ipython"
|
||||||
|
|
||||||
alias pm='python manage.py'
|
alias pm='python manage.py'
|
||||||
alias pmt='clear && pm test'
|
alias pmt='clear && pm test'
|
||||||
@@ -37,8 +38,8 @@ f() { find . -name "*$1*"; }
|
|||||||
tar-create() {tar cfv $@}
|
tar-create() {tar cfv $@}
|
||||||
tar-list() {tar -tvf $@}
|
tar-list() {tar -tvf $@}
|
||||||
tar-extract() {tar xfv $@}
|
tar-extract() {tar xfv $@}
|
||||||
us-layout() {setxkbmap us -option caps:swapescape }
|
us-layout() {setxkbmap us }
|
||||||
usint-layout() {setxkbmap us -variant intl -option caps:swapescape }
|
usint-layout() {setxkbmap us -variant intl }
|
||||||
|
|
||||||
make_venv() {
|
make_venv() {
|
||||||
echo $(basename $(pwd) | awk '{print "conda activate "$1}') > $(pwd | awk '{print $1"/.autoenv.zsh"}')
|
echo $(basename $(pwd) | awk '{print "conda activate "$1}') > $(pwd | awk '{print $1"/.autoenv.zsh"}')
|
||||||
|
|||||||
+4
-4
@@ -36,9 +36,9 @@ export NB_PROXMOXS=2
|
|||||||
export VAGRANT_ABACUS_BOX="ubuntu/focal64"
|
export VAGRANT_ABACUS_BOX="ubuntu/focal64"
|
||||||
export VISUAL=nvim
|
export VISUAL=nvim
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
export AUTOENV_ENV_FILENAME='.autoenv.zsh'
|
#export AUTOENV_ENV_FILENAME='.autoenv.zsh'
|
||||||
export AUTOENV_ENV_LEAVE_FILENAME='.autoenv_leave.zsh'
|
#export AUTOENV_ENV_LEAVE_FILENAME='.autoenv_leave.zsh'
|
||||||
export AUTOENV_ENABLE_LEAVE='yes'
|
#export AUTOENV_ENABLE_LEAVE='yes'
|
||||||
#export PS1='${SSH_TTY:+"%F{9}%n%f%F{7}@%f%F{3}%m%F "}%F{4}${_prompt_sorin_pwd}%(!. %B%F{1}#%f%b.)${editor_info[keymap]} '
|
#export PS1='${SSH_TTY:+"%F{9}%n%f%F{7}@%f%F{3}%m%F "}%F{4}${_prompt_sorin_pwd}%(!. %B%F{1}#%f%b.)${editor_info[keymap]} '
|
||||||
# export PS1='%F{4}${_prompt_sorin_pwd}%(!. %B%F{1}#%f%b.)${editor_info[keymap]} '
|
# export PS1='%F{4}${_prompt_sorin_pwd}%(!. %B%F{1}#%f%b.)${editor_info[keymap]} '
|
||||||
|
|
||||||
@@ -49,4 +49,4 @@ export AUTOENV_ENABLE_LEAVE='yes'
|
|||||||
|
|
||||||
eval $(thefuck --alias)
|
eval $(thefuck --alias)
|
||||||
|
|
||||||
source ~/.autoenv/activate.sh
|
#source ~/.autoenv/activate.sh
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
bindkey "^k" up-line-or-history
|
||||||
|
bindkey "^j" up-line-or-history
|
||||||
|
|||||||
@@ -22,3 +22,7 @@ eval "$(zoxide init zsh | sed -e 's/\\builtin cd/cdwe/g')"
|
|||||||
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
|
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
|
||||||
export PATH="$PATH:$HOME/.rvm/bin"
|
export PATH="$PATH:$HOME/.rvm/bin"
|
||||||
export KEYTIMEOUT=1
|
export KEYTIMEOUT=1
|
||||||
|
|
||||||
|
fpath+=~/.zfunc; autoload -Uz compinit; compinit
|
||||||
|
|
||||||
|
zstyle ':completion:*' menu select
|
||||||
|
|||||||
Reference in New Issue
Block a user