Compare commits

...

4 Commits

Author SHA1 Message Date
Adrian Amaglio
509094355e mail sync 2023-01-24 23:57:19 +01:00
Adrian Amaglio
8f85680a53 homemade redshift 2023-01-24 23:57:03 +01:00
Adrian Amaglio
679a0ff8ce big update 2023-01-24 23:56:39 +01:00
Adrian Amaglio
c9a826082a ratiomaster 2023-01-24 23:55:56 +01:00
8 changed files with 66 additions and 19 deletions

2
emails
View File

@ -2,4 +2,4 @@
# We setup xauthority file to display stuff # We setup xauthority file to display stuff
auth="$(xauth extract - "$DISPLAY" | base64)" auth="$(xauth extract - "$DISPLAY" | base64)"
exec sudo -u emails sh -c "echo -n '$auth' | base64 -d > ~/.Xauthority && . ~/.bashrc && cd ~/attachements && exec aerc" exec sudo -u emails sh -c "echo -n '$auth' | base64 -d > ~/.Xauthority && . ~/.bashrc && cd ~/attachements && exec neomutt"

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
# Lock screen and suspend if enabled in config file # Lock screen and suspend if enabled in config file
i3lock -e -c 000000 -u && [ -z "$(grep off "/run/user/1000/enable_suspend")" ] && systemctl suspend i3lock -e -c 000000 -u && [ "$(cat "$XDG_RUNTIME_DIR/enable_suspend")" != off ] && systemctl suspend

19
ratiomaster.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
prefix=lol
token=toto
ui_port=9000
docker run --rm -it \
-p "$ui_port:$ui_port" \
-e _JAVA_OPTIONS='-Djava.net.preferIPv6Addresses=true' \
-v "$HOME/Downloads/qbittorrent/ratiomaster:/joal/torrents/" \
--name="ratiomaster" s8n02/joal \
--joal-conf="/joal" \
--spring.main.web-environment=true \
--server.port="$ui_port" \
--joal.ui.path.prefix="$prefix" \
--joal.ui.secret-token="$token"
echo "Go to http://localhost:$ui_port/$prefix/ui"
echo "And set settings to connect. prefix=$prefix token=$token"

8
redshift.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
if [ "$#" -ne 1 ] ; then
echo "Usage : $0 +/-" >&2
exit 1
fi
xrandr --output "$(xrandr --listactivemonitors | grep -o '[[a-zA-Z0-9\-]\{2,\}$' -m 1)" --gamma 1:0.3:0.3 --brightness 1.3

View File

@ -1,12 +1,8 @@
nextcloud & #!/bin/bash
feedreader &
#jami-gnome & #feedreader &>/dev/null &
offlineimap #jami-gnome &>/dev/null &
vdirsyncer sync nicotine &>/dev/null &
birthday_reminder qbittorrent &>/dev/null &
while true ; do #vdirsyncer sync
offlineimap -q sudo -u emails syncmails
#mpop -a
#notmuch new
sleep 30
done

7
syncmails Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
offlineimap
while true ; do
sleep 30
offlineimap -q
done

5
term
View File

@ -1,3 +1,4 @@
#!/bin/sh #!/bin/bash
cd "$(readlink -f "/proc/$(pgrep -P $(xdotool getwindowpid "$(xdotool getactivewindow)"))/cwd")" &>/dev/null || cd "$HOME" pid="$(xdotool getactivewindow getwindowpid)"
[ -n "$pid" ] && cd "$(readlink -f "/proc/$(pgrep -P "$pid")/cwd")" &>/dev/null || cd "$HOME"
exec st "${SHELL:-bash}" exec st "${SHELL:-bash}"

View File

@ -60,13 +60,29 @@ ssid="$(nmcli -f IN-USE,SSID,BARS d wifi list | dmenu -l 8)"
ssid="$(echo "${ssid:2:-5}" | sed 's/^ *//g' | sed 's/ *$//g')" ssid="$(echo "${ssid:2:-5}" | sed 's/^ *//g' | sed 's/ *$//g')"
# We get a clean version of SSIDs. It is a fix to connect to wifis that begin or end with spaces # We get a clean version of SSIDs. It is a fix to connect to wifis that begin or end with spaces
ssid="$(nmcli -f SSID -m multiline -t -c no d wifi list | grep -F "$ssid")" ssid="$(nmcli -f SSID -m multiline -t -c no d wifi list | grep -F -- "$ssid")"
ssid="${ssid:5}" ssid="${ssid:5}"
[ $verb -gt 0 ] && echo "ssid: $ssid" [ $verb -gt 0 ] && echo "ssid: $ssid"
[ -z "$ssid" ] && notify "No SSID selected" && exit 1 [ -z "$ssid" ] && notify "No SSID selected" && exit 1
notify "Connecting to $ssid" notify "Connecting to $ssid"
out="$(nmcli d wifi connect "$ssid" 2>&1 | grep -i error)" #out="$(nmcli d wifi connect "$ssid" 2>&1 | grep -i error)"
out="$(nmcli con up "$ssid" 2>&1 | grep -i error)"
res="$?" res="$?"
[ -z "$out" ] && notify "Connected :)" || notify "Error connecting :(\n$out" # 10 If the connexion does not exist already #
# 4 If the SSID got multiple bad connexion names #
if [ "$res" -ne 0 ] ; then
out2="$out"
out="$(nmcli device wifi connect "$ssid" 2>&1 | grep -i error)"
res="$?"
fi
if [ -n "$(echo $out | grep -i 'secrets were required')" ] ; then
out2="$out2$out"
notify "Need password"
pass="$(zenity --password)"
out="$(nmcli device wifi connect "$ssid" --password "$pass" 2>&1 | grep -i error)"
res="$?"
fi
[ -z "$out" ] && notify "Connected :)" || notify "Error connecting :(\n$out\n$out2"