From 1ad833846bdea1fa2d586c474916e7474a953228 Mon Sep 17 00:00:00 2001 From: Hippolyte Chauvin Date: Sun, 16 Apr 2023 22:58:56 +0200 Subject: [PATCH] Ajout du tableau des arguments dans les scripts --- bin/Hyprland | 5 +++-- bin/coless | 6 +++--- bin/mkddate | 2 +- bin/mount-phone | 2 +- bin/sensible-browser | 7 ------- bin/sshot-file | 1 + bin/sway | 25 ------------------------- bin/{swaylock => swaylock-hyprland} | 1 + bin/vncsconnect | 9 +++++---- bin/webcord | 4 ++-- bin/weston-rdp | 1 + bin/wolf | 6 +++--- home/winitrc-sway | 5 +++-- 13 files changed, 24 insertions(+), 50 deletions(-) delete mode 100755 bin/sensible-browser delete mode 100755 bin/sway rename bin/{swaylock => swaylock-hyprland} (98%) diff --git a/bin/Hyprland b/bin/Hyprland index 365d840..5642ae0 100755 --- a/bin/Hyprland +++ b/bin/Hyprland @@ -10,7 +10,8 @@ export PATH="/opt/wine-wl/usr/bin:$PATH" export BROWSER=librewolf # Execution -dbus-launch --exit-with-session \ +exec \ + dbus-launch --exit-with-session \ ssh-agent \ - /usr/bin/Hyprland + /usr/bin/Hyprland "$@" diff --git a/bin/coless b/bin/coless index f9b50ca..2b51b6a 100755 --- a/bin/coless +++ b/bin/coless @@ -1,6 +1,6 @@ #!/bin/sh -env \ +export \ LESSOPEN='| /usr/bin/src-hilite-lesspipe.sh %s' \ - LESS=' -R ' \ - less "$@" + LESS=-R +less "$@" diff --git a/bin/mkddate b/bin/mkddate index 20a2dff..87ccea6 100755 --- a/bin/mkddate +++ b/bin/mkddate @@ -1,5 +1,5 @@ #!/bin/sh -e path="${1:-.}/$(date +'%Y_%m_%d')" -mkdir -p "$path" +mkdir "$@" -p "$path" echo "$path" diff --git a/bin/mount-phone b/bin/mount-phone index 3f5d7d1..7bbc464 100755 --- a/bin/mount-phone +++ b/bin/mount-phone @@ -1,7 +1,7 @@ #!/bin/bash # Variable -dest="/mnt/ahurac/phone" +dest=/mnt/ahurac/phone # Commands building # Create destination diff --git a/bin/sensible-browser b/bin/sensible-browser deleted file mode 100755 index 8803e26..0000000 --- a/bin/sensible-browser +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -if [ -n "$BROWSER" ]; then - exec "$BROWSER" -else - exit 127 -fi - diff --git a/bin/sshot-file b/bin/sshot-file index eb77f8a..66cd635 100755 --- a/bin/sshot-file +++ b/bin/sshot-file @@ -1,5 +1,6 @@ #!/bin/sh exec printf \ + "$@" "screenshot-%s.${1:-png}" \ "$(date +"%Y_%m_%d-%N")" diff --git a/bin/sway b/bin/sway deleted file mode 100755 index 9e6ff33..0000000 --- a/bin/sway +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -xe - -# cd -cd - -# Environment -# XDG -export \ - XDG_CURRENT_DESKTOP=sway \ - XDG_SESSION_DESKTOP=sway - -# Backends -export \ - QT_QPA_PLATFORM='wayland;xcb' \ - QT_QPA_PLATFORMTHEME=qt6ct \ - CLUTTER_BACKEND=wayland \ - SDL_VIDEODRIVER=wayland \ - _JAVA_AWT_WM_NONREPARENTING=1 \ - MOZ_ENABLE_WAYLAND=1 - -# Execution -exec dbus-launch --exit-with-session \ - ssh-agent \ - /usr/bin/sway - diff --git a/bin/swaylock b/bin/swaylock-hyprland similarity index 98% rename from bin/swaylock rename to bin/swaylock-hyprland index 46a8e2d..4623458 100755 --- a/bin/swaylock +++ b/bin/swaylock-hyprland @@ -2,6 +2,7 @@ # Run swaylock exec /usr/bin/swaylock \ + "$@" \ --daemonize \ --indicator \ --clock \ diff --git a/bin/vncsconnect b/bin/vncsconnect index 223103f..a2469e3 100755 --- a/bin/vncsconnect +++ b/bin/vncsconnect @@ -7,10 +7,10 @@ vncviewer=wlvncc localhost=localhost # Arguments -ssh_host="$1" -local_port="${2:-9900}" -distant_port="${3:-5900}" -target="$4" +ssh_host="$1" ; shift +local_port="${1:-9900}" ; shift +distant_port="${1:-5900}"; shift +target="$1" ; shift # Commands building # Make SSH bridge @@ -25,6 +25,7 @@ make_ssh_bridge+=( # Open VNC session open_vnc_session+=( "$vncviewer" + "$@" "${localhost}" "${local_port}" ) diff --git a/bin/webcord b/bin/webcord index 960f2c3..06e4293 100755 --- a/bin/webcord +++ b/bin/webcord @@ -1,5 +1,5 @@ #!/bin/sh exec /usr/bin/webcord \ - --ozone-platform-hint=auto \ - "$@" + "$@" \ + --ozone-platform-hint=auto diff --git a/bin/weston-rdp b/bin/weston-rdp index 40a6d7e..a543c55 100755 --- a/bin/weston-rdp +++ b/bin/weston-rdp @@ -16,6 +16,7 @@ height="${1:-1080}"; shift # Command building weston_com=( "$weston" + "$@" "--backend=${backend}" "--rdp-tls-cert=${crt}" "--rdp-tls-key=${key}" diff --git a/bin/wolf b/bin/wolf index 1cea48e..e4468ea 100755 --- a/bin/wolf +++ b/bin/wolf @@ -1,8 +1,5 @@ #!/bin/bash -# Arguments -hostname="$1"; shift - # Variables declare mac declare -a wol_com options @@ -10,6 +7,9 @@ name="$(basename "$0")" wolf_d="${HOME}/.wolf" wolf_host="${wolf_d}/${hostname}" +# Arguments +hostname="$1"; shift + # Functions # Throw an error function error { diff --git a/home/winitrc-sway b/home/winitrc-sway index 9e6ff33..99e9379 100755 --- a/home/winitrc-sway +++ b/home/winitrc-sway @@ -19,7 +19,8 @@ export \ MOZ_ENABLE_WAYLAND=1 # Execution -exec dbus-launch --exit-with-session \ +exec \ + dbus-launch --exit-with-session \ ssh-agent \ - /usr/bin/sway + /usr/bin/sway "$@"