Compare commits

...

22 Commits

Author SHA1 Message Date
94c64e0609
Update bindings + keepass stuffs 2024-10-23 21:46:15 +02:00
e630d6b85a
Merge branch 'master' into archtuf 2024-08-15 23:44:01 +02:00
b30e8135ef
Update 15.08.2024 2024-08-15 23:39:49 +02:00
9d84415002
Add new neovim config submodules 2024-08-15 16:13:54 +02:00
7a6130cb81
Update 15.08.2024 2024-08-15 16:12:35 +02:00
784f2d6ca3
Update prompt sorin 2024-06-19 18:14:17 +02:00
b1adc518b9
Update install script 2024-06-19 18:12:48 +02:00
49420ede7e
Update scripts + gitignore global 2024-06-13 22:32:21 +02:00
f5034cee38
Add tmux-pane-selection scripts + add keybinds (leader + h) 2024-06-10 16:47:21 +02:00
6c408487f5
Add tmux session select shortcuts + scripts 2024-06-09 03:15:02 +02:00
cd1bd8041e
Update scripts to master, remove old autoenv, use 540 yubi 2024-05-28 01:13:49 +02:00
c11b3f806a Merge branch 'master' into archtuf 2024-05-28 01:10:32 +02:00
c32d635378
Update scripts to master 2024-05-28 01:10:02 +02:00
303b96997f Add scripts submodule 2024-05-28 01:08:37 +02:00
8a8f8eba14 Remove scripts folder 2024-05-28 01:08:03 +02:00
9bda4605f9 Update neovim to master 2024-05-28 00:35:52 +02:00
a8c9098959
Remove usage of swapescape for keyboard, gpgsign + gitignore global more things 2024-05-23 13:55:57 +02:00
48b42495b2
Update neovim + script subfolder 2024-05-23 13:55:22 +02:00
6a919b09e3 Update tmux.conf to match new tmux-sessionizer 2024-04-11 13:50:44 +02:00
bb922a8ac1 Add scripts submodule 2024-04-10 18:59:58 +02:00
daca5f4b90 Remove scrits from this repo 2024-04-10 18:56:53 +02:00
06c3d86934 Remove unused scripts 2024-04-10 18:26:15 +02:00
28 changed files with 104 additions and 13302 deletions

9
.gitmodules vendored
View File

@ -1,3 +1,12 @@
[submodule "neovim"]
path = neovim
url = https://github.com/Legrems/nv-chad.git
[submodule "scripts"]
path = scripts
url = git@github.com:Legrems/scripts.git
[submodule "scripts-hidden"]
path = scripts-hidden
url = git@github.com:Legrems/scripts-hidden.git
[submodule "neovim-config"]
path = neovim-config
url = git@github.com:Legrems/neovim-config.git

View File

@ -320,7 +320,7 @@ tiling_drag modifier titlebar
## Syntax:
#exec [--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 ~/.config/i3/scripts/i3_autostart

View File

@ -137,10 +137,13 @@ bindsym $MOD+Left focus left
bindsym $MOD+Down focus down
bindsym $MOD+Up focus up
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.
bindsym $MOD+a focus parent
# bindsym $MOD+a focus parent
## 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.
bindsym $MOD+Tab focus next
## Toggles focus between floating/tiling containers.

View File

@ -4,9 +4,12 @@
##-- Workspace Rules ------------------------
workspace 1 output HDMI-A-0
workspace 2 output HDMI-A-0
workspace 1 output DisplayPort-2
workspace 2 output DisplayPort-2
workspace 3 output DisplayPort-0
workspace 4 output DisplayPort-0
workspace 9 output HDMI-A-0
workspace 10 output HDMI-A-0
# workspace 1 output DisplayPort-0
# workspace 2 output DisplayPort-0
@ -50,8 +53,21 @@ workspace 3 output DisplayPort-0
## The first part of the WM_CLASS is the instance ("irssi" in this example),
## the second part is the class ("URxvt" in this example).
##
assign [class="Lxappearance|Nitrogen"] 6
assign [class="Pavucontrol|Xfce4-power-manager-settings"] 6
# assign [class="Lxappearance|Nitrogen"] 6
# assign [class="Pavucontrol|Xfce4-power-manager-settings"] 6
# Top-Left
assign [class="steam"] 3
assign [class="spotify"] 4
# Top-Right
assign [class="discord"] 9
assign [class="telegram-desktop|easyeffects"] 10
# Middle
# assign [class="discord"] 9
# Scratchpad
assign [class="keepassxc"] scratchpad
##-- Window Rules ---------------------------
@ -72,3 +88,4 @@ for_window [class="Pavucontrol|Xfce4-power-manager-settings|Nm-connection-editor
for_window [class="feh|Viewnior|Gpicview|Gimp|MPlayer"] floating enable
for_window [class="Kvantum Manager|qt5ct"] floating enable
for_window [class="VirtualBox Manager|qemu|Qemu-system-x86_64"] floating enable
for_window [class="Keepassxc"] floating enable

View File

@ -49,4 +49,13 @@ xsetroot -cursor_name left_ptr
"$idir"/scripts/i3_comp
# Start mpd
exec mpd &
# exec mpd &
nm-applet &
keepassxc &
easyeffects &
discord &
# spotify &
flameshot &
# telegram-desktop &
# firefox &

View File

@ -82,7 +82,7 @@ run_cmd() {
elif [[ "$1" == '--opt2' ]]; then
confirm_run 'i3-msg exit'
elif [[ "$1" == '--opt3' ]]; then
confirm_run 'mpc -q pause' 'pulsemixer --mute' 'betterlockscreen --suspend'
confirm_run 'pulsemixer --mute' 'betterlockscreen --suspend'
elif [[ "$1" == '--opt4' ]]; then
confirm_run 'systemctl hibernate'
elif [[ "$1" == '--opt5' ]]; then

View File

@ -14,8 +14,9 @@ TrayIconAppearance=monochrome-light
[PasswordGenerator]
AdditionalChars=
EASCII=false
ExcludedChars=
Length=32
Length=64
[SSHAgent]
Enabled=false

View File

@ -10,7 +10,7 @@
dir=/home/legrems/Documents/dotfiles # dotfiles 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"

View File

@ -1,13 +1,13 @@
[user]
email = loic.gremaud@arcanite.ch
name = Loïc Gremaud
;signingkey = 8B2741BF148B1059065A71EEE81E8B180465D116 ;540
signingkey = BAE2CD06F0A3753A0F8D0A21D4620E6DF3E0121D ;539
signingkey = 8B2741BF148B1059065A71EEE81E8B180465D116 ;540
;signingkey = BAE2CD06F0A3753A0F8D0A21D4620E6DF3E0121D ;539
;signingkey = 4F78275C96E34F56920CF7B5CACB2A128E557EFD ;W
;signingkey = C6424C524F8B4D0B0C6F9380ACD9F65FA7E19986;USB-C
token = REPLACE HERE TOKEN
[commit]
gpgSign = false
gpgSign = true
[gpg]
program = gpg2
[tag]
@ -37,3 +37,5 @@
utmostDiscretion = 1
[branch]
sort = -committerdate
[submodule]
recurse = true

View File

@ -22,3 +22,14 @@ returner-consumer-stderr.log
returner-consumer-stdout.log
celery-exporter
.gitlab.nvim
.prettierrc
*.sqlite3
arcanite_gestion/lib/
dependencies.html
shadow_script.py
flower_db*

View File

@ -1,28 +1,35 @@
# Trizen
cd ~
git clone https://aur.archlinux.org/trizen.git
cd trizen
makepkg -si
# 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-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
git clone --recursive git@github.com:Legrems/zpresto.git ~/.zprezto
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
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
bash miniconda-latest-install.sh
# MiniForge for Rpi
wget -O
# AutoEnv
git clone git://github.com/inishchith/autoenv.git ~/.autoenv

View File

@ -5,7 +5,7 @@ import json
def i3_command(command, *args, **kwargs):
try:
return json.loads(sh.i3_msg(command, *args, **kwargs).stdout)
except:
except Exception:
return []
@ -18,5 +18,6 @@ def get_output():
def test():
pass
if __name__ == "__main__":
print(get_workspaces())
print(get_output())

2
neovim

@ -1 +1 @@
Subproject commit 19c17b583bf23b637cbd89d8fa19165dfc2780b1
Subproject commit 3f08c78c134c6c577b64d6b4161999ff459bd394

1
neovim-config Submodule

@ -0,0 +1 @@
Subproject commit 258b42a1d5d77cf3dc7242af161ebb763e3d6372

1
scripts Submodule

@ -0,0 +1 @@
Subproject commit 5c5d2c4927d207ea31ed88fd54e2b873350c06f2

1
scripts-hidden Submodule

@ -0,0 +1 @@
Subproject commit 92ba9d1c4b5d8eee6c747db119fa60b40fc2b64f

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -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")

View File

@ -63,8 +63,9 @@ run -b '~/.tmux/plugins/tpm/tpm'
set -s escape-time 0
set-option -g default-terminal "screen-256color"
bind-key -r f run-shell "tmux neww ~/Documents/dotfiles/scripts/tmux-sessionizer"
bind-key -r m run-shell "tmux neww ~/Documents/dotfiles/scripts/tmux-multi-ssh"
bind-key -r f run-shell "tmux neww /home/legrems/miniconda3/bin/python ~/Documents/dotfiles/scripts/tmux_sessionizer.py"
bind-key -r g run-shell "tmux neww /home/legrems/miniconda3/bin/python ~/Documents/dotfiles/scripts/tmux_select_session.py"
bind-key -r h run-shell "tmux neww /home/legrems/miniconda3/bin/python ~/Documents/dotfiles/scripts/tmux_select_pane.py"
bind-key -r m run-shell "tmux neww /home/legrems/miniconda3/bin/python ~/Documents/dotfiles/scripts/tmux_ssh_group.py"
bind-key -r j run-shell "tmux neww /home/legrems/miniconda3/bin/python ~/Documents/dotfiles/scripts/tmux_multi_ssh.py"
bind-key -r i set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized, #[bg=red]!! ON !!,OFF}"

View File

@ -47,10 +47,11 @@ xrandr --output eDP1 --mode 2560x1440 --scale 1x1 --primary
xinput --set-prop "pointer:Razer Razer DeathAdder V2" 'libinput Accel Speed' -0.1
# Swap caps + escape
setxkbmap -option caps:swapescape
# setxkbmap -option caps:swapescape
setxkbmap us
#~/.screenlayout/wide.sh
~/.screenlayout/swide.sh
~/.screenlayout/default.sh
# Set background
feh --bg-fill ~/Downloads/wp4473722-5120x1440-wallpapers.jpg

View File

@ -19,8 +19,3 @@ xss-lock -n /usr/lib/xsecurelock/dimmer -l -- xsecurelock &
nm-applet &
#autocutsel -fork &
#autocutsel -selection PRIMARY -fork &
flameshot &
discord &
firefox &
spotify &

View File

@ -37,8 +37,8 @@ f() { find . -name "*$1*"; }
tar-create() {tar cfv $@}
tar-list() {tar -tvf $@}
tar-extract() {tar xfv $@}
us-layout() {setxkbmap us -option caps:swapescape }
usint-layout() {setxkbmap us -variant intl -option caps:swapescape }
us-layout() {setxkbmap us }
usint-layout() {setxkbmap us -variant intl }
make_venv() {
echo $(basename $(pwd) | awk '{print "conda activate "$1}') > $(pwd | awk '{print $1"/.autoenv.zsh"}')

View File

@ -36,9 +36,6 @@ export NB_PROXMOXS=2
export VAGRANT_ABACUS_BOX="ubuntu/focal64"
export VISUAL=nvim
export EDITOR=nvim
export AUTOENV_ENV_FILENAME='.autoenv.zsh'
export AUTOENV_ENV_LEAVE_FILENAME='.autoenv_leave.zsh'
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='%F{4}${_prompt_sorin_pwd}%(!. %B%F{1}#%f%b.)${editor_info[keymap]} '
@ -48,5 +45,3 @@ export AUTOENV_ENABLE_LEAVE='yes'
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
eval $(thefuck --alias)
source ~/.autoenv/activate.sh