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

View file

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

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

View file

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

View file

@ -1,8 +1,7 @@
#!/bin/bash
#!/bin/sh
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" \
"${wayland_args[@]}" \
"$@"
"$@" \
--ozone-platform-hint=wayland

View file

@ -1,2 +1,2 @@
--enable-features=WaylandWindowDecorations
--ozone-platform-hint=auto
--enable-features=UseOzonePlatform
--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
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,3 +1,6 @@
# Vulkan
env = AMD_VULKAN_ICD, RADV
# Backend
env = GDK_BACKEND, wayland,x11
env = SDL_VIDEODRIVER, wayland

View file

@ -2,7 +2,6 @@
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 --no-startup-id brightnessctl s +5%
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl s 5%-
bindsym XF86MonBrightnessUp exec brightnessctl s +5%
bindsym XF86MonBrightnessDown exec 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 $browser
bindsym $mod+F2 exec --no-startup-id sensible-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 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 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 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 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 Return 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+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="^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,3 +1,6 @@
[core]
xwayland=true
[shell]
close-animation=none
startup-animation=none

View file

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

View file

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

View file

@ -6,34 +6,33 @@ sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
if [ -f $sysresources ]; then
xrdb -merge $sysresources
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
xmodmap "$usermodmap"
fi
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
# Environment
export \
TERMINAL=st \
BROWSER=librewolf \
DRI_PRIME=1 \
QT_QPA_PLATFORMTHEME=qt5ct
TERMINAL=st \
DRI_PRIME=1 \
QT_QPA_PLATFORMTHEME=qt5ct
numlockx &

View file

@ -1,8 +1,7 @@
#!/bin/sh
if cd "${1:-${HOME}/Git}"; then
for repo in *; do
cd "$repo" || continue
printf '\n%s\n' "$repo"
cd "$repo"
git pull
cd ..
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
cd
artix-pipewire-loader &
exec dbus-launch --exit-with-session \
xfwm4