Compare commits

...

39 commits

Author SHA1 Message Date
Hippolyte Chauvin
896096599b Remaniement : deezer et webcord 2023-06-25 16:53:49 +02:00
Hippolyte Chauvin
4e72ee3aff Correction : amélioration du script waylectron qui lit maintenant ses arguments depuis le fichier ~/.config/electron-flags.conf 2023-06-25 16:41:04 +02:00
Hippolyte Chauvin
0ae2027504 Remaniement : fichiers de configuration de Electron 2023-06-24 18:43:10 +02:00
Hippolyte Chauvin
d7d95c4c52 Remaniement : fichiers de configuration de Electron suite à la mise à jour de Electron 2023-06-24 17:57:54 +02:00
Hippolyte Chauvin
64e8ecc560 Ajout : suppression de la variable SYSTEMD_PAGER 2023-06-20 21:17:38 +02:00
Hippolyte Chauvin
eabeca8816 Ajout : fichier de configuration de bash pour le système pour tera-io 2023-06-20 20:57:37 +02:00
Hippolyte Chauvin
69ce1a4568 Ajout : script de mise à jour de Waydroid 2023-06-20 20:33:21 +02:00
Hippolyte Chauvin
45d1d55c23 Correction : suppression d'une variable responsable d'un problème avec Vulkan 2023-06-18 22:17:14 +02:00
Hippolyte Chauvin
e1b8b08c12 Ajout : cd dans le xstartup de VNC 2023-06-18 21:57:49 +02:00
Hippolyte Chauvin
cae1cbbad0 Correction : les raccourcis pour redmiensionner une fenêtre sur i3 sont moins violents 2023-06-18 18:34:53 +02:00
Hippolyte Chauvin
78bd5d62ff Remaniement : séparation en plusieurs fichiers des configurations système de bash pour éviter la redondance du code 2023-06-18 18:27:56 +02:00
Hippolyte Chauvin
b126f629a5 Ajout : --no-startup-id dans les raccourcis pour modifier la luminosité dans la configuration de i3 2023-06-18 18:24:36 +02:00
Hippolyte Chauvin
b8abeecd32 Ajout : vérifier que le pont SSH n'existe pas déjà dans vncsconnect 2023-06-17 19:52:19 +02:00
Hippolyte Chauvin
b5c6748db6 Ajout : ne pas afficher le curseur dans le serveur VNC sans tête (headlessvnc) 2023-06-17 19:46:30 +02:00
Hippolyte Chauvin
c3dc90860f Correction : utilisation des guillemets dans la chaîne de caractères de sed pour la lisibilité dans waylectron 2023-06-17 19:42:30 +02:00
Hippolyte Chauvin
ba4afebe09 Correction : réécriture de vncsconnect. ssh-fwd { Correction : shift avant de break dans l'analyse d'arguments ; arguments à la fin pour pouvoir exécuter des commandes 2023-06-17 19:38:33 +02:00
Hippolyte Chauvin
067d6f722d Réécriture : logiciel ssh-fwd 2023-06-17 19:04:53 +02:00
Hippolyte Chauvin
5930748fe5 Ajout : fonction pour initialiser DISPLAY dans un shell 2023-06-17 16:55:04 +02:00
Hippolyte Chauvin
1e3d8433bf xinitrc { Ajout : variable BROWSER. Correction : indentation } 2023-06-17 16:47:31 +02:00
Hippolyte Chauvin
53a30035ac Ajout : plus de bell sur kitty 2023-06-17 01:15:49 +02:00
Hippolyte Chauvin
5b5822746b Ajout : script de mise à jour de Packer pour Neovim 2023-06-16 11:58:25 +02:00
Hippolyte Chauvin
d34e219414 Remaniement : nouveau nom pour commands.d, scripts.d 2023-06-16 11:45:48 +02:00
Hippolyte Chauvin
e14a5ff310 Ajout : possibilité d'appeler un script en particulier depuis updateall 2023-06-16 11:44:11 +02:00
Hippolyte Chauvin
00e3b9a609 Correction : modification de ma configuration Git 2023-06-16 11:26:53 +02:00
Hippolyte Chauvin
64d87e1d86 Ajout : afficher le nom des dépôts pendant les mises à jour de Git 2023-06-16 11:23:01 +02:00
Hippolyte Chauvin
4668a5cdd3 Ajout : fichier de configuration de kitty 2023-06-15 08:07:44 +02:00
Hippolyte Chauvin
e64695a668 Configuration de Hyprland { Ajout : couleurs des bordures du mode onglets } 2023-06-13 08:15:41 +02:00
Hippolyte Chauvin
239cc7633a Correction : nom de la touche au lieu du nombre dans la configuration de Sway 2023-06-12 22:56:05 +02:00
Hippolyte Chauvin
10120fa61e Ajout : raccourci pour éteindre l'écran quand Sway est vérouillé 2023-06-12 22:51:37 +02:00
Hippolyte Chauvin
3b24aa589f Correction : passage de togglescreen en exécutable 2023-06-12 22:40:54 +02:00
Hippolyte Chauvin
71ebea0a9e Ajout : script pour basculer l'état d'activité de l'écran 2023-06-12 22:40:02 +02:00
Hippolyte Chauvin
2dabb80d6e Correction : nouveau nom des fonctions dans headlessvnc 2023-06-11 13:12:29 +02:00
Hippolyte Chauvin
6b2ea26b76 Correction : corrections dans le code de headlessvnc 2023-06-11 13:10:26 +02:00
Hippolyte Chauvin
e23d3f951f Correction : utilisation des {} dans headlessvnc 2023-06-11 13:02:34 +02:00
Hippolyte Chauvin
01bb9339b1 Correction : ré-écriture de headlessvnc, 2/2 2023-06-11 12:53:27 +02:00
Hippolyte Chauvin
0c8f792f01 Correction : ré-écriture de headlessvnc 2023-06-11 12:46:46 +02:00
Hippolyte Chauvin
b46f8fec80 Suppression : XWayland dans les options de Weston 2023-06-10 18:35:55 +02:00
Hippolyte Chauvin
934eac85fe Configuration de Sway : { Remaniement : nouveau nom de assignements := windows_rules. Ajout : règle pour rendre pavucontrol flottant } 2023-06-10 18:33:52 +02:00
Hippolyte Chauvin
fcd3b35aa6 Correction : suppression de sensible-browser, remplacer par une variable $browser 2023-06-10 16:16:15 +02:00
34 changed files with 277 additions and 179 deletions

View file

@ -1 +0,0 @@
waylectron

5
bin/deezer Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
exec xargs /usr/bin/deezer \
"$@" \
< ~/.config/electron13-flags.conf

View file

@ -1,68 +1,82 @@
#!/bin/sh
# shellcheck disable=SC2317
#!/bin/bash
# cd to the local VNC directory, exit if it fails
cd "${HOME}/.vnc" || exit 5
# Variables
file_base="./$(hostname):1."
verbs="start|status|stop|restart|help"
# Variable
verbs="start status stop restart help"
echol() {
col="$1"
shift
printf '\033['"${col}"'m%s\033[0m\n' "$*"
# echo bold text
echobf() {
printf '\033[1m%s\033[0m\n' "$*"
}
# Print an error message
print_error() {
(
printf '\033[1;31m%s\033[0m ' "ERROR:"
echobf "$*"
) > /dev/stderr
}
# Print an error and exit
error() {
>&2 printf '\033[1;31m%s\033[0m %s\n' "ERROR:" "$1"
print_error "$1"
shift
exit "$1"
}
help() {
# Check if the VNC server is running
is_running() {
vncserver -list | grep -q '^:1'
}
# Show a help message
public_help() {
local name
name="$(basename "$0")"
cat << EOF
${name} - Start a VNC server
Usage:
${name} ${verbs}
${name} ${verbs// /|}
EOF
}
usage() {
>&2 help
error "Invalid usage: ${1}" 1
# Show the same help with an error
error_help() {
print_error "Invalid usage"
>&2 public_help
return 1
}
is_running() {
vncserver -list | grep -q '^:1'
}
start() {
# Start the VNC server
public_start() {
if ! is_running; then
set -e
vncserver \
-xstartup ./xstartup \
-localhost \
-alwaysshared \
-securitytypes none
-securitytypes none \
-nocursor
else
error "The VNC server is already running!" 4
fi
}
status() {
log_f="${file_base}log"
# Check if the server is running
public_status() {
if is_running; then
echol '1;32' "The VNC server is running."
tail "$log_f"
echobf "The VNC server is running."
tail "./$(hostname):1.log" | sed 's/^/\t/g'
else
echol '1;31' "The VNC server is not running."
echobf "The VNC server is not running."
fi
}
stop() {
# Stop the VNC server
public_stop() {
if is_running; then
vncserver -kill :1
else
@ -70,26 +84,23 @@ stop() {
fi
}
restart() {
stop
start
# Restart the VNC server
public_restart() {
public_stop
public_start
}
# Argument parsing
set -e; trap 'set +e; error "$error" "$?"' EXIT
error="You must give an argument"
[ -n "$1" ]; arg="$1"; shift
unset error
set +e; trap - EXIT
# Parse argument
if [ -n "$1" ]; then
arg="$1"
else
arg=status
fi
# Main case statement
case "$arg" in
status|start|stop|restart|help)
"$arg"
;;
*)
usage "Invalid argument \"$arg\""
;;
esac
# Main switch
if echo "$verbs" | grep -q "$arg"; then
"public_${arg}"
else
error_help
fi

View file

@ -1,37 +1,45 @@
#!/bin/bash -e
#!/bin/bash
shopt -s expand_aliases
[[ $TERM = xterm-kitty ]] && alias ssh='kitty +kitten ssh'
# Alias si le terminal est kitty
if [ "$TERM" = xterm-kitty ]; then
ssh=(kitty +kitten ssh)
else
ssh=(ssh)
fi
# Variables
ssh=ssh
declare -a args
# Display the usage
function usage {
# Foncitons
error() {
>&2 printf '\033[1;31m%s\033[0m \033[1m%s\033[0m\n' ERROR: "$*"
}
help() {
local name
name="$(basename "$0")"
cat << EOF
Usage: $(basename "$0") SSH_HOST LOCAL_PORT DISTANT_PORT [TARGET] [-- SSH_OPTIONS]
${name}: utilisation:
${name} SERVEUR PORT_LOCAL PORT_DISTANT [CIBLE] [-- ARGUMENTS_SSH...]
EOF
}
# Show an error
function error {
>&2 usage
exit "${1:-1}"
error_help() {
error "Invalid usage"
>&2 help
exit 1
}
# Check if TCP port number is free
port_is_free() {
! lsof -i -P -n | grep -q ':'"${1}"' (LISTEN)'
requested_port_bridge_pid() {
lsof -nP -i TCP -s TCP:LISTEN | awk '($1 == "ssh" && $9 ~ /.*:'"${1}"'/) { print $2 }' | uniq | head -n 1
}
# Arguments
while [[ -n $* ]]; do
# Analyser les arguments
while [ -n "$1" ]; do
case "$1" in
"--")
--)
shift
ssh_options=("$@")
set --
break
;;
*)
args+=("$1")
@ -40,25 +48,21 @@ while [[ -n $* ]]; do
esac
done
# Checking the validity of the args
[[ -z ${args[2]} ]] && error 1
[[ -z ${args[3]} ]] && args[3]=localhost
# Il doit y avoir au moins 3 arguments dans le tableau
if [ "${#args[@]}" -lt 3 ]; then
error_help
fi
# Command building
ssh_com=(
"$ssh"
"${ssh_options[@]}"
-f
-N
-L "${args[1]}:${args[3]}:${args[2]}"
"${args[0]}"
)
# Debug
#echo "${ssh_com[@]}"
#exit 0
# Execution
set -x
"${ssh_com[@]}"
pid="$(requested_port_bridge_pid "${args[1]}")"
if [ -z "$pid" ]; then
exec "${ssh[@]}" \
-f \
-N \
-L "${args[1]}:${args[3]:-localhost}:${args[2]}" \
"${args[0]}" \
"$@"
else
echo "Suppression de la redirection..."
kill "$pid"
fi

21
bin/togglescreen Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh -e
screen_is_on() {
[ "$(brightnessctl g)" -ne 0 ]
}
turn_on_screen() {
brightnessctl -r
}
turn_off_screen() {
brightnessctl -s
brightnessctl s 0
}
if screen_is_on; then
turn_off_screen
else
turn_on_screen
fi

View file

@ -7,6 +7,8 @@ realpath="$(readlink -f "$0")"
cd "$(dirname "$realpath")/../share/$(basename "$realpath")" || exit
unset realpath
scripts_d=./scripts.d
# Fonction pour fabriquer une ligne de la longueur d'un tiers du terminal
makeline() {
local cols line
@ -25,8 +27,22 @@ separator() {
}
# Procédure principale
for i in ./commands.d/*; do
main() {
for i in "${scripts_d}/"*; do
separator "$(basename "$i")"
"$i"
done
done
}
script="$1"
shift
case "$script" in
"")
main "$@"
;;
*)
"${scripts_d}/${script}" "$@"
;;
esac

View file

@ -1,37 +1,47 @@
#!/bin/bash
# Variables
declare -a make_ssh_bridge open_vnc_session
ssh_fwd=ssh-fwd
vncviewer=wlvncc
localhost=localhost
declare -a ssh_args
# Fonction
ssh_bridge_already_exists() {
[ -n "$(lsof -nP -i TCP -s TCP:LISTEN | awk '($1 == "ssh" && $9 ~ /.*:'"${1}"'/) { print }')" ]
}
# Sélectionner le viewer adapté à la session
if [ -n "$WAYLAND_DISPLAY" ]; then
vncviewer=wlvncc
else
vncviewer=vncviewer
separator=:
fi
# Arguments
ssh_host="$1" ; shift
local_port="${1:-9900}" ; shift
distant_port="${1:-5900}"; shift
target="$1" ; shift
while [ -n "$1" ]; do
case "$1" in
--)
shift
break
;;
*)
ssh_args+=("$1")
shift
;;
esac
done
# Commands building
# Make SSH bridge
make_ssh_bridge+=(
"$ssh_fwd"
"$ssh_host"
"$local_port"
"$distant_port"
"$target"
)
# Initialiser les arguments du viewer
args=(localhost "${ssh_args[1]}")
if [ -n "$separator" ]; then
args=("${args[*]// /${separator}/}")
fi
# Open VNC session
open_vnc_session+=(
"$vncviewer"
"$@"
"${localhost}"
"${local_port}"
)
# Execution
set -xe
"${make_ssh_bridge[@]}"
"${open_vnc_session[@]}"
# Exécution
if ! ssh_bridge_already_exists; then
ssh-fwd "${ssh_args[@]}" -- "$@" || exit
else
echo "Le pont SSH existe déjà !"
fi
exec "$vncviewer" \
"${args[@]}"

View file

@ -1,7 +1,8 @@
#!/bin/sh
#!/bin/bash
program="$(basename "$0")"
PATH="$(echo "$PATH" | sed 's|'"$(dirname "$(which "$program")")"'||g' | sed 's/^://g' | sed 's/::/:/g')"
readarray -t wayland_args < ~/.config/electron-flags.conf
PATH="$(echo "$PATH" | sed "s|$(dirname "$(which "$program")")||g" | sed 's/^://g' | sed 's/::/:/g')"
exec "$program" \
"$@" \
--ozone-platform-hint=wayland
"${wayland_args[@]}" \
"$@"

View file

@ -1,2 +1,2 @@
--enable-features=UseOzonePlatform
--ozone-platform=wayland
--enable-features=WaylandWindowDecorations
--ozone-platform-hint=auto

View file

@ -1 +0,0 @@
electron-flags.conf

View file

@ -0,0 +1,2 @@
--enable-features=UseOzonePlatform
--ozone-platform=wayland

View file

@ -0,0 +1 @@
electron-flags.conf

View file

@ -1 +0,0 @@
--ozone-platform-hint=auto

View file

@ -30,7 +30,8 @@ general {
border_size = 2
col.active_border = rgba(df80ffff) rgba(cc33ffff) 90deg
col.inactive_border = rgba(886c9322)
col.group_border = rgba(f2f2f280)
col.group_border_active = rgb(3366ff) rgb(33ccff)
layout = dwindle
}

View file

@ -1,6 +1,3 @@
# Vulkan
env = AMD_VULKAN_ICD, RADV
# Backend
env = GDK_BACKEND, wayland,x11
env = SDL_VIDEODRIVER, wayland

View file

@ -2,6 +2,7 @@
set $mod Mod4
floating_modifier $mod
set $refresh_i3status killall -SIGUSR1 i3status
set $browser librewolf
# Font
font pango:monospace 9

View file

@ -1,11 +1,11 @@
# Controls
bindsym XF86MonBrightnessUp exec brightnessctl s +5%
bindsym XF86MonBrightnessDown exec brightnessctl s 5%-
bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl s +5%
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl s 5%-
# Launchers
bindsym $mod+Return exec --no-startup-id i3-sensible-terminal
bindsym $mod+F1 exec --no-startup-id mixxx
bindsym $mod+F2 exec --no-startup-id sensible-browser
bindsym $mod+F2 exec --no-startup-id $browser
bindsym $mod+Shift+q kill
@ -86,15 +86,15 @@ bindsym $mod+Shift+r restart
bindsym $mod+Shift+e exec i3-msg exit
mode "resize" {
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
bindsym h resize shrink width 5 px or 5 ppt
bindsym j resize grow height 5 px or 5 ppt
bindsym k resize shrink height 5 px or 5 ppt
bindsym l resize grow width 5 px or 5 ppt
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
bindsym Left resize shrink width 5 px or 5 ppt
bindsym Down resize grow height 5 px or 5 ppt
bindsym Up resize shrink height 5 px or 5 ppt
bindsym Right resize grow width 5 px or 5 ppt
bindsym Return mode "default"
bindsym Escape mode "default"

12
config/kitty/kitty.conf Normal file
View file

@ -0,0 +1,12 @@
# General
enable_audio_bell no
# Fonts
font_family Hack Nerd Font
bold_font auto
italic_font auto
bold_italic_font auto
# Opacity
background_opacity 0.8

View file

@ -92,3 +92,6 @@ bindsym Shift+Print exec glurp area clip
bindsym Mod1+Print exec glurp full file
bindsym Mod1+Shift+Print exec glurp area file
# When locked
bindsym --locked XF86Display exec togglescreen

View file

@ -1,6 +1,10 @@
# Assignements
assign [app_id="^@joplin/app-desktop$"] 4
assign [app_id="^WebCord$"] 4
assign [class="^Deezer$"] 4
assign [app_id="^com.ktechpit.whatsie$"] 4
assign [app_id="^org.prismlauncher.PrismLauncher$"] 5
# Windows rules
for_window [app_id="pavucontrol"] floating enable

View file

@ -1,6 +1,3 @@
[core]
xwayland=true
[shell]
close-animation=none
startup-animation=none

View file

@ -1,5 +1,3 @@
# Lines added by ahurac
# PS1
if [ "$(id -u)" -eq 0 ]; then
ps1_color_1=1
@ -10,10 +8,3 @@ else
fi
export PS1="(\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;${ps1_color_1}m\]\u@\h\[$(tput sgr0)\] \[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;${ps1_color_2}m\]\W\[$(tput sgr0)\])\\$ \[$(tput sgr0)\]"
shrc_d=/usr/local/etc/sh/shrc.d
if [ -d "$shrc_d" ]; then
for i in "${shrc_d}/"*; do
. "$i"
done
fi

View file

@ -1,5 +1,3 @@
# Lines added by ahurac
# PS1
if [ "$(id -u)" -eq 0 ]; then
ps1_color_1=1
@ -10,10 +8,3 @@ else
fi
export PS1="[\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;${ps1_color_1}m\]\u@\h\[$(tput sgr0)\] \[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;${ps1_color_2}m\]\W\[$(tput sgr0)\]]\\$ \[$(tput sgr0)\]"
shrc_d=/usr/local/etc/sh/shrc.d
if [ -d "$shrc_d" ]; then
for i in "${shrc_d}/"*; do
. "$i"
done
fi

View file

@ -0,0 +1,7 @@
shrc_d=/usr/local/etc/sh/shrc.d
if [ -d "$shrc_d" ]; then
for i in "${shrc_d}/"*; do
. "$i"
done
fi

View file

@ -0,0 +1,12 @@
# PS1
if [ "$(id -u)" -eq 0 ]; then
ps1_color_1=1
ps1_color_2=10
else
ps1_color_1=6
ps1_color_2=4
fi
export PS1="{\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;${ps1_color_1}m\]\u@\h\[$(tput sgr0)\] \[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;${ps1_color_2}m\]\W\[$(tput sgr0)\]}\\$ \[$(tput sgr0)\]"
export SYSTEMD_PAGER=

View file

@ -4,6 +4,6 @@
[core]
editor = nvim
[init]
defaultBranch = master
defaultbranch = master
[pull]
rebase = false
rebase = true

View file

@ -9,3 +9,8 @@ command_not_found_handler() {
return 127
}
# sh
set-display() {
export DISPLAY=":${1:-1}"
}

View file

@ -31,6 +31,7 @@ fi
# Environment
export \
TERMINAL=st \
BROWSER=librewolf \
DRI_PRIME=1 \
QT_QPA_PLATFORMTHEME=qt5ct

View file

@ -1,7 +1,8 @@
#!/bin/sh
if cd "${1:-${HOME}/Git}"; then
for repo in *; do
cd "$repo"
cd "$repo" || continue
printf '\n%s\n' "$repo"
git pull
cd ..
done

View file

@ -0,0 +1,3 @@
#!/bin/sh
nvim +PackerUpdate +qall

View file

@ -0,0 +1,3 @@
#!/bin/sh
sudo waydroid upgrade

View file

@ -1,4 +1,5 @@
#!/bin/sh
cd
artix-pipewire-loader &
exec dbus-launch --exit-with-session \
xfwm4