Compare commits

..

No commits in common. "896096599b3fd6bcb385caad468b44323cc216dc" and "e8aa03ecb65f8193473643ad6624f30184d5c796" have entirely different histories.

34 changed files with 179 additions and 277 deletions

View file

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

1
bin/deezer Symbolic link
View file

@ -0,0 +1 @@
waylectron

View file

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

View file

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

View file

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

View file

@ -1,47 +1,37 @@
#!/bin/bash #!/bin/bash
# Variables # Variables
declare -a ssh_args declare -a make_ssh_bridge open_vnc_session
ssh_fwd=ssh-fwd
# Fonction vncviewer=wlvncc
ssh_bridge_already_exists() { localhost=localhost
[ -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 # Arguments
while [ -n "$1" ]; do ssh_host="$1" ; shift
case "$1" in local_port="${1:-9900}" ; shift
--) distant_port="${1:-5900}"; shift
shift target="$1" ; shift
break
;;
*)
ssh_args+=("$1")
shift
;;
esac
done
# Initialiser les arguments du viewer # Commands building
args=(localhost "${ssh_args[1]}") # Make SSH bridge
if [ -n "$separator" ]; then make_ssh_bridge+=(
args=("${args[*]// /${separator}/}") "$ssh_fwd"
fi "$ssh_host"
"$local_port"
"$distant_port"
"$target"
)
# Exécution # Open VNC session
if ! ssh_bridge_already_exists; then open_vnc_session+=(
ssh-fwd "${ssh_args[@]}" -- "$@" || exit "$vncviewer"
else "$@"
echo "Le pont SSH existe déjà !" "${localhost}"
fi "${local_port}"
exec "$vncviewer" \ )
"${args[@]}"
# Execution
set -xe
"${make_ssh_bridge[@]}"
"${open_vnc_session[@]}"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,12 +0,0 @@
# 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,6 +92,3 @@ bindsym Shift+Print exec glurp area clip
bindsym Mod1+Print exec glurp full file bindsym Mod1+Print exec glurp full file
bindsym Mod1+Shift+Print exec glurp area file bindsym Mod1+Shift+Print exec glurp area file
# When locked
bindsym --locked XF86Display exec togglescreen

View file

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

View file

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

View file

@ -1,3 +1,5 @@
# Lines added by ahurac
# PS1 # PS1
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
ps1_color_1=1 ps1_color_1=1
@ -8,3 +10,10 @@ else
fi 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 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,3 +1,5 @@
# Lines added by ahurac
# PS1 # PS1
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
ps1_color_1=1 ps1_color_1=1
@ -8,3 +10,10 @@ else
fi 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 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,7 +0,0 @@
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,12 +0,0 @@
# 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] [core]
editor = nvim editor = nvim
[init] [init]
defaultbranch = master defaultBranch = master
[pull] [pull]
rebase = true rebase = false

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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