update theme
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
:CUSTOM_ID: phonebook
|
||||
:END:
|
||||
|
||||
The phone-list is taken from =scp opid21@lid21nano:/mnt/multipath-shares/sware/pub/phonelist/share/annuaire.txt /home/thomas/.local/data/annuaire.txt=
|
||||
The phone-list is taken from =scp rnice@esrf.fr:/mnt/multipath-shares/sware/pub/phonelist/share/annuaire.txt /home/thomas/.local/data/annuaire.txt=
|
||||
|
||||
#+begin_src bash :tangle ~/.local/bin/phonebook
|
||||
cat ~/.local/data/annuaire.txt | fzf --header="NAME Phone Box department roomNumber description mail"
|
||||
@@ -33,77 +33,62 @@ khard | fzf --header="Index Name Phone
|
||||
$TERMINAL --title esrf-phonebook -e contacts
|
||||
#+end_src
|
||||
|
||||
* =qutebrowser=
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: qutebrowser
|
||||
:END:
|
||||
|
||||
#+begin_src bash :tangle ~/.local/bin/qutebrowser
|
||||
~/.local/soft/qutebrowser/.venv/bin/python3 -m qutebrowser "$@"
|
||||
#+end_src
|
||||
|
||||
* =remote-home= - Remote Desktop to Home PC
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: remote-home
|
||||
:END:
|
||||
|
||||
#+begin_src bash :tangle ~/.local/bin/remote-home
|
||||
notify-send 'Rdesktop' "Connection to Home PC..."
|
||||
|
||||
common_arg="/clipboard /bpp:8 /bpp:16 /compression -themes -wallpaper /async-update /async-input -glyph-cache /audio-mode:1 /dynamic-resolution /auto-reconnect /wm-class:RDP_PC /grab-keyboard /cert:ignore"
|
||||
|
||||
xfreerdp $common_arg /u:thomas /p:$(pass home_pc/thomas | sed -n 1p) /v:192.168.1.72 > /tmp/freerdp_home_pc.log 2>&1 &
|
||||
#+end_src
|
||||
|
||||
* =remote-desktop= - Remote Desktop Connect
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: remote-desktop
|
||||
:END:
|
||||
|
||||
#+begin_src bash :tangle ~/.local/bin/remote-desktop
|
||||
computer=$(echo -e 'WID21SPEEDGOAT1\nWBM23SPEEDGOAT1\nWID24SPEEDGOAT1\nPCMEL1\nRNICE\nPCDEHAEZE\nLAPPAMU1\nPCNASS1\nDesktop-W10' | rofi -i -dmenu -no-custom -p 'Computer:' -l 20);
|
||||
computer=$(echo -e 'WID21SPEEDGOAT1\nWID24SPEEDGOAT1\nWBM23SPEEDGOAT1\nWMELSPEEDGOAT1\nWID31PC1\nPCOPTRO\nPCMEL1\nPCMEL2\nRNICE\nPCDEHAEZE\nLAPMEL01\nDesktop-W10' | rofi -i -dmenu -no-custom -p 'Computer:' -l 20);
|
||||
|
||||
if [[ -z "$computer" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
notify-send 'Rdesktop' "Connection to ${computer}..."
|
||||
dunstify --replace=99425 'Rdesktop' "Connection to ${computer}..."
|
||||
|
||||
proxy_arg=""
|
||||
if [ "$computer" = "Desktop-W10" ]; then
|
||||
# If connect to local PC
|
||||
if [ ping -c 1 -t 1 desktop-w10.lan &> /dev/null ]; then
|
||||
ping -c 1 desktop-w10.lan &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
# And outside of local network, use proxy
|
||||
proxy_arg="/proxy:socks5://localhost:8080"
|
||||
fi
|
||||
elif [ -z "$(timeout 1s dig +short proxy.esrf.fr.)" ]; then
|
||||
# Outside the ESRF network
|
||||
proxy_arg="/proxy:socks5://localhost:8081"
|
||||
else
|
||||
ping -c 1 proxy.esrf.fr &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
# Outside the ESRF network
|
||||
proxy_arg="/proxy:socks5://localhost:8081"
|
||||
fi
|
||||
fi
|
||||
|
||||
common_arg="/clipboard /bpp:8 /bpp:16 /compression -themes -wallpaper /async-update /async-input -glyph-cache /audio-mode:1 /dynamic-resolution /auto-reconnect /wm-class:RDP_$computer /grab-keyboard /cert:ignore"
|
||||
|
||||
case "$computer" in
|
||||
"RNICE" | "PCDEHAEZE" | "PCNASS1")
|
||||
"RNICE" | "PCDEHAEZE")
|
||||
xfreerdp $proxy_arg $common_arg /d:ESRF /u:dehaeze /p:$(pass esrf.fr/dehaeze | sed -n 1p) /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
|
||||
|
||||
"PCMEL1")
|
||||
"PCMEL1" | "PCMEL2" | "PCOPTRO" | "LAPMEL01")
|
||||
xfreerdp $proxy_arg $common_arg /d:ESRF /u:OPPEL /p:TonicPEL /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
|
||||
|
||||
"WMELSPEEDGOAT1")
|
||||
xfreerdp $proxy_arg $common_arg /d:ESRF /u:opd23 /p:tonic23 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
|
||||
|
||||
"WID31PC1")
|
||||
xfreerdp $proxy_arg $common_arg /d:ESRF /u:opid31 /p:tonic31 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
|
||||
|
||||
"WID21SPEEDGOAT1")
|
||||
xfreerdp $proxy_arg $common_arg /d:ESRF /u:opid21 /p:tonic21 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
|
||||
|
||||
"WBM23SPEEDGOAT1")
|
||||
xfreerdp $proxy_arg $common_arg /d:ESRF /u:opd23 /p:tonic23 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
|
||||
|
||||
"WID24SPEEDGOAT1")
|
||||
xfreerdp $proxy_arg $common_arg /d:ESRF /u:opid24 /p:tonic24 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
|
||||
|
||||
"LAPPAMU1")
|
||||
xfreerdp $proxy_arg $common_arg /d:ESRF /u:opid00 /p:tonic00 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
|
||||
"WBM23SPEEDGOAT1")
|
||||
xfreerdp $proxy_arg $common_arg /d:ESRF /u:opd23 /p:tonic23 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
|
||||
|
||||
"Desktop-W10")
|
||||
xfreerdp $proxy_arg $common_arg /d:ESRF /u:thomas /p:$(pass windows/Desktop-W10 | sed -n 1p) /v:192.168.1.72 > /tmp/freerdp_${computer}.log 2>&1 & ;;
|
||||
xfreerdp $proxy_arg $common_arg /u:thomas /p:$(pass windows/Desktop-W10 | sed -n 1p) /v:192.168.1.72 > /tmp/freerdp_${computer}.log 2>&1 & ;;
|
||||
|
||||
esac
|
||||
#+end_src
|
||||
@@ -129,9 +114,22 @@ dehaeze@rnice:/home/esrf/dehaeze/ /home/thomas/mnt/unix_home fuse.sshfs no
|
||||
//wfiles/groupshare /home/thomas/mnt/groupshare vsifs noauto,user,credentials=/home/thomas/.smbcredentials,uid=1001,gid=1001,forceuid,forcegid 0 0
|
||||
#+end_src
|
||||
|
||||
#+begin_src bash :tangle ~/.local/bin/mount-dir
|
||||
#+begin_src text :tangle no
|
||||
//wfiles/groupshare /home/thomas/mnt/groupshare cifs noauto,user,uid=1000,gid=1000,credentials=/home/thomas/.smbcredentials 0 0
|
||||
homelab:/srv/storage/ /home/thomas/mnt/homelab fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
|
||||
dehaeze@rnice:/tmp_14_days/ /home/thomas/mnt/tmp_14_days fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
|
||||
dehaeze@rnice:/home/esrf/dehaeze/ /home/thomas/mnt/unix_home fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
|
||||
dehaeze@rnice:/data/monochromators/ /home/thomas/mnt/monochromators fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
|
||||
dehaeze@rnice:/gpfs/jazzy/data/id21/inhouse /home/thomas/mnt/data_id21 fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
|
||||
blissadm@lmellab:/data/id00/inhouse/DCM /home/thomas/mnt/data_id24 fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
|
||||
blissadm@lmellab:/data/id00/inhouse/MEL /home/thomas/mnt/data_mel fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
|
||||
blissadm@lmellab:/users/blissadm/local /home/thomas/mnt/bliss fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
|
||||
blissadm@lmellab:/data/visitor /home/thomas/mnt/data_bl fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
|
||||
#+end_src
|
||||
|
||||
#+begin_src bash :tangle no
|
||||
if [ $# -eq 0 ]; then
|
||||
drive=$(echo -e 'monochromators\ntmp_14_days\nhomelab\ngroupshare\nunix_home\ndata_id21' | rofi -dmenu -no-custom -p 'Drive:' -l 20);
|
||||
drive=$(echo -e 'bliss_mel\nbliss_id21\ndata_bl\ndata_id21\ndata_id24\ndata_mel\ndata_visitor\ndrive\nhomelab\nmonochromators\ntmp_14_days\nunix_home' | rofi -dmenu -no-custom -p 'Drive:' -l 20);
|
||||
if [[ -z "$drive" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
@@ -142,23 +140,110 @@ fi
|
||||
|
||||
if grep -qs "/home/thomas/mnt/$drive" /proc/mounts; then
|
||||
umount "/home/thomas/mnt/$drive" && \
|
||||
notify-send "$drive " 'Successfully unmounted' || \
|
||||
notify-send --urgency=critical "$drive " 'Error while unmounted'
|
||||
dunstify --replace=58249 "$drive " 'Successfully unmounted' || \
|
||||
dunstify --replace=58249 --urgency=critical "$drive " 'Error while unmounted'
|
||||
else
|
||||
echo "It's not mounted."
|
||||
mount "/home/thomas/mnt/$drive" && \
|
||||
notify-send "$drive " 'Successfully mounted' || \
|
||||
notify-send --urgency=critical "$drive " 'Error while mounted'
|
||||
dunstify --replace=58249 "$drive " 'Successfully mounted' || \
|
||||
dunstify --replace=58249 --urgency=critical "$drive " 'Error while mounted'
|
||||
fi
|
||||
#+end_src
|
||||
|
||||
#+begin_src bash :tangle ~/.local/bin/mount-dir
|
||||
if [ $# -eq 0 ]; then
|
||||
drive=$(find ~/mnt/* -maxdepth 0 -type d -empty -printf '%f\n' | rofi -i -dmenu -no-custom -p 'Drive:' -l 20);
|
||||
if [[ -z "$drive" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
proxy_arg=""
|
||||
ping -c 1 proxy.esrf.fr &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
# Outside the ESRF network
|
||||
proxy_arg=".esrf.fr"
|
||||
fi
|
||||
|
||||
remote_loc=""
|
||||
passname=""
|
||||
case "$drive" in
|
||||
"homelab")
|
||||
remote_loc="thomas@homelab:/srv/storage/" ;;
|
||||
"tmp_14_days")
|
||||
remote_loc="dehaeze@rnice$proxy_arg:/tmp_14_days/"
|
||||
passname="esrf/dehaeze" ;;
|
||||
"unix_home")
|
||||
remote_loc="dehaeze@rnice$proxy_arg:/home/esrf/dehaeze/"
|
||||
passname="esrf/dehaeze" ;;
|
||||
"monochromators")
|
||||
remote_loc="dehaeze@rnice$proxy_arg:/data/monochromators/"
|
||||
passname="esrf/dehaeze" ;;
|
||||
"data_mel")
|
||||
remote_loc="opid00@lmellab$proxy_arg:/data/id00/inhouse/MEL/"
|
||||
passname="esrf/opid00" ;;
|
||||
"data_jazzy")
|
||||
remote_loc="dehaeze@rnice$proxy_arg:/gpfs/jazzy/data/"
|
||||
passname="esrf/dehaeze" ;;
|
||||
"data_easy")
|
||||
remote_loc="dehaeze@rnice$proxy_arg:/gpfs/easy/data/"
|
||||
passname="esrf/dehaeze" ;;
|
||||
"data_id31")
|
||||
remote_loc="opid31@id31$proxy_arg:/data/id31/inhouse/"
|
||||
passname="esrf/opid31" ;;
|
||||
"bliss_mel")
|
||||
remote_loc="blissadm@lmellab$proxy_arg:/users/blissadm/local/"
|
||||
passname="esrf/blissadm" ;;
|
||||
"bliss_id21")
|
||||
remote_loc="blissadm@lid21nano$proxy_arg:/users/blissadm/local/"
|
||||
passname="esrf/blissadm" ;;
|
||||
"bliss_id24")
|
||||
remote_loc="blissadm@foucault$proxy_arg:/users/blissadm/local/"
|
||||
passname="esrf/blissadm" ;;
|
||||
"groupshare")
|
||||
mount ~/mnt/groupshare && \
|
||||
exit ;;
|
||||
esac
|
||||
|
||||
if [-z $remote_loc ]
|
||||
then
|
||||
exit
|
||||
else
|
||||
if [-z $passname ]
|
||||
then
|
||||
sshfs -o allow_other,user,uid=1000,gid=1000,default_permissions $remote_loc /home/thomas/mnt/$drive
|
||||
else
|
||||
pass "$passname" | sshfs -o allow_other,user,uid=1000,gid=1000,default_permissions,password_stdin $remote_loc /home/thomas/mnt/$drive
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# sshfs -o allow_other,user,uid=1000,gid=1000,default_permissions $remote_loc /home/thomas/mnt/$drive
|
||||
#+end_src
|
||||
|
||||
#+begin_src bash :tangle ~/.local/bin/umount-dir
|
||||
if [ $# -eq 0 ]; then
|
||||
# drive=$(find ~/mnt/* -maxdepth 0 -type d -not -empty -printf '%f\n' | rofi -dmenu -no-custom -p 'Drive:' -l 20);
|
||||
drive=$(ls ~/mnt/ | rofi -dmenu -no-custom -p 'Drive:' -l 20);
|
||||
if [[ -z "$drive" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
umount /home/thomas/mnt/$drive
|
||||
#+end_src
|
||||
|
||||
* =screen-select= - Xrandr pre-defined scripts
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: screen-select
|
||||
:END:
|
||||
|
||||
#+begin_src bash :tangle ~/.local/bin/screen-select
|
||||
option=$(echo -e "Work\nLaptop\nHome" | rofi -dmenu -no-custom -p 'Screen:' -l 20)
|
||||
option=$(echo -e "Work\nLaptop\nHome" | rofi -i -dmenu -no-custom -p 'Screen:' -l 20)
|
||||
|
||||
if [[ -z "$option" ]]; then
|
||||
exit 1
|
||||
@@ -188,7 +273,7 @@ case "$option" in
|
||||
after_screen_change
|
||||
;;
|
||||
"Home")
|
||||
xrandr --output eDP-1 --off --output DP-3-2 --primary --mode 2560x1440 --pos 0x0 --rotate normal && \
|
||||
xrandr --output eDP-1 --off --output DP-1-2 --primary --mode 2560x1440 --pos 0x0 --rotate normal && \
|
||||
after_screen_change
|
||||
;;
|
||||
,*)
|
||||
@@ -210,11 +295,12 @@ sides=$(echo -e 'one-sided\ntwo-sided-long-edge\ntwo-sided-short-edge' | rofi -d
|
||||
media=$(echo -e 'A4\nA3' | rofi -dmenu -no-custom -p 'Size:' -l 20);
|
||||
printer=$(echo -e 'ctb127c1u\nctb110c1u' | rofi -dmenu -no-custom -p 'Size:' -l 20);
|
||||
|
||||
if [[ -z "$nbpage" || -z "$side" || -z "$media" || -z "$printer" ]]; then
|
||||
if [[ -z "$nbpage" || -z "$sides" || -z "$media" || -z "$printer" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
lpr -o media=$media -o sides=$sides -o number-up=$nbpage -P $printer "$1";
|
||||
rsync -zaP "$1" dehaeze@rnice:/home/esrf/dehaeze/Downloads/to-be-printed.pdf && \
|
||||
ssh rnice "lpr -o media=$media -o sides=$sides -o number-up=$nbpage -P $printer /home/esrf/dehaeze/Downloads/to-be-printed.pdf";
|
||||
#+end_src
|
||||
|
||||
* =readbib= - Open Bibliography File
|
||||
|
||||
Reference in New Issue
Block a user