├── snippet ├── awk.snip ├── hist │ ├── tribblix.sh │ ├── trueos.sh │ ├── manjaro.sh │ ├── dragonflybsd.sh │ ├── salix.sh │ ├── freebsd-jail.sh │ ├── freebsd-sound.sh │ ├── openbsd.sh │ ├── omnios.sh │ ├── uefi.nsh │ ├── android.sh │ ├── smartos.sh │ ├── slackware.sh │ ├── freebsd-bhyve.sh │ ├── ubuntu.sh │ ├── artix.sh │ ├── debian.sh │ ├── mint.sh │ ├── void.sh │ ├── irssi.irc │ └── Grenier ├── .hgignore ├── calc │ └── script.calc ├── .bzrignore ├── .projectile ├── .racine-projet ├── .archive-exclude ├── ruby.snip ├── tmux │ └── info.tmux ├── sed.snip ├── lilypond.snip ├── zsh.snip ├── Makefile ├── git.snip └── orgmode.snip ├── fun ├── zsh │ ├── autoload │ │ ├── sortie.txt │ │ ├── Makefile │ │ ├── network │ │ │ └── ping │ │ ├── windenv │ │ │ └── propstring │ │ └── multimedia │ │ │ ├── rm-chanson │ │ │ ├── rm-papierpeint │ │ │ ├── cmd-papierpeint │ │ │ ├── cmd-chanson │ │ │ ├── vlc-shell │ │ │ ├── ls-chanson │ │ │ ├── cd-chanson │ │ │ ├── eval-chanson │ │ │ ├── cmd-dir-chanson │ │ │ ├── eval-papierpeint │ │ │ └── repartition-eval │ ├── zle │ │ ├── biblio-alternate-dirs │ │ ├── biblio-two-stars │ │ ├── biblio-zoxide-interactive │ │ ├── biblio-three-dots │ │ ├── biblio-three-stars │ │ ├── biblio-three-commas │ │ ├── biblio-repertoires │ │ └── biblio-edit-command-line │ └── completion │ │ ├── winman │ │ └── _herbstclient │ │ └── fileman │ │ └── _autojump └── fish │ └── autoload │ ├── fish_greeting.fish │ ├── fish_user_key_bindings.fish │ ├── fish_right_prompt.fish │ ├── toggle-vim-emacs-bindings.fish │ ├── fish_prompt.fish │ └── fish_hybrid_key_bindings.fish ├── shell ├── visu │ ├── lessclose.zsh │ ├── info.tmux │ ├── nviman.sh │ ├── update-lesskey.sh │ └── lessopen.zsh ├── run │ ├── run-lunarvim.zsh │ ├── run-redshift.sh │ ├── run-winman.zsh │ ├── run-element.sh │ ├── run-vim-lite.sh │ ├── pass-close.sh │ ├── pass-open.sh │ ├── run-neovim-bundle.zsh │ ├── run-vlc-server.zsh │ ├── run-lunarvim-qt.zsh │ ├── run-mozrepl.zsh │ ├── run-emacs-client.sh │ ├── run-kitty-kak-client.sh │ ├── run-slrn.sh │ ├── run-neovim-qt.zsh │ ├── run-gvim.sh │ ├── run-neovim-bundle-qt.zsh │ ├── run-urlscan.sh │ ├── run-slrnpull.sh │ ├── run-with-log.sh │ ├── goto-or-run.sh │ ├── run-greenclip.sh │ ├── run-wego.zsh │ ├── run-vifm.sh │ ├── run-within-kitty.sh │ ├── run-neovim-client.sh │ ├── run-quassel.sh │ ├── run-frescobaldi.sh │ ├── run-emacs.sh │ ├── run-wttr-in.zsh │ ├── run-weechat.zsh │ ├── run-freeciv-gtk.zsh │ ├── run-firefox.sh │ ├── run-clipmenud.sh │ ├── run-deroulant.zsh │ ├── run-kak-server.sh │ ├── run-freetube.sh │ ├── run-calculatrice.zsh │ ├── run-neomutt.zsh │ ├── dmenurun.sh │ ├── run-emacs-server.sh │ ├── run-mpv-server.zsh │ ├── run-mplayer-serveur.zsh │ ├── run-neovim-qt-client.sh │ └── run-neovim-server.sh ├── windenv │ ├── rofi-run.zsh │ ├── restart-dunst.sh │ ├── urxvtc-top.sh │ ├── less-log.sh │ ├── rofi-find.zsh │ ├── dmenu.zsh │ ├── restart-picom.zsh │ ├── rofi-windows.zsh │ ├── xdotool-maximise.sh │ ├── dmenu-apps.sh │ ├── rofi-greenclip.zsh │ ├── dmenu-man-pdf.zsh │ ├── rofi-buku.zsh │ ├── dmenu-askpass.sh │ ├── xdotool-minimise.sh │ ├── rofi-prompt.zsh │ ├── rofi-sudo.sh │ ├── dmenu-sudo.sh │ ├── bspwm-swap.sh │ ├── mono-screen.zsh │ ├── view-cli-output-in-term.bash │ ├── bspwm-remove-from-tabbed.sh │ ├── rofi-clipmenu.sh │ ├── rofi-surfraw.zsh │ ├── rofi-askpass.sh │ ├── kitty-dropdown.zsh │ ├── urxvtc-dropdown.zsh │ ├── urxvtc-calculator.zsh │ ├── rofi-disconnect.zsh │ ├── dragon.sh │ ├── rofi-clavier.zsh │ ├── rofi-close-window.zsh │ ├── rofi-combi.zsh │ ├── zen-wego.zsh │ ├── zen-wttr-in.zsh │ ├── rofi-aller-vers-bureau.zsh │ ├── rofi-move-to-desktop.zsh │ ├── rofi-rename-desktop.zsh │ ├── rofi-bureau.zsh │ ├── zen-shutdown.zsh │ ├── rofi-terminal.zsh │ ├── rofi-internet.zsh │ ├── keyboard-layout.zsh │ ├── tabbed-client.sh │ ├── adapt-screens.zsh │ └── hlwm-swap.bash ├── multimedia │ ├── midiplay.sh │ ├── screenshot.sh │ ├── sox-trim.sh │ ├── sxiv-copy.sh │ ├── sxiv-move.sh │ ├── timidity-segment.sh │ ├── run-timidity-server.sh │ ├── ffmpeg-dl-audio.zsh │ ├── mocp-play-album.zsh │ ├── groove-cdrom.zsh │ ├── run-jack.sh │ ├── run-fluidsynth-server.sh │ ├── timidity-ogg.zsh │ ├── handbrake.zsh │ ├── timidity-mp3.zsh │ ├── hardlink-image.zsh │ ├── new-score.sh │ ├── sxiv-move-image.zsh │ ├── sxiv-copy-image.zsh │ ├── dvd-avi.sh │ ├── ffmpeg-video.zsh │ ├── eval-song.zsh │ ├── eval-wallpaper.zsh │ ├── fluidsynth-ogg.zsh │ ├── mpc-auto-toggle.zsh │ ├── fluidsynth-mp3.zsh │ ├── lilypond-to-musicxml.zsh │ ├── pico-words-to-ogg.sh │ ├── mpv-pipe.zsh │ ├── fluid-player.sh │ ├── musescore-midi-to-ogg.zsh │ ├── musescore-midi-to-mp3.zsh │ ├── play-fuzzy-list.zsh │ └── sox-deejay.zsh ├── version │ ├── git-clone-light.sh │ └── git-reduce-size.sh ├── network │ ├── httrack.zsh │ ├── toggle-wifi.zsh │ ├── fix-ethernet-r8168.bash │ ├── wget-blog.zsh │ └── connection-test.sh ├── backup │ ├── runrestic.sh │ ├── restic-check.sh │ ├── restic-forget-prune.sh │ └── restic-backup.sh ├── node_modules │ └── .package-lock.json ├── search │ ├── grep-in-helpers.sh │ └── ripgrep-pipe.zsh ├── convert │ ├── pdf-to-text.sh │ ├── html-to-text.zsh │ ├── html-to-readable.zsh │ ├── html-to-readable-text.zsh │ ├── epub2text.zsh │ ├── images-from-webp.zsh │ ├── images-to-webp.zsh │ ├── rename-html-by-title.zsh │ ├── compact-vimwiki.sed │ ├── org2vimwiki-folder.zsh │ ├── vimwiki2org-folder.zsh │ ├── pdf-ocr-docx.sh │ └── vimwiki2org.sed ├── crypte │ ├── 7z-crypt.sh │ ├── tar-age.sh │ ├── tar-gpg.sh │ ├── gpg-export.sh │ └── passmenu.bash ├── generic │ ├── num-sort-inodes.zsh │ ├── for-touch-sleep.zsh │ └── kak-connect ├── math │ └── sum-lines.zsh ├── alarm │ ├── alarm-at-mpc.zsh │ ├── ding-dong.zsh │ ├── remind-at.zsh │ ├── chronometre.zsh │ ├── zen-minuter.zsh │ └── notify-sound.zsh ├── edit │ ├── emacs-lite.sh │ ├── neovim-lite.sh │ ├── vimdiff.sh │ ├── vim-mail.sh │ ├── vim-lite.sh │ ├── gvim-lite.sh │ └── neovim-qt-lite.sh ├── disk │ ├── fpp │ ├── clean-compiled-files.zsh │ ├── rm-local-vim.zsh │ ├── clean-vim-undos.zsh │ ├── rm-local-zsh.zsh │ └── rm-local-emacs.zsh ├── pack │ ├── pacman-packs-by-size.sh │ └── owlman_update_repository ├── multiplex │ ├── fzf-tmux-session.zsh │ ├── fzf-tmux-new-cli.zsh │ ├── skim-tmux-command.zsh │ ├── skim-tmux-history.zsh │ ├── dialog-tmux-session.zsh │ ├── fzf-tmux-command.zsh │ ├── fzf-tmux-new-tui.zsh │ ├── fzf-tmux-history.zsh │ └── fzf-tmux-menu.zsh ├── dialog │ └── dialog-liste.zsh ├── fileman │ └── vifmrun ├── sync │ ├── save-unison-config.sh │ └── save-pass.sh ├── data │ └── jq-search-playlists.sh └── process │ ├── toggle-process.zsh │ └── limit-program-time.zsh ├── automat ├── gen-dictionnaire.sh ├── syncthing.sh ├── vifm-clean-matchers.sh ├── autowake.zsh ├── sed-vars.zsh ├── update-crontab.sh ├── deliver-mail.sh ├── polybar-batterie.sh ├── remove-max-width-from-org-html-export.zsh ├── load_cycle_fix.sh ├── remind-message.sh ├── remind-msg.sh ├── welcome.zsh ├── aerc-new-mail.sh ├── new-mail.sh ├── polybar-meteo.sh ├── neomutt-new-mail.sh ├── neovim-colo.zsh ├── hlwm-polybar.zsh ├── polybar.zsh ├── update-elc.zsh ├── run-logrotate.zsh ├── log-notifications.bash ├── update-vim-tags.zsh ├── horodate.zsh ├── stat-econ.zsh ├── audio-perm.zsh ├── bspwm-subscribe.zsh ├── update-locate-db.sh ├── qute-history.zsh ├── alarm-memory.zsh ├── bspwm-autostop.zsh ├── hlwm-autostop.zsh ├── mail-boxes.zsh └── update-version.zsh ├── self ├── bin │ ├── build │ │ ├── build-ag.sh │ │ ├── confcompinst.sh │ │ ├── build-herbstluftwm.sh │ │ ├── build-xmonad.sh │ │ ├── build-weechat.sh │ │ ├── build-wmii.zsh │ │ ├── build-mu.sh │ │ ├── build-neovim.sh │ │ ├── build-vit.sh │ │ ├── build-musescore.sh │ │ ├── build-unison.sh │ │ └── build-creambrowser.sh │ ├── filesys │ │ ├── stow-all.sh │ │ └── chezmoi-to-plain.zsh │ ├── install │ │ ├── install-vim-plug.sh │ │ ├── install-minpac.sh │ │ ├── install-lazygit.sh │ │ ├── install-pip-packages.zsh │ │ └── install-with-am.zsh │ ├── version │ │ ├── clone-el-get.sh │ │ ├── go-get-repos.sh │ │ ├── clone-plugin-source.sh │ │ ├── hg-init.zsh │ │ └── git-init.zsh │ └── system │ │ ├── update-void.zsh │ │ ├── update-artix.zsh │ │ ├── update-manjaro.zsh │ │ └── update-archlinux.zsh └── links │ └── home-links.txt ├── site └── eclats2vers │ └── generic │ ├── musica │ └── lilypond │ │ └── Makefile │ └── image │ ├── Makefile │ ├── grimoire │ └── Makefile │ └── musica │ └── Makefile ├── README.org └── LICENSE /snippet/awk.snip: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fun/zsh/autoload/sortie.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /snippet/hist/tribblix.sh: -------------------------------------------------------------------------------- 1 | zap help 2 | -------------------------------------------------------------------------------- /snippet/hist/trueos.sh: -------------------------------------------------------------------------------- 1 | pc-updatemanager 2 | -------------------------------------------------------------------------------- /snippet/.hgignore: -------------------------------------------------------------------------------- 1 | /home/david/racine/common/target/hgignore -------------------------------------------------------------------------------- /snippet/calc/script.calc: -------------------------------------------------------------------------------- 1 | #!/bin/calc -f 2 | 3 | 2+3 4 | -------------------------------------------------------------------------------- /snippet/.bzrignore: -------------------------------------------------------------------------------- 1 | /home/david/racine/common/target/bzrignore -------------------------------------------------------------------------------- /snippet/.projectile: -------------------------------------------------------------------------------- 1 | /home/david/racine/common/target/projectile -------------------------------------------------------------------------------- /shell/visu/lessclose.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | #rm $2 4 | -------------------------------------------------------------------------------- /snippet/.racine-projet: -------------------------------------------------------------------------------- 1 | /home/david/racine/common/target/racine-projet -------------------------------------------------------------------------------- /snippet/.archive-exclude: -------------------------------------------------------------------------------- 1 | /home/david/racine/common/target/archive-exclude -------------------------------------------------------------------------------- /snippet/hist/manjaro.sh: -------------------------------------------------------------------------------- 1 | pacman-mirrors --fasttrack # manjaro, sudo 2 | -------------------------------------------------------------------------------- /shell/run/run-lunarvim.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | exec $HOME/racine/local/bin/lvim 4 | -------------------------------------------------------------------------------- /shell/run/run-redshift.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | redshift-gtk >> ~/log/redshift.log 2>&1 4 | -------------------------------------------------------------------------------- /shell/run/run-winman.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | winman=$1 4 | 5 | xinit $winman -- :1 6 | -------------------------------------------------------------------------------- /shell/visu/info.tmux: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env tmux source-file 2 | 3 | display-message -p '#{window_name}' 4 | -------------------------------------------------------------------------------- /shell/windenv/rofi-run.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | exec rofi -modi run -show run -p "app : " 4 | -------------------------------------------------------------------------------- /automat/gen-dictionnaire.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | fichier=$1 4 | 5 | tr -s "[[:blank:]]" "\n" < $1 6 | -------------------------------------------------------------------------------- /shell/multimedia/midiplay.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | echo midiplay -p128 "$@" 4 | midiplay -p128 "$@" 5 | -------------------------------------------------------------------------------- /shell/multimedia/screenshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | delay=$1 4 | shift 5 | 6 | scrot -d $delay -c -s "$@" 7 | -------------------------------------------------------------------------------- /automat/syncthing.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | exec syncthing serve --no-browser >> ~/log/syncthing.log 2>&1 4 | -------------------------------------------------------------------------------- /shell/run/run-element.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | exec element-desktop --hidden >> ~/log/element.log 2>&1 4 | -------------------------------------------------------------------------------- /shell/run/run-vim-lite.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | exec vim -u ~/racine/config/edit/vim-lite/vimrc "$@" 4 | -------------------------------------------------------------------------------- /shell/run/pass-close.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | urxvtc -name pass-open -geometry 84x7+200+200 -e pass close -v 4 | -------------------------------------------------------------------------------- /shell/run/pass-open.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | urxvtc -name pass-open -geometry 84x7+200+200 -e pass open -vf 4 | -------------------------------------------------------------------------------- /shell/run/run-neovim-bundle.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | export NVIM_APPNAME=$1 4 | shift 5 | 6 | exec nvim "$@" 7 | -------------------------------------------------------------------------------- /shell/windenv/restart-dunst.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | pkill dunst 4 | sleep 1 5 | dunst >> ~/log/dunst.log 2>&1 & 6 | -------------------------------------------------------------------------------- /shell/version/git-clone-light.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | repo=$1 4 | 5 | git clone --depth 1 --filter=blob:none $repo 6 | -------------------------------------------------------------------------------- /shell/visu/nviman.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | nvim -u ~/racine/config/edit/neovim/rc-nviman.vim -c 'set filetype=man' - 4 | -------------------------------------------------------------------------------- /shell/windenv/urxvtc-top.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # vim: set filetype=sh: 4 | 5 | urxvtc -name maintenance -e htop & 6 | -------------------------------------------------------------------------------- /fun/fish/autoload/fish_greeting.fish: -------------------------------------------------------------------------------- 1 | # vim: set filetype=sh: 2 | 3 | function fish_greeting 4 | echo Welcome to fish 5 | end 6 | -------------------------------------------------------------------------------- /shell/network/httrack.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | site=$1 4 | 5 | httrack \ 6 | --mirrorlinks \ 7 | --near \ 8 | $site 9 | -------------------------------------------------------------------------------- /shell/windenv/less-log.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # vim: set filetype=sh: 4 | 5 | urxvtc -name journal -e less -f -r +G $@ 6 | -------------------------------------------------------------------------------- /shell/run/run-vlc-server.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | cd ~/audio 4 | 5 | exec vlc --extraintf rc --rc-host 127.0.0.1:8080 "$@" 6 | -------------------------------------------------------------------------------- /shell/backup/runrestic.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | RESTIC_PASSWORD_COMMAND= 4 | 5 | runrestic -n --log-level info --show-progress 5 6 | -------------------------------------------------------------------------------- /snippet/hist/dragonflybsd.sh: -------------------------------------------------------------------------------- 1 | camcontrol devlist 2 | mount_msdos /dev/da9s1 /usb 3 | mount_msdos /dev/nvme0s0 /boot/efi 4 | nvmectl info 5 | -------------------------------------------------------------------------------- /fun/fish/autoload/fish_user_key_bindings.fish: -------------------------------------------------------------------------------- 1 | # vim: set filetype=sh: 2 | 3 | function fish_user_key_bindings 4 | #fzf_key_bindings 5 | end 6 | -------------------------------------------------------------------------------- /self/bin/build/build-ag.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | cd ~/source/search/the_silver_searcher 4 | 5 | ./build.sh 6 | 7 | sudo make install 8 | -------------------------------------------------------------------------------- /shell/node_modules/.package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shell", 3 | "lockfileVersion": 2, 4 | "requires": true, 5 | "packages": {} 6 | } 7 | -------------------------------------------------------------------------------- /shell/run/run-lunarvim-qt.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | exec nvim-qt --nvim "$HOME/racine/local/bin/lvim" "$@" >> ~/log/lunarvim-qt.log 2>&1 4 | -------------------------------------------------------------------------------- /shell/windenv/rofi-find.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # See also ~/racine/config/windenv/rofi/config.rasi 4 | 5 | exec rofi -show window 6 | -------------------------------------------------------------------------------- /snippet/ruby.snip: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env ruby 2 | 3 | # -*- ruby -*- 4 | 5 | def mon_de() 6 | 1 + rand(6) 7 | end 8 | 9 | print mon_de() 10 | -------------------------------------------------------------------------------- /shell/run/run-mozrepl.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | #exec urxvtc -e rlwrap telnet localhost 4242 4 | exec urxvtc -e rlwrap netcat localhost 4242 5 | -------------------------------------------------------------------------------- /automat/vifm-clean-matchers.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | for file in "$@" 4 | do 5 | jq 'del(.assocs, .xassocs, .viewers)' $file | sponge $file 6 | done 7 | -------------------------------------------------------------------------------- /shell/multimedia/sox-trim.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | infile=$1 4 | outfile=$2 5 | duration=$3 6 | 7 | sox "$infile" "$outfile" trim 0 "$duration" 8 | -------------------------------------------------------------------------------- /self/bin/filesys/stow-all.sh: -------------------------------------------------------------------------------- 1 | # vim: set filetype=conf: 2 | 3 | cd ~/racine/self/stow 4 | stow -t ~/.config dotconfig 5 | stow -t ~/.local/share local-share 6 | -------------------------------------------------------------------------------- /shell/run/run-emacs-client.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | xdotool search --name "emacs@$HOST" windowactivate && exit 0 4 | 5 | exec emacsclient -c -n "$@" 6 | -------------------------------------------------------------------------------- /shell/search/grep-in-helpers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | pattern=$1 4 | shift 5 | awk '/^" ---- helpers/,/^" ---- [^h]/{print FILENAME, NR, $0}' "$@" | grep $pattern 6 | -------------------------------------------------------------------------------- /shell/windenv/dmenu.zsh: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh: 2 | 3 | lines=${1:-30} 4 | shift 5 | dmenu -b -l $lines -nb black -nf '#5b3c11' -sb '#5b3c11' -sf black $* 6 | -------------------------------------------------------------------------------- /shell/windenv/restart-picom.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # vim: set filetype=zsh: 4 | 5 | pkill picom 6 | sleep 1 7 | picom &>>! ~/log/picom.log 2>&1 & 8 | -------------------------------------------------------------------------------- /shell/run/run-kitty-kak-client.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | xdotool search --name kak windowactivate && exit 0 4 | 5 | exec kitty --name kak kak -c kak-server 6 | -------------------------------------------------------------------------------- /shell/run/run-slrn.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | cd ~/racine/config/news || exit 4 | cp -f newsrc.slrnpull jnewsrc 5 | 6 | run-slrnpull.sh 7 | 8 | exec slrn "$@" 9 | -------------------------------------------------------------------------------- /shell/run/run-neovim-qt.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | xdotool search --class nvim-qt windowactivate && exit 0 4 | 5 | exec nvim-qt "$@" >> ~/log/nvim-qt.log 2>&1 6 | -------------------------------------------------------------------------------- /automat/autowake.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # vim: set filetype=zsh: 4 | 5 | echo Autowake : $(date +"%H:%M %A %d %B %Y") 6 | echo 7 | 8 | pkill -10 -f remind-server 9 | -------------------------------------------------------------------------------- /fun/zsh/autoload/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/zsh 2 | 3 | .PHONY : clean all 4 | 5 | all : 6 | ~/racine/automat/compile-zsh-autoload.zsh 7 | 8 | clean : 9 | rm -f *.zwc 10 | -------------------------------------------------------------------------------- /shell/run/run-gvim.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | xdotool windowactivate "$(xdotool search --class Gvim | tail -n 1)" && exit 0 4 | 5 | exec gvim "$@" >> ~/log/gvim.log 2>&1 6 | -------------------------------------------------------------------------------- /self/bin/build/confcompinst.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | # Compile et installe les sources d'un paquetage 3 | 4 | ./configure --prefix=/usr/local && make && su -c "make install" 5 | -------------------------------------------------------------------------------- /shell/run/run-neovim-bundle-qt.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | appname=$1 4 | shift 5 | 6 | export NVIM_APPNAME=$appname 7 | 8 | exec nvim-qt "$@" >> ~/log/$appname-qt.log 2>&1 9 | -------------------------------------------------------------------------------- /shell/run/run-urlscan.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | #exec urlscan --run-safe 'w3m {}' 4 | exec urlscan --run-safe 'qutebrowser {}' 5 | #exec urlscan --run-safe 'vivaldi-stable {}' 6 | -------------------------------------------------------------------------------- /fun/fish/autoload/fish_right_prompt.fish: -------------------------------------------------------------------------------- 1 | # vim: set filetype=sh: 2 | 3 | function fish_right_prompt --description 'Write out the prompt' 4 | echo (date +"%d-%M-%Y") (tty) 5 | end 6 | -------------------------------------------------------------------------------- /automat/sed-vars.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | sed \ 4 | -e 's+\$HOST+'$HOST'+g' \ 5 | -e 's+\$HOME+'$HOME'+g' \ 6 | -e 's+\$USER+'$USER'+g' \ 7 | -e 's+\$PATH+'$PATH'+g' \ 8 | $@ 9 | -------------------------------------------------------------------------------- /snippet/hist/salix.sh: -------------------------------------------------------------------------------- 1 | slapt-get --dist-upgrade # su 2 | slapt-get -i paquet # su 3 | slapt-get -u # su 4 | slapt-src -i paquet # su 5 | slapt-src -l 6 | slapt-src -u # su 7 | spkg paquet 8 | -------------------------------------------------------------------------------- /automat/update-crontab.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | reper=~/racine/config/auto 4 | 5 | sed-vars.zsh $reper/crontab > $reper/crontab-$HOST 6 | 7 | crontab $reper/crontab-$HOST 8 | 9 | crontab -l 10 | -------------------------------------------------------------------------------- /shell/convert/pdf-to-text.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | for page in "$@" 4 | do 5 | text=${page%.pdf}.txt 6 | echo "pdftotext $page > $text" 7 | pdftotext $page >! $text 8 | done 9 | 10 | -------------------------------------------------------------------------------- /shell/crypte/7z-crypt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | name=$1 4 | shift 5 | paths=$@ 6 | 7 | echo name : $name 8 | echo paths : $paths 9 | echo 10 | 11 | 7z a -mhe=on -p $name.7z $paths 12 | -------------------------------------------------------------------------------- /shell/generic/num-sort-inodes.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # vim: set filetype=sh: 4 | 5 | for dir in *(/F) 6 | do 7 | ls -i $dir/*(.) | sort -n 8 | done | awk '{ print " " NR "\t" $1 "\t" $2}' 9 | -------------------------------------------------------------------------------- /shell/windenv/rofi-windows.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | exec rofi \ 4 | -modi window,run \ 5 | -show window \ 6 | -mesg "Shift + Gauche ou Droite pour changer de rubrique" \ 7 | -p "rofi : " 8 | -------------------------------------------------------------------------------- /shell/windenv/xdotool-maximise.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | xdotool search --onlyvisible --class nvim-qt windowsize 70% 70% 4 | 5 | xdotool search --onlyvisible --class Emacs windowsize 70% 70% 6 | -------------------------------------------------------------------------------- /shell/run/run-slrnpull.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | folder=~/racine/news/spool 4 | server=news.eternal-september.org 5 | 6 | slrnpull -d $folder --expire 7 | slrnpull -d $folder -h $server --new-groups 8 | -------------------------------------------------------------------------------- /shell/run/run-with-log.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | application=$1 4 | 5 | xdotool search --class "$application" windowactivate && exit 0 6 | 7 | exec "$application" > ~/log/"$application".log 2>&1 8 | -------------------------------------------------------------------------------- /fun/fish/autoload/toggle-vim-emacs-bindings.fish: -------------------------------------------------------------------------------- 1 | # vim: set filetype=sh: 2 | 3 | function toggle-vim-emacs-bindings --description 'Toggle vim & emacs bindings' 4 | # todo 5 | fish_vi_key_bindings 6 | end 7 | -------------------------------------------------------------------------------- /shell/math/sum-lines.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | if [ $# -gt 0 ] 4 | then 5 | arg=($@) 6 | else 7 | arg=(**/*(.)) 8 | fi 9 | 10 | wc -l $=arg | awk '{print $1}' | { tr '\n' '+' ; echo 0 } | bc 11 | -------------------------------------------------------------------------------- /shell/visu/update-lesskey.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | lesskey -o ~/racine/built/less/key.out ~/racine/config/visu/less/key 4 | 5 | lesskey -o ~/racine/built/less/natif.out ~/racine/config/visu/less/natif 6 | -------------------------------------------------------------------------------- /automat/deliver-mail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # vim: set filetype=sh: 4 | 5 | temps=${1:-300} 6 | 7 | while true 8 | do 9 | getmail >> ~/log/getmail.log 2>> ~/log/getmail.err 10 | sleep $temps 11 | done 12 | -------------------------------------------------------------------------------- /self/bin/install/install-vim-plug.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | curl -fLo ~/racine/config/edit/neovim/autoload/plug.vim --create-dirs \ 4 | https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 5 | -------------------------------------------------------------------------------- /shell/crypte/tar-age.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | name=$1 4 | shift 5 | paths=$@ 6 | 7 | echo name : $name 8 | echo paths : $paths 9 | echo 10 | 11 | tar -cvJf - $paths | age -p - > $name.tar.xz.age 12 | -------------------------------------------------------------------------------- /shell/multimedia/sxiv-copy.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | echo -n "Destination folder ? " 4 | read folder 5 | 6 | echo "sxiv -to $@ | xargs -I{} cp {} $folder" 7 | 8 | sxiv -to "$@" | xargs -I{} cp {} $folder 9 | -------------------------------------------------------------------------------- /automat/polybar-batterie.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # vim: set filetype=sh: 4 | 5 | while true 6 | do 7 | sortie=$(acpi -b | cut -d ' ' -f 3-4 | sed 's/,//g') 8 | echo Bat $sortie 9 | sleep 60 10 | done 11 | -------------------------------------------------------------------------------- /shell/crypte/tar-gpg.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | name=$1 4 | shift 5 | paths=$@ 6 | 7 | echo name : $name 8 | echo paths : $paths 9 | echo 10 | 11 | tar -cvJf - $paths | gpg --symmetric > $name.tar.xz.gpg 12 | -------------------------------------------------------------------------------- /shell/run/goto-or-run.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | application=$1 4 | shift 5 | 6 | xdotool search --class "$application" windowactivate && exit 0 7 | 8 | exec "$application" "$@" >> ~/log/"$application".log 2>&1 9 | -------------------------------------------------------------------------------- /shell/version/git-reduce-size.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | du -sh .git 4 | echo 5 | git repack 6 | git prune-packed 7 | git reflog expire --expire=1.month.ago 8 | git gc --aggressive 9 | echo 10 | du -sh .git 11 | -------------------------------------------------------------------------------- /shell/convert/html-to-text.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | for page in "$@" 4 | do 5 | text=${page%.html}.txt 6 | [ -e $text ] && continue 7 | echo "w3m -dump $page >! $text" 8 | w3m -dump $page >! $text 9 | done 10 | -------------------------------------------------------------------------------- /shell/generic/for-touch-sleep.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # vim: set filetype=zsh: 4 | 5 | for folder in *(/FOn) 6 | do 7 | echo "touch $folder/*" 8 | touch $folder/* 9 | echo "sleep 1" 10 | sleep 1 11 | done 12 | -------------------------------------------------------------------------------- /shell/multimedia/sxiv-move.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | folder=$1 4 | shift 5 | 6 | args="$@" 7 | 8 | echo "sxiv -to $args | xargs -I{} mv {} $folder" 9 | echo 10 | 11 | sxiv -to $args | xargs -I{} mv {} $folder 12 | -------------------------------------------------------------------------------- /shell/windenv/dmenu-apps.sh: -------------------------------------------------------------------------------- 1 | # vim: set filetype=sh: 2 | 3 | dmenu_path | \ 4 | dmenu -p 'Application : ' -b -l 35 -fn "DejaVu Sans Mono 12" -nb black -nf '#5b3c11' -sb '#5b3c11' -sf black "$@" | \ 5 | ${SHELL:-"/bin/sh"} & 6 | -------------------------------------------------------------------------------- /shell/windenv/rofi-greenclip.zsh: -------------------------------------------------------------------------------- 1 | 2 | #! /usr/bin/env zsh 3 | 4 | #print -l $path 5 | 6 | exec rofi -modi "clipboard:greenclip print" \ 7 | -show clipboard \ 8 | -run-command '{cmd}' \ 9 | -p "Presse-papier : " 10 | -------------------------------------------------------------------------------- /shell/alarm/alarm-at-mpc.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | temps=($1) 4 | shift 5 | 6 | echo Temps : $temps 7 | echo 8 | 9 | cat <<- FIN | at $temps 2> ~/log/at.err 10 | mpc play 11 | FIN 12 | 13 | echo 14 | 15 | atq 16 | -------------------------------------------------------------------------------- /shell/multimedia/timidity-segment.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | begin=$1 4 | end=$2 5 | shift ; shift 6 | arguments="$*" 7 | 8 | echo timidity -G "$begin"-"$end"m "$arguments" 9 | timidity -G "$begin"-"$end"m "$arguments" 10 | -------------------------------------------------------------------------------- /shell/windenv/dmenu-man-pdf.zsh: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh: 2 | 3 | page=$(man -k . | 4 | dmenu -b -l 30 -p "Manuel : " -nb black -nf '#5b3c11' -sb '#5b3c11' -sf black $* | 5 | awk '{print $1}') 6 | 7 | man -Tpdf $page | zathura - 8 | -------------------------------------------------------------------------------- /shell/windenv/rofi-buku.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | path+=(~/racine/bin/local/bin) 4 | 5 | navigateur=${1:-qutebrowser} 6 | 7 | #rofi-bookmarks ~/racine/config/webrowser/bookmarks 8 | 9 | BROWSER=$navigateur buku_run 10 | -------------------------------------------------------------------------------- /shell/run/run-greenclip.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | backup=$hOME/racine/config/windenv/greenclip/greenclip.cfg.bak 4 | config=$hOME/racine/config/windenv/greenclip/greenclip.cfg 5 | 6 | cp -f "$backup" "$config" 7 | 8 | greenclip daemon 9 | -------------------------------------------------------------------------------- /shell/run/run-wego.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | echo 4 | echo "==================================" 5 | echo " " $(date +"%H : %M %A %d %B %Y") 6 | echo "==================================" 7 | echo 8 | 9 | ~/racine/bin/go/bin/wego 10 | -------------------------------------------------------------------------------- /shell/visu/lessopen.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # case "$1" in 4 | # *.Z) uncompress - 5 | # if [ -s /tmp/less.$$ ] 6 | # then 7 | # echo /tmp/less.$$ 8 | # else 9 | # rm -f /tmp/less.$$ 10 | # fi 11 | # ;; 12 | # esac 13 | -------------------------------------------------------------------------------- /snippet/hist/freebsd-jail.sh: -------------------------------------------------------------------------------- 1 | jls 2 | sudo jail start ubuntu 3 | sudo jexec ubuntu /bin/bash 4 | sudo jexec ubuntu /bin/bash -c "su -c /opt/google/chrome/chrome-wrapper - hsebert" 5 | sudo service jail onestart ubuntu 6 | sudo sysrc jail_enable="YES" 7 | -------------------------------------------------------------------------------- /automat/remove-max-width-from-org-html-export.zsh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | filelist=(${*:-**/*.html}) 4 | 5 | for file in $=filelist 6 | do 7 | sed -n '/^\s*#content { max-width:/p' $file 8 | sed -i '/^\s*#content { max-width:/d' $file 9 | done 10 | -------------------------------------------------------------------------------- /fun/zsh/autoload/network/ping: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options de zsh 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | # }}} 12 | 13 | command ping "$@" | sed 's/^/pong ... /' 14 | -------------------------------------------------------------------------------- /fun/zsh/zle/biblio-alternate-dirs: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | # }}} 12 | 13 | LBUFFER="cd -" 14 | 15 | zle accept-line 16 | -------------------------------------------------------------------------------- /shell/run/run-vifm.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | #xterm -e vifmrun 4 | urxvtc -e vifmrun 5 | #kitty vifmrun 6 | 7 | cd ~/racine/config/fileman/vifm 8 | vifm-clean-matchers.sh vifminfo.json 9 | cd sessions 10 | vifm-clean-matchers.sh *.json 11 | -------------------------------------------------------------------------------- /shell/run/run-within-kitty.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | application=$1 4 | shift 5 | 6 | xdotool search --name "$application" windowactivate && exit 0 7 | 8 | exec kitty --name "$application" "$application" "$@" >> ~/log/kitty-"$application".log 2>&1 9 | -------------------------------------------------------------------------------- /shell/windenv/dmenu-askpass.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # Credit: https://www.reddit.com/r/voidlinux/comments/kb4how/how_to_execute_suspend_and_hibernate_from_the/ 4 | 5 | exec dmenu -nb black -nf black -sb '#5b3c11' -sf black -p "Password : " <&- 6 | -------------------------------------------------------------------------------- /snippet/tmux/info.tmux: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env tmux source-file 2 | 3 | # Le shebang #! ne fonctionne pas à cause de la sous-commande de tmux 4 | 5 | list-sessions 6 | display-message -p '' 7 | list-windows 8 | display-message -p '' 9 | list-panes 10 | -------------------------------------------------------------------------------- /shell/convert/html-to-readable.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | for page in "$@" 4 | do 5 | short_page=${page%.html}-short.html 6 | [ -e $short_page ] && continue 7 | echo "readable $page >! $short_page" 8 | readable $page >! $short_page 9 | done 10 | -------------------------------------------------------------------------------- /automat/load_cycle_fix.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # TEMPDIR=$(mktemp -d -t temp.XXXXXX) 4 | 5 | TEMPDIR=~/tmp 6 | 7 | [ -d $TEMPDIR ] || mkdir $TEMPDIR 8 | 9 | while true 10 | do 11 | sleep 3 12 | echo " " > $TEMPDIR/load_cycle_fix 13 | done 14 | -------------------------------------------------------------------------------- /shell/windenv/xdotool-minimise.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | xdotool search --onlyvisible --class nvim-qt windowminimize 4 | 5 | xdotool search --onlyvisible --class Emacs windowminimize 6 | 7 | xdotool search --onlyvisible --class qutebrowser windowminimize 8 | -------------------------------------------------------------------------------- /shell/backup/restic-check.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | repo=${1:-$RESTIC_REPOSITORY} 4 | 5 | echo 6 | echo restic check 7 | echo 8 | 9 | restic -r "$repo" check 10 | 11 | echo 12 | echo restic snapshots 13 | echo 14 | 15 | restic -r "$repo" snapshots -c 16 | -------------------------------------------------------------------------------- /self/bin/version/clone-el-get.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | cd ~/racine/plugin/manager/el-get 4 | 5 | [[ -d el-get ]] || { 6 | 7 | echo "git clone https://github.com/dimitri/el-get.git" 8 | 9 | git clone https://github.com/dimitri/el-get.git 10 | 11 | } 12 | -------------------------------------------------------------------------------- /self/links/home-links.txt: -------------------------------------------------------------------------------- 1 | ~/.XCompose ~/racine/config/windenv/XCompose 2 | ~/.config/bat ~/racine/config/visu/bat 3 | ~/.local/bin ~/racine/local/bin 4 | ~/.local/etc ~/racine/local/etc 5 | ~/.local/lib ~/racine/local/lib 6 | ~/.local/share/Trash ~/racine/trash/corbeille 7 | -------------------------------------------------------------------------------- /shell/edit/emacs-lite.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # emacs --no-window-system --init-directory ~config/edit/emacs-lite 4 | # emacs -nw -q --no-splash -l ~/racine/config/edit/emacs-lite/init.el 5 | 6 | exec emacs --no-window-system --init-directory ~config/edit/emacs-lite "$@" 7 | -------------------------------------------------------------------------------- /shell/run/run-neovim-client.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | rundir=$XDG_RUNTIME_DIR 4 | 5 | if [ -d $rundir ] 6 | then 7 | socket=$rundir/neovim-socket 8 | else 9 | socket=~/racine/run/socket/neovim 10 | fi 11 | 12 | exec nvim --server $socket --remote-ui "$@" 13 | -------------------------------------------------------------------------------- /fun/zsh/zle/biblio-two-stars: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | emulate -R zsh 4 | 5 | setopt local_options 6 | 7 | setopt warn_create_global 8 | 9 | # Expand ** to **/* 10 | 11 | case $LBUFFER in 12 | (*\*) LBUFFER+='*/*' ;; 13 | (*) LBUFFER+='*' ;; 14 | esac 15 | -------------------------------------------------------------------------------- /shell/disk/fpp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # file & path finder 4 | 5 | # Pour tmux-fpp 6 | 7 | ~/racine/bin/go/bin/path-extractor | fzf -e | read chemin 8 | 9 | [ ! -z $chemin ] && { 10 | 11 | [ -e $chemin ] && { 12 | 13 | > ~/log/quasselclient.log 2>&1 8 | -------------------------------------------------------------------------------- /snippet/sed.snip: -------------------------------------------------------------------------------- 1 | # vim: set filetype=conf : 2 | 3 | # Modifier les lignes qui suivent des lignes-repères {{{1 4 | 5 | sed -i \ 6 | '/geometry: !!binary/{n ; s/.*/ AdnQywACAAAAAACsAAAAIwAABbkAAANCAAAArQAAADsAAAW4AAADQQAAAAAAAAAABkA=/}' \ 7 | *.yml 8 | 9 | # }}}1 10 | -------------------------------------------------------------------------------- /shell/convert/html-to-readable-text.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | for page in "$@" 4 | do 5 | text=${page%.html}.txt 6 | [ -e $text ] && continue 7 | echo "readable $page | w3m -T text/html -dump >! $text" 8 | readable $page | w3m -T text/html -dump >! $text 9 | done 10 | -------------------------------------------------------------------------------- /shell/run/run-frescobaldi.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | systemctl --user start timidity.service 4 | #systemctl --user start fluidsynth.service 5 | 6 | goto-or-run.sh frescobaldi 7 | 8 | systemctl --user stop timidity.service 9 | #systemctl --user stop fluidsynth.service 10 | -------------------------------------------------------------------------------- /shell/edit/neovim-lite.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | rundir=$XDG_RUNTIME_DIR 4 | 5 | if [ -d $rundir ] 6 | then 7 | socket=$rundir/neovim-lite-socket 8 | else 9 | socket=~/racine/run/socket/neovim-lite 10 | fi 11 | 12 | NVIM_APPNAME=neovim-lite nvim --listen $socket "$@" 13 | -------------------------------------------------------------------------------- /shell/run/run-emacs.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | xdotool search --name "emacs@$HOST" windowactivate && exit 0 4 | 5 | initdir=~/racine/dotdir/emacs.d 6 | 7 | echo Init directory : $initdir 8 | echo 9 | 10 | exec emacs --init-directory $initdir "$@" >> ~/log/emacs.log 2>&1 11 | -------------------------------------------------------------------------------- /automat/remind-message.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | #bell.zsh ~/audio/bell/ding/yinyang.ogg 4 | notify-send Reminder "$@" 5 | 6 | logfile=~/log/remind-msg.log 7 | 8 | { 9 | date +"[=] %A %d %B %Y (o) %H : %M : %S | %:z | " 10 | echo 11 | echo $@ 12 | echo 13 | } >> $logfile 14 | -------------------------------------------------------------------------------- /automat/remind-msg.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | #bell.zsh ~/audio/bell/ding/yinyang.ogg 4 | notify-send Reminder "$@" 5 | 6 | logfile=~/log/remind-msg.log 7 | 8 | { 9 | date +"[=] %A %d %B %Y (o) %H : %M : %S | %:z | " 10 | echo 11 | echo $@ 12 | echo 13 | } >> $logfile 14 | -------------------------------------------------------------------------------- /shell/run/run-wttr-in.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | lieu=${1:-Paris} 4 | 5 | echo 6 | echo "==================================" 7 | echo " " $(date +"%H : %M %A %d %B %Y") 8 | echo "==================================" 9 | echo 10 | 11 | curl wttr.in/$lieu 2>~/log/wttr-in.err.log 12 | -------------------------------------------------------------------------------- /shell/windenv/rofi-prompt.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | argumen=($@) 4 | menu=(Non Peut-être Oui) 5 | prompt="Lancer $=argumen ? " 6 | 7 | # Rofi dmenu {{{1 8 | 9 | choix=$(print -l $menu | rofi -dmenu -p "$prompt" -i) 10 | 11 | # }}}1 12 | 13 | [ $choix = Oui ] && $=argumen 14 | -------------------------------------------------------------------------------- /snippet/lilypond.snip: -------------------------------------------------------------------------------- 1 | 2 | % transposition modale 3 | 4 | dia = { c d e f g a b } 5 | ctrsubWaveC = \modalTranspose f c \dia \ctrsubWave 6 | 7 | % lyrics 8 | 9 | \addlyrics \lyricsBass 10 | 11 | arpège avec chordmode : 12 | 13 | \chordmode { a,8:1 ~ a,:m3 ~ a,:m ~ a,4.:m3.5.8 } 14 | -------------------------------------------------------------------------------- /shell/disk/clean-compiled-files.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | unsetopt no_match 4 | 5 | fichiers=( 6 | *.o 7 | *.so 8 | *.pyc 9 | *.elc 10 | *.zwc 11 | 12 | *.aux 13 | *.log 14 | *.out 15 | *.maf 16 | *.toc 17 | *.ptc* 18 | *.mtc* 19 | ) 20 | 21 | print ${~fichiers} | xargs -p rm -f 22 | -------------------------------------------------------------------------------- /shell/pack/pacman-packs-by-size.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # credit: https://www.reddit.com/r/archlinux/comments/50ft9r/any_tips_on_analyzing_disk_space_usage_and_how_do/ 4 | 5 | expac -H M "%011m\t%-20n\t%10d" $(comm -23 <(pacman -Qqe | sort) <(pacman -Qqg base base-devel | sort)) | sort -n 6 | -------------------------------------------------------------------------------- /shell/run/run-weechat.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | cd ~/racine/config/chaton/weechat 4 | 5 | for fichier in *.perso 6 | do 7 | echo "command cp -f $fichier ${fichier%%.perso}" 8 | 9 | command cp -f $fichier ${fichier%%.perso} 10 | done 11 | 12 | exec weechat "$@" 13 | -------------------------------------------------------------------------------- /shell/windenv/rofi-sudo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # Credit: https://www.reddit.com/r/voidlinux/comments/kb4how/how_to_execute_suspend_and_hibernate_from_the/ 4 | 5 | export SUDO_ASKPASS=~/racine/shell/windenv/rofi-askpass.sh 6 | 7 | # echo $SUDO_ASKPASS 8 | # echo 9 | 10 | sudo -A "$@" 11 | -------------------------------------------------------------------------------- /self/bin/build/build-herbstluftwm.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # {{{ Prérequis 4 | 5 | # sudo apt-get build-dep herbstluftwm 6 | 7 | # }}} 8 | 9 | # {{{ Clean 10 | 11 | make cleandeps 12 | make clean 13 | 14 | # }}} 15 | 16 | # {{{ Make 17 | 18 | make PREFIX=/usr/local 19 | 20 | # }}} 21 | -------------------------------------------------------------------------------- /shell/windenv/dmenu-sudo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # Credit: https://www.reddit.com/r/voidlinux/comments/kb4how/how_to_execute_suspend_and_hibernate_from_the/ 4 | 5 | export SUDO_ASKPASS=~/racine/shell/windenv/dmenu-askpass.sh 6 | 7 | # echo $SUDO_ASKPASS 8 | # echo 9 | 10 | sudo -A "$@" 11 | -------------------------------------------------------------------------------- /automat/welcome.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # vim: set filetype=zsh: 4 | 5 | while ! [ -S /run/user/$(id -u)/mpv-socket ] 6 | do 7 | echo "Accueil : waiting" 8 | echo 9 | sleep 5 10 | done 11 | 12 | mpv-socket.bash add $HOME/audio/bell/notification/accueil.ogg 13 | mpv-socket.bash volume 100 14 | -------------------------------------------------------------------------------- /automat/aerc-new-mail.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | notification=$1 4 | 5 | message="$HOME/audio/bell/notification/mesange.ogg" 6 | 7 | mpv-socket.bash add "$message" > ~/log/new-mail.log 2>&1 8 | mpv-socket.bash volume 100 > ~/log/new-mail.log 2>&1 9 | 10 | notify-send -a aerc 'New mail' "$notification" 11 | -------------------------------------------------------------------------------- /self/bin/install/install-minpac.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | mini_vimpack=$HOME/racine/plugin/manager/vimpack/minpac/opt/minpac 4 | mini_neovimpack=$HOME/racine/plugin/manager/neovimpack/minpac/opt/minpac 5 | 6 | git clone https://github.com/k-takata/minpac.git $mini_vimpack 7 | cp -R $mini_vimpack $mini_neovimpack 8 | -------------------------------------------------------------------------------- /shell/edit/vimdiff.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | basis=$1 4 | shift 5 | argumen="$@" 6 | 7 | for file in $argumen 8 | do 9 | [ $file = $basis ] && continue 10 | echo "vimdiff $basis $file" 11 | # :cq in vim sends non zero error code 12 | # and breaks the loop 13 | vimdiff $basis $file || break 14 | done 15 | -------------------------------------------------------------------------------- /shell/multimedia/run-timidity-server.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | if pgrep -af timidity | grep -v "$0" > /dev/null 4 | then 5 | echo timidity is already running. 6 | exit 0 7 | fi 8 | 9 | echo "timidity -B1,8 -iA > ~/log/timidity-server.log 2>&1 &" 10 | timidity -B1,8 -iA > ~/log/timidity-server.log 2>&1 & 11 | -------------------------------------------------------------------------------- /snippet/hist/freebsd-sound.sh: -------------------------------------------------------------------------------- 1 | # midi 1. does not work 2 | # midi 2. possibility to recompile fluidsynth from port with alsa support ? 3 | aconnect -l 4 | aconnect 1:0 2:0 5 | fluidsynth -s -a oss -m alsa_seq /usr/local/share/sounds/sf2/FluidR3_GM.sf2 6 | sudo pkg install -y alsa-utils alsa-seq-server timidity fluidsynth 7 | -------------------------------------------------------------------------------- /shell/multimedia/ffmpeg-dl-audio.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | url=$1 4 | sortie=$2 5 | temps=${3:-01:10:00.00} 6 | 7 | #addresse=$(yt-dlp -f 140 -g $url) 8 | addresse=$(yt-dlp -f 140 -g $url) 9 | 10 | echo "ffmpeg -i \"$addresse\" -t $temps $sortie.mp3" 11 | echo 12 | 13 | ffmpeg -i "$addresse" -t $temps $sortie.mp3 14 | -------------------------------------------------------------------------------- /shell/windenv/bspwm-swap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env /bin/sh 2 | 3 | # vim: set filetype=sh: 4 | 5 | if [ $(bspc query -N -n focused.tiled.local) = $(bspc query -N -n biggest.tiled.local) ] 6 | then 7 | bspc node -s smallest.tiled.local 8 | else 9 | bspc node -s biggest.tiled.local 10 | fi 11 | 12 | bspc node -f biggest.local 13 | -------------------------------------------------------------------------------- /self/bin/version/go-get-repos.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # vim: set fdm=indent: 4 | 5 | cd ~/racine/bin/go 6 | 7 | [[ -d src/github.com/edi9999/path-extractor ]] || { 8 | 9 | echo "go get github.com/edi9999/path-extractor/path-extractor" 10 | 11 | go get github.com/edi9999/path-extractor/path-extractor 12 | } 13 | 14 | -------------------------------------------------------------------------------- /shell/edit/vim-mail.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | exec vim -f \ 4 | -u ~/racine/config/edit/vim-mail/vimrc \ 5 | --cmd 'let &runtimepath = substitute(&runtimepath, $HOME."/\.config/vim", "$HOME/.config/vim-mail", "g")' \ 6 | --cmd 'let &packpath = substitute(&packpath, $HOME."/\.config/vim", "$HOME/.config/vim-mail", "g")' \ 7 | "$@" 8 | -------------------------------------------------------------------------------- /shell/generic/kak-connect: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if test -n "$KAKOUNE_SESSION" -a -n "$KAKOUNE_CLIENT"; then 4 | edit "$@" 5 | elif test -t 1; then 6 | kak "$@" 7 | else 8 | kak -ui dummy -e " 9 | new %{ 10 | hook -always -once global ClientClose %val{client} kill! 11 | edit %{$@} 12 | } 13 | " 14 | fi 15 | -------------------------------------------------------------------------------- /shell/windenv/mono-screen.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | if [ $HOST = taijitu ] 4 | then 5 | xrandr --output eDP-1 --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-1 --off --output DP-1 --off 6 | else 7 | xrandr --output LVDS1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI1 --off --output DP1 --off 8 | fi 9 | -------------------------------------------------------------------------------- /shell/windenv/view-cli-output-in-term.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # credit: https://www.youtube.com/watch?v=oFCrwS01mDs 4 | 5 | [ $# -eq 0 ] && { 6 | echo "Usage : $0 command" 7 | exit 0 8 | } 9 | 10 | command="$@" 11 | 12 | alacritty -e bash -c "$command ; tput setaf 1 ; read -p 'Press any key to continue.' -s -n 1" 13 | -------------------------------------------------------------------------------- /fun/zsh/autoload/windenv/propstring: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | setopt extended_glob 12 | 13 | # }}} 14 | 15 | echo -n 'Property ' 16 | xprop WM_CLASS | sed 's/.*"\(.*\)", "\(.*\)".*/= "\1,\2" {/g' 17 | echo '}' 18 | -------------------------------------------------------------------------------- /automat/new-mail.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | new=${1:-"unknown"} 4 | unread=${2:-"unknown"} 5 | 6 | message="$HOME/audio/bell/notification/mesange.ogg" 7 | 8 | mpv-socket.bash add "$message" > ~/log/new-mail.log 2>&1 9 | mpv-socket.bash volume 100 > ~/log/new-mail.log 2>&1 10 | 11 | notify-send 'New mail' "$new new, $unread unread." 12 | -------------------------------------------------------------------------------- /automat/polybar-meteo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # vim: set filetype=sh: 4 | 5 | while true 6 | do 7 | sortie=$(curl 'https://wttr.in/Louvain-la-Neuve?format=%C+%t+%H+%P+%w+%p+%m' 2>> ~/log/curl.err) 8 | 9 | if [ $? -eq 0 ] 10 | then 11 | echo $sortie 12 | else 13 | echo 'MET:INC' 14 | fi 15 | 16 | sleep 1800 17 | done 18 | -------------------------------------------------------------------------------- /snippet/hist/openbsd.sh: -------------------------------------------------------------------------------- 1 | /etc/rc.d/sshd restart 2 | co /etc/examples/doas.conf /etc 3 | man afterboot 4 | pkg_add -Uu 5 | doas pkg_add -r pkglocatedb 6 | doas pkg_add -r vim 7 | pkg_info -Q vim 8 | doas rcctl enable nfsd 9 | doas sysclean 10 | doas sysmerge 11 | doas syspatch 12 | doas sysupgrade 13 | doas syspatch 14 | doas sysmerge -d 15 | -------------------------------------------------------------------------------- /shell/windenv/bspwm-remove-from-tabbed.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env /bin/sh 2 | 3 | # vim: set filetype=sh: 4 | 5 | # Credit: 6 | # https://www.reddit.com/r/bspwm/comments/etfm3m/for_those_who_like_tabs/ 7 | 8 | tabbed=$(bspc query -N -n focused); \ 9 | child=$(tabbed-client.sh $tabbed list | head -n1); \ 10 | tabbed-client.sh $tabbed remove $child 11 | -------------------------------------------------------------------------------- /shell/multimedia/mocp-play-album.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # vim: set conceallevel=0 : 4 | 5 | repertoire=$(zenity --file-selection --directory) 6 | 7 | (( $#repertoire > 0 )) || exit 0 8 | 9 | cd $repertoire 10 | 11 | fichiers=$(print -l * | sort -t - -k 2) 12 | 13 | urxvtc -e mocp $=fichiers & 14 | 15 | #sleep 1 16 | 17 | #mocp -G 18 | -------------------------------------------------------------------------------- /automat/neomutt-new-mail.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | new=${1:-"unknown"} 4 | unread=${2:-"unknown"} 5 | 6 | message="$HOME/audio/bell/notification/mesange.ogg" 7 | 8 | mpv-socket.bash add "$message" > ~/log/new-mail.log 2>&1 9 | mpv-socket.bash volume 100 > ~/log/new-mail.log 2>&1 10 | 11 | notify-send -a neomutt 'New mail' "$new new, $unread unread." 12 | -------------------------------------------------------------------------------- /shell/alarm/ding-dong.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # Minuter with default arguments 4 | 5 | arguments=($*) 6 | 7 | echo "minuter.zsh $=arguments ..." 8 | echo 9 | 10 | minuter.zsh $=arguments \ 11 | ~/audio/bell/ding/clochette.ogg \ 12 | ~/audio/bell/ding/reception.ogg \ 13 | ~/audio/bell/ding/clochette.ogg \ 14 | ~/audio/bell/ding/reception.ogg 15 | -------------------------------------------------------------------------------- /shell/multimedia/groove-cdrom.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # vim: set conceallevel=0 : 4 | 5 | repertoire=${1:-.} 6 | 7 | description=${2:-"CD ROM"} 8 | 9 | mkisofs -V "$description" -J -r -o image-cdrom.iso $repertoire 10 | 11 | umount /dev/sr0 12 | 13 | cdrecord dev=/dev/sr0 -checkdrive 14 | 15 | cdrecord -v -sao dev=/dev/sr0 image-cdrom.iso 16 | -------------------------------------------------------------------------------- /shell/run/run-freeciv-gtk.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # {{{ Documentation 4 | 5 | # Briques du jeu : 6 | # 7 | # amplio2, hex2t, isophex, isotrident, trident 8 | 9 | # }}} 10 | 11 | #exec freeciv-gtk2 -n 'augustus' --autoconnect --port 5556 --tiles amplio2 --Plugin none 12 | exec freeciv-gtk2 -n 'augustus' --port 5556 --tiles amplio2 --Plugin none 13 | -------------------------------------------------------------------------------- /fun/zsh/zle/biblio-zoxide-interactive: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options de zsh 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | setopt extended_glob 12 | 13 | setopt pushd_ignore_dups 14 | setopt pushd_minus 15 | 16 | unsetopt chase_links 17 | 18 | # }}} 19 | 20 | zi 21 | 22 | zle accept-line 23 | -------------------------------------------------------------------------------- /shell/multimedia/run-jack.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | jack_control eps realtime False 4 | jack_control dps period 64 5 | jack_control ds alsa 6 | jack_control dps device hw:HD2 7 | jack_control dps rate 44100 8 | jack_control dps nperiods 2 9 | dbus-launch jack_control start 10 | sleep 10 11 | a2j_control --ehw 12 | a2j_control --start 13 | #sleep 10 14 | #qjackctl & 15 | -------------------------------------------------------------------------------- /shell/convert/epub2text.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Aide {{{1 4 | 5 | [ $# -eq 0 ] && { 6 | echo Usage : ${0##*/} folder 7 | exit 8 | } 9 | 10 | # }}}1 11 | 12 | folder=$1 13 | 14 | cd $folder 15 | 16 | for epub in **/*.epub 17 | do 18 | text=${epub%.epub}.txt 19 | echo "epub2txt $epub > $text" 20 | epub2txt $epub > $text 21 | done 22 | 23 | cd - 24 | -------------------------------------------------------------------------------- /shell/windenv/rofi-clipmenu.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # see also 4 | # and 5 | # for configuration 6 | 7 | #export CM_DIR=~/racine/hist/clipmenu 8 | export CM_DIR=~/run/clipmenu 9 | 10 | export CM_HISTLENGTH=17 11 | export CM_LAUNCHER=rofi 12 | 13 | exec clipmenu -dmenu -i 14 | -------------------------------------------------------------------------------- /fun/zsh/zle/biblio-three-dots: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | # }}} 12 | 13 | # Expand ... to ../.. 14 | 15 | case $LBUFFER in 16 | 17 | (./..|* ./..) LBUFFER+='.' ;; 18 | 19 | (..|*[ /=]..) LBUFFER+='/..' ;; 20 | 21 | (*) LBUFFER+='.' ;; 22 | esac 23 | -------------------------------------------------------------------------------- /fun/zsh/zle/biblio-three-stars: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | # }}} 12 | 13 | # Expand *** to **/** 14 | 15 | case $LBUFFER in 16 | 17 | (*\*\*) LBUFFER+='/*' ;; 18 | 19 | #(\*\*|*[ /=]\*\*) LBUFFER+='/*' ;; 20 | 21 | (*) LBUFFER+='*' ;; 22 | esac 23 | -------------------------------------------------------------------------------- /self/bin/install/install-lazygit.sh: -------------------------------------------------------------------------------- 1 | LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*') 2 | curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz" 3 | tar xf lazygit.tar.gz lazygit 4 | #sudo install lazygit /usr/local/bin 5 | -------------------------------------------------------------------------------- /shell/backup/restic-forget-prune.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | repo=${1:-$RESTIC_REPOSITORY} 4 | 5 | [ $# -gt 0 ] && shift 6 | 7 | echo 8 | echo restic forget 9 | echo 10 | 11 | restic \ 12 | -r "$repo" \ 13 | forget \ 14 | --keep-last 12 \ 15 | --keep-daily 7 \ 16 | --keep-weekly 4 \ 17 | --keep-monthly 12 \ 18 | --keep-yearly 7 \ 19 | --prune \ 20 | "$@" 21 | -------------------------------------------------------------------------------- /automat/neovim-colo.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | time=${1:-1800} 4 | 5 | cd ~/racine/plugin/manager/neovimpack/packager/opt/vim-colorschemes/colors 6 | 7 | schemelist=$(print -l *.vim | shuf) 8 | 9 | for scheme in $=schemelist 10 | do 11 | colo=${scheme%.vim} 12 | echo nvr --remote-send ":colo $colo" 13 | nvr --remote-send ":colo $colo" 14 | sleep $time 15 | done 16 | -------------------------------------------------------------------------------- /shell/convert/images-from-webp.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | setopt extended_glob 4 | 5 | folder=${1:-.} 6 | 7 | cd $folder 8 | 9 | for image in **/*.(webp|WEBP) 10 | do 11 | pngfile=${image%.*}.png 12 | jpegfile=${image%.*}.jpg 13 | echo "dwebp $image -o $pngfile" 14 | dwebp $image -o $pngfile 15 | echo "convert $pngfile $jpegfile" 16 | convert $pngfile $jpegfile 17 | done 18 | -------------------------------------------------------------------------------- /shell/multimedia/run-fluidsynth-server.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | if pgrep -af fluidsynth | grep -v "$0" > /dev/null 4 | then 5 | echo fluidsynth is already running. 6 | exit 0 7 | fi 8 | 9 | flags='-a pulseaudio -m alsa_seq -p FluidSynth_G -r 48000' 10 | sound=/usr/share/soundfonts/FluidR3_GM.sf2 11 | 12 | echo "fluidsynth -is $flags $sound" 13 | fluidsynth -is $flags $sound & 14 | -------------------------------------------------------------------------------- /shell/windenv/rofi-surfraw.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | navigateur=${1:-vivaldi-stable} 4 | 5 | surfraw -browser=$navigateur \ 6 | $(surfraw -elvi | \ 7 | awk -F'-' '{print $1}' | \ 8 | sed '/:/d' | \ 9 | awk '{$1=$1};1' | \ 10 | rofi -kb-row-select "Tab" \ 11 | -kb-row-tab "Control+space" \ 12 | -dmenu \ 13 | -mesg ">>> Tab = Autocomplete" \ 14 | -i \ 15 | -p "recherche " 16 | ) 17 | -------------------------------------------------------------------------------- /snippet/hist/omnios.sh: -------------------------------------------------------------------------------- 1 | pfexec pkg install brand/sparse 2 | sttydefs -a ttya -i '115200 hupcl opost onlcr ofill' -f '115200' 3 | sudo bootadm install-bootloader -Mfv 4 | sudo bootadm update-archive 5 | sudo zfs create -o mountpoint=/zone rpool/zone 6 | sudo zlogin firstzone 7 | sudo zoneadm -z firstzone boot 8 | sudo zoneadm -z firstzone install 9 | sudo zonecfg -z firstzone 10 | ttydefs -r ttya 11 | -------------------------------------------------------------------------------- /shell/multiplex/fzf-tmux-session.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | [[ $TERM = tmux* || $TERM = screen* ]] || { 4 | 5 | echo "Not in tmux session" 6 | echo 7 | 8 | exit 0 9 | } 10 | 11 | cd ~/racine/config/multiplex/tmux/session 12 | 13 | fichier=$(print -l * | grep -v Grenier | fzf --preview 'cat {}' --prompt='tmux> ') 14 | 15 | (( $#fichier == 0 )) && exit 0 16 | 17 | tmux source-file $fichier 18 | -------------------------------------------------------------------------------- /shell/run/run-firefox.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | xdotool search --class "firefox" windowactivate && exit 0 4 | 5 | # cpu quota 6 | # 7 | # 50 % = 1/2 core 8 | # 100 % = 1 core 9 | # 150 % = 1 core 1/2 10 | # 200 % = 2 cores 11 | # 300 % = 3 cores 12 | # 400 % = 4 cores 13 | 14 | quota=${1:-150} 15 | 16 | exec systemd-run --user --scope -p CPUQuota="$quota%" firefox >> ~/log/firefox.log 2>&1 17 | -------------------------------------------------------------------------------- /shell/windenv/rofi-askpass.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # Credit: https://www.reddit.com/r/voidlinux/comments/kb4how/how_to_execute_suspend_and_hibernate_from_the/ 4 | # https://www.reddit.com/r/qtools/comments/dwc02a/rofiquestion_how_to_hide_the_textbox/ 5 | 6 | # See also ~/racine/config/windenv/rofi/themes/invisible.rasi 7 | 8 | exec rofi -dmenu -p 'Password ' -theme invisible 2> ~/log/rofi.err 9 | -------------------------------------------------------------------------------- /automat/hlwm-polybar.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | polybar-msg cmd quit 4 | 5 | echo "---" | tee -a ~/log/polybar/superieur.log ~/log/polybar/inferieur.log 6 | 7 | polybar -c ~/racine/config/windenv/polybar/hlwm-config superieur >>~/log/polybar/superieur.log 2>&1 & 8 | polybar -c ~/racine/config/windenv/polybar/hlwm-config inferieur >>~/log/polybar/inferieur.log 2>&1 & 9 | 10 | echo "Bars launched..." 11 | -------------------------------------------------------------------------------- /fun/fish/autoload/fish_prompt.fish: -------------------------------------------------------------------------------- 1 | # vim: set filetype=sh: 2 | 3 | function fish_prompt --description 'Write out the prompt' 4 | set -l suffix 5 | switch "$USER" 6 | case root toor 7 | set suffix '#' 8 | case '*' 9 | set suffix '$' 10 | end 11 | echo 12 | echo -s " +--- $USER @ " (prompt_hostname) " : " (pwd) 13 | echo -s " |" 14 | echo -n -s ' +--- ' (date +%H:%M) " $suffix " 15 | end 16 | -------------------------------------------------------------------------------- /shell/convert/images-to-webp.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | setopt extended_glob 4 | 5 | folder=${1:-.} 6 | 7 | cd $folder 8 | 9 | for image in **/*.(jpg|JPG) 10 | do 11 | webpfile=${image%.*}.webp 12 | [ -f $webpfile ] && { 13 | echo $webpfile already exists 14 | echo 15 | continue 16 | } 17 | echo "cwebp -q 75 $image -o $webpfile" 18 | echo 19 | cwebp -q 75 $image -o $webpfile 20 | done 21 | -------------------------------------------------------------------------------- /snippet/hist/uefi.nsh: -------------------------------------------------------------------------------- 1 | #shellx64.efi 2 | bcfg boot add 3 FS0:\EFI\refind\refind_x64.efi "rEFInd Boot Manager" 3 | bcfg boot dump -b 4 | bcfg boot dump -v 5 | bcfg boot mv 04 00 6 | bcfg boot rm 05 7 | bootx64.efi 8 | cd EFI 9 | cd EFI/boot 10 | cd boot 11 | edit FS0:\EFI\refind\refind.conf 12 | fs0: 13 | help 14 | help bcfg -v -b 15 | load ntfs_x64.efi 16 | ls 17 | map -r 18 | shellx64.efi 19 | startup.nsh 20 | -------------------------------------------------------------------------------- /fun/zsh/zle/biblio-three-commas: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | # }}} 12 | 13 | # Expand ... to ../.. 14 | 15 | case $LBUFFER in 16 | 17 | (./..|* ./..) LBUFFER+='.' ;; 18 | 19 | (,,|..|*[ /=]..|*[ /=],,) 20 | LBUFFER[-2,-1]='..' 21 | LBUFFER+='/../' 22 | ;; 23 | 24 | (*) LBUFFER+=',' ;; 25 | esac 26 | -------------------------------------------------------------------------------- /shell/disk/rm-local-vim.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | (( $# == 0 )) && { 4 | 5 | echo Usage : ${0##*/} version 6 | echo 7 | 8 | exit 9 | } 10 | 11 | version=$1 12 | 13 | # {{{ Dossiers 14 | 15 | dossiers=() 16 | 17 | dossiers+=(/usr/local/share/vim) 18 | 19 | # }}} 20 | 21 | for reper in $dossiers 22 | do 23 | echo "sudo rm -rf $reper/vim$version" 24 | echo 25 | 26 | sudo rm -rf $reper/vim$version 27 | done 28 | -------------------------------------------------------------------------------- /shell/multimedia/timidity-ogg.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | argumen=($@) 4 | 5 | # Aide {{{1 6 | 7 | [ $#argumen -eq 0 ] && { 8 | echo Usage : $0 ' file(s)' 9 | echo 10 | echo Convert midi files to ogg 11 | exit 0 12 | } 13 | 14 | # Boucle {{{1 15 | 16 | for midi in $=argumen 17 | do 18 | ogg=${midi%.midi}.ogg 19 | echo 20 | echo "timidity -s 44100 -Ov -o $ogg $midi" 21 | echo 22 | timidity -Ov -o $ogg $midi 23 | done 24 | -------------------------------------------------------------------------------- /shell/run/run-clipmenud.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # see also 4 | # and 5 | # for configuration 6 | 7 | #export CM_DIR=~/racine/hist/clipmenu 8 | export CM_DIR=~/run/clipmenu 9 | 10 | export CM_MAX_CLIPS=3000 11 | export CM_SELECTIONS="clipboard primary secondary" 12 | export CM_IGNORE_WINDOW=".*[Pp]inentry.*" 13 | 14 | exec clipmenud 15 | -------------------------------------------------------------------------------- /automat/polybar.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Terminate already running bar instances 4 | # pkill -q polybar 5 | # If all your bars have ipc enabled, you can also use 6 | polybar-msg cmd quit 7 | 8 | echo "---" | tee -a ~/log/polybar/superieur.log ~/log/polybar/inferieur.log 9 | 10 | polybar superieur >>~/log/polybar/superieur.log 2>&1 & 11 | polybar inferieur >>~/log/polybar/inferieur.log 2>&1 & 12 | 13 | echo "Bars launched..." 14 | -------------------------------------------------------------------------------- /shell/run/run-deroulant.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | objectif=$(xdotool search --classname deroulant) 4 | 5 | retour=$? 6 | 7 | courante=$(xdotool getactivewindow) 8 | 9 | if [ $#objectif -gt 0 -a $#courante -gt 0 -a $courante = $objectif ] 10 | then 11 | i3-msg move scratchpad 12 | 13 | elif (( retour == 0 )) 14 | then 15 | xdotool windowactivate $objectif 16 | else 17 | urxvtc -name deroulant -geometry 120x30 -e zsh -l 18 | fi 19 | -------------------------------------------------------------------------------- /shell/alarm/remind-at.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | when=($1) 4 | shift 5 | voice=${1:-$HOME/audio/bell/notification/generique.ogg} 6 | shift 7 | notification="'${*:-Générique}'" 8 | 9 | echo When : $=when 10 | echo Voice : $voice 11 | echo Notification : $notification 12 | echo 13 | 14 | cat <<- FIN | at $=when 2> ~/log/at.err 15 | bell.zsh $voice 16 | notify-send 'Remind from at' $notification 17 | FIN 18 | 19 | echo 20 | 21 | atq 22 | -------------------------------------------------------------------------------- /shell/multiplex/fzf-tmux-new-cli.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | [[ $TERM = tmux* ]] || { 4 | 5 | echo "Not in tmux session" 6 | echo 7 | 8 | exit 0 9 | } 10 | 11 | choices=( 12 | 'zsh -l' 13 | 'fish -l' 14 | elvish 15 | xonsh 16 | 'ed -v -p " ed : "' 17 | 'clifm --no-color' 18 | lftp 19 | ) 20 | 21 | command=$(print -l $choices | fzf --prompt='tmux> ') 22 | 23 | (( $#command == 0 )) && exit 0 24 | 25 | tmux new-window $command 26 | -------------------------------------------------------------------------------- /shell/run/run-kak-server.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | psgrep='/bin/ps auxww | /bin/grep -v grep | /bin/grep --color=never' 4 | 5 | $psgrep kak >> ~/log/psgrep.log 2>&1 && { 6 | echo 'kakoune tourne déjà' 7 | echo 8 | return 0 9 | } 10 | 11 | #[ -S /run/user/"$(id -u)"/kakoune/kak-server ] && rm -f /run/user/"$(id -u)"/kakoune/kak-server 12 | 13 | exec kak -d -s kak-server -E 'cd ~/racine/public/python-misc' >> ~/log/kak-server.log 2>&1 14 | -------------------------------------------------------------------------------- /shell/run/run-freetube.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | xdotool search --class Freetube windowactivate && exit 0 4 | 5 | date >> ~/log/freetube.log 2>&1 6 | echo >> ~/log/freetube.log 2>&1 7 | freetube >> ~/log/freetube.log 2>&1 8 | echo >> ~/log/freetube.log 2>&1 9 | 10 | sleep 5 11 | 12 | #cp -f ~/.config/FreeTube/*.db ~/racine/feder/central/freetube/database 13 | cp -f ~/racine/config/social/freetube/*.db ~/racine/feder/central/freetube/database 14 | -------------------------------------------------------------------------------- /automat/update-elc.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | setopt null_glob 4 | 5 | date +" [=] %A %d %B %Y (o) %H:%M | %:z | " 6 | 7 | for dossier in * 8 | do 9 | echo "" 10 | echo "------------------------------------" 11 | echo "" 12 | 13 | echo "cd $dossier" 14 | echo 15 | echo "emacs --batch --eval '(byte-recompile-directory \".\")'" 16 | 17 | cd $dossier 18 | 19 | emacs --batch --eval '(byte-recompile-directory ".")' 20 | 21 | cd - 22 | done 23 | -------------------------------------------------------------------------------- /shell/dialog/dialog-liste.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | liste=() 4 | 5 | while read element 6 | do 7 | liste+=$element 8 | done 9 | 10 | numero=1 11 | tagitem=() 12 | 13 | for element in $liste 14 | do 15 | tagitem+=($numero $element) 16 | (( numero += 1 )) 17 | done 18 | 19 | exec 3>&1 20 | choix=$(dialog --menu "Liste" 0 0 0 $=tagitem 2>&1 1>&3) 21 | exec 3>&- 22 | 23 | code=$? 24 | 25 | (( $code > 0)) && exit 1 26 | 27 | echo $~liste[$choix] 28 | -------------------------------------------------------------------------------- /shell/multiplex/skim-tmux-command.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | [[ $TERM = tmux* ]] || { 4 | 5 | echo "Not in tmux session" 6 | echo 7 | 8 | exit 0 9 | } 10 | 11 | commande=$(tmux list-commands | sk-tmux | cut -d " " -f 1) 12 | 13 | (( $#commande == 0 )) && exit 0 14 | 15 | echo "$commande" >>! ~/racine/hist/skim/tmux-history 16 | 17 | if [ $# > 0 -a x$1 = x-s ] 18 | then 19 | tmux send-keys " tmux $commande " 20 | else 21 | tmux $commande 22 | fi 23 | -------------------------------------------------------------------------------- /shell/disk/clean-vim-undos.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # Supprime les .*.un~ dont le fichier associé n'existe plus 4 | 5 | # {{{ Options de zsh 6 | 7 | setopt extended_glob 8 | 9 | # }}} 10 | 11 | for fichierUndo in **/.*.un~ 12 | do 13 | fichier=${fichierUndo/(#b)(?*)\/.(*).un~/$match[1]\/$match[2]} 14 | 15 | #echo $fichierUndo / $fichier 16 | 17 | if [[ ! -f $fichier ]] 18 | then 19 | echo "rm $fichierUndo" 20 | 21 | rm $fichierUndo 22 | fi 23 | done 24 | -------------------------------------------------------------------------------- /shell/run/run-calculatrice.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | objectif=$(xdotool search --classname calculatrice) 4 | 5 | retour=$? 6 | 7 | courante=$(xdotool getactivewindow) 8 | 9 | if [ $#objectif -gt 0 -a $#courante -gt 0 -a $courante = $objectif ] 10 | then 11 | i3-msg move scratchpad 12 | 13 | elif (( retour == 0 )) 14 | then 15 | xdotool windowactivate $objectif 16 | else 17 | urxvtc -name calculatrice -geometry 120x30 -fn "xft:monospace:size=12" -e calc 18 | fi 19 | -------------------------------------------------------------------------------- /shell/convert/rename-html-by-title.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Rename html file by title 4 | 5 | html-title () { 6 | file=$1 7 | title=$(\ 8 | grep -oP '\K.+?' $file | \ 9 | sed 's###' | \ 10 | sed 's/&#[^;]\+;//g' | \ 11 | sed 's/ \+/_/g' | \ 12 | sed 's/_{2,}/_/g' | \ 13 | sed 's/[^a-zA-Z0-9_-]//g' \ 14 | ) 15 | echo $title 16 | } 17 | 18 | for file in "$@" 19 | do 20 | title=$(html-title $file) 21 | mv -v $file $title.html 22 | done 23 | -------------------------------------------------------------------------------- /snippet/hist/android.sh: -------------------------------------------------------------------------------- 1 | adb connect 192.168.1.62:12145 2 | adb devices 3 | adb disconnect 4 | adb help 5 | adb pair 192.168.1.62:12437 6 | adb shell 7 | adb shell input keyevent 24 8 | adb shell input keyevent 25 9 | adb shell input text "coucou%sbeu" 10 | adb shell input text '\$%s\&' 11 | adb shell ls -l /storage/emulated/0 12 | adb shell ls -l /system 13 | adb shell pm uninstall --user 0 com.android.chrome # safe ? 14 | adb shell pm uninstall --user 0 com.google.chrome # safe ? 15 | -------------------------------------------------------------------------------- /fun/zsh/completion/winman/_herbstclient: -------------------------------------------------------------------------------- 1 | #compdef herbstclient 2 | # zsh completion for herbstclient 3 | 4 | # add this to your zshrc before sourcing this 5 | #autoload -U compinit 6 | #compinit 7 | 8 | _herbstclient() { 9 | local IFS=$'\n' 10 | # compadd is documented in zshcompwid(1) 11 | compadd -QS '' "$@" $(herbstclient -q complete_shell "$((CURRENT-2))" "${(@)words[@]:1}") 12 | } 13 | 14 | # compdef is documented in zshcompsys(1) 15 | compdef _herbstclient herbstclient 16 | -------------------------------------------------------------------------------- /fun/fish/autoload/fish_hybrid_key_bindings.fish: -------------------------------------------------------------------------------- 1 | # vim: set filetype=sh: 2 | 3 | function fish_hybrid_key_bindings --description \ 4 | "Vi-style bindings that inherit emacs-style bindings in all modes" 5 | for mode in default insert visual 6 | fish_default_key_bindings -M $mode 7 | end 8 | fish_vi_key_bindings --no-erase 9 | set -U fish_cursor_default block 10 | set -U fish_cursor_visual block 11 | set -U fish_cursor_insert line 12 | set -U fish_cursor_replace_one underscore 13 | end 14 | -------------------------------------------------------------------------------- /shell/windenv/kitty-dropdown.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Credit: 4 | # https://www.reddit.com/r/bspwm/comments/85hr4c/making_a_scratchpaddropdown_terminal_in_bspwm/ 5 | 6 | id=$(xdo id -N kitty -n dropdown) 7 | 8 | echo id = $id 9 | echo 10 | 11 | if [ -z "$id" ]; then 12 | kitty --name dropdown zsh 13 | else 14 | action='hide'; 15 | if [[ $(xprop -id $id | awk '/window state: / {print $3}') == 'Withdrawn' ]]; then 16 | action='show'; 17 | fi 18 | xdo $action -N kitty -n dropdown 19 | fi 20 | -------------------------------------------------------------------------------- /shell/network/toggle-wifi.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | if which wifi 4 | then 5 | wifi toggle 6 | notify-send "$(wifi)" 7 | elif which nmcli 8 | then 9 | if [[ $(nmcli radio wifi) = *disabled* ]] 10 | then 11 | nmcli radio wifi on 12 | notify-send "nmcli : wifi on" 13 | else 14 | nmcli radio wifi off 15 | notify-send "nmcli : wifi off" 16 | fi 17 | elif which rfkill 18 | then 19 | rfkill toggle wlan 20 | notify-send "$(rfkill)" 21 | else 22 | echo No command found to toggle wifi. 23 | fi 24 | -------------------------------------------------------------------------------- /shell/windenv/urxvtc-dropdown.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Credit: 4 | # https://www.reddit.com/r/bspwm/comments/85hr4c/making_a_scratchpaddropdown_terminal_in_bspwm/ 5 | 6 | id=$(xdo id -N URxvt -n dropdown) 7 | 8 | echo id = $id 9 | echo 10 | 11 | if [ -z "$id" ]; then 12 | urxvtc -name dropdown -e zsh 13 | else 14 | action='hide'; 15 | if [[ $(xprop -id $id | awk '/window state: / {print $3}') == 'Withdrawn' ]]; then 16 | action='show'; 17 | fi 18 | xdo $action -N URxvt -n dropdown 19 | fi 20 | -------------------------------------------------------------------------------- /snippet/hist/smartos.sh: -------------------------------------------------------------------------------- 1 | arcstat 2 | cat update.json | vmadm update virtual-machine 3 | imgadm avail 4 | prstat -Z 5 | sudo imgadm import os-image 6 | sudo pkgin update 7 | sudo pkgin upgrade 8 | sudo vmadm create -f virtual-machine.json 9 | sudo vmadm info virtual-machine-uuid 10 | sudo vmadm reboot virtual-machine-uuid 11 | sudo vmadm start virtual-machine-uuid 12 | sudo vmadm stop virtual-machine-uuid 13 | sudo vmadm update 14 | vmadm console virtual-machine-uuid 15 | vmadm list 16 | zfs get compression 17 | -------------------------------------------------------------------------------- /automat/run-logrotate.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | echo 4 | echo "========================================================================" 5 | echo 6 | date +" [=] %A %d %B %Y (o) %H:%M | %:z | " 7 | echo 8 | echo "========================================================================" 9 | echo 10 | 11 | fichier=${1:-"log-$HOST"} 12 | 13 | echo Fichier de configuration : $fichier 14 | echo 15 | 16 | exec logrotate --verbose \ 17 | --state ~/run/logrotate/status \ 18 | ~/racine/config/auto/logrotate/$fichier 19 | -------------------------------------------------------------------------------- /shell/windenv/urxvtc-calculator.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Credit: 4 | # https://www.reddit.com/r/bspwm/comments/85hr4c/making_a_scratchpaddropdown_terminal_in_bspwm/ 5 | 6 | iden=$(xdo id -N URxvt -n calculator) 7 | 8 | echo iden = $iden 9 | echo 10 | 11 | if [ -z "$iden" ]; then 12 | urxvtc -name calculator -e calc 13 | else 14 | action='hide'; 15 | if [[ $(xprop -id $iden | awk '/window state: / {print $3}') == 'Withdrawn' ]]; then 16 | action='show'; 17 | fi 18 | xdo $action -N URxvt -n calculator 19 | fi 20 | -------------------------------------------------------------------------------- /fun/zsh/autoload/multimedia/rm-chanson: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options de zsh 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | setopt extended_glob 12 | 13 | # }}} 14 | 15 | # {{{ Remplacé par rm -i 16 | 17 | # echo -n 'Sur de vouloir effacer le morceau actuellement joué ? (o/oui/y/yes // n/no/non) ' 18 | # read reponse 19 | 20 | # if [[ $reponse = (o|oui|y|yes) ]] 21 | # then 22 | # cmd-tune rm 23 | # fi 24 | 25 | # }}} 26 | 27 | cmd-chanson command rm -i 28 | -------------------------------------------------------------------------------- /self/bin/filesys/chezmoi-to-plain.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | cd ~/racine/self/chezmoi/source 4 | 5 | for file in **/symlink_* 6 | do 7 | link=\$HOME/$file 8 | link=${link//.tmpl/} 9 | link=${link//symlink_/} 10 | link=${link//private_/} 11 | link=${link//dot_/.} 12 | target=$(<$file) 13 | target=${target//{{ .chezmoi.homeDir }}/\$HOME} 14 | target=${target//{{ .chezmoi.hostname }}/\$HOST} 15 | target=${target//{{ .chezmoi.sourceDir }}/\$HOME/racine/self/chezmoi/source} 16 | printf '%s\t%s\n' $link $target 17 | done 18 | -------------------------------------------------------------------------------- /shell/multimedia/handbrake.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # vim: set conceallevel=0 : 4 | 5 | (( $# == 0 )) && { 6 | 7 | echo "handbrake.zsh film titre audio" 8 | exit 0 9 | } 10 | 11 | film=$1 12 | 13 | titre=${2:-1} 14 | audio=${3:-1} 15 | 16 | # lsdvd -as -t $titre /dev/sr0 17 | 18 | echo "HandBrakeCLI -i /dev/sr0 -o $PWD/$film.mkv -f av_mkv -t $titre -N fra -s scan -F -a $audio" 19 | echo 20 | 21 | HandBrakeCLI -i /dev/sr0 -o $PWD/$film.mkv -f av_mkv -t $titre -N fra -s scan -F -a $audio 22 | 23 | mkvinfo $film.mkv 24 | -------------------------------------------------------------------------------- /shell/multimedia/timidity-mp3.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | argumen=($@) 4 | 5 | # Aide {{{1 6 | 7 | [ $#argumen -eq 0 ] && { 8 | echo Usage : $0 ' file(s)' 9 | echo 10 | echo Convert midi files to ogg 11 | exit 0 12 | } 13 | 14 | # }}}1 15 | 16 | # Boucle {{{1 17 | 18 | for midi in $=argumen 19 | do 20 | mpthree=${midi%.midi}.mp3 21 | echo 22 | echo "timidity -s 44100 -Ow $midi -o - | lame -q 0 -b 128 - - > $mpthree" 23 | echo 24 | timidity -Ow $midi -o - | lame -q 0 -b 128 - - > $mpthree 25 | done 26 | 27 | # }}}1 28 | -------------------------------------------------------------------------------- /automat/log-notifications.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # credit : https://askubuntu.com/questions/770218/how-can-i-log-all-notify-send-actions 4 | 5 | file=$1 6 | 7 | dbus-monitor "interface='org.freedesktop.Notifications'" |\ 8 | grep --line-buffered "string" |\ 9 | grep --line-buffered -e method -e ":" -e '""' -e urgency -e notify -v |\ 10 | grep --line-buffered '.*(?=string)|(?<=string).*' -oPi |\ 11 | grep --line-buffered -v '^\s*$' |\ 12 | grep --line-buffered -v 'sender-pid' |\ 13 | xargs -I '{}' printf "$(date)\n{}\n" >> $file 14 | -------------------------------------------------------------------------------- /fun/zsh/autoload/multimedia/rm-papierpeint: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options de zsh 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | setopt extended_glob 12 | 13 | # }}} 14 | 15 | # {{{ Remplacé par rm -i 16 | 17 | # echo -n 'Sur de vouloir effacer le morceau actuellement joué ? (o/oui/y/yes // n/no/non) ' 18 | # read reponse 19 | 20 | # if [[ $reponse = (o|oui|y|yes) ]] 21 | # then 22 | # cmd-pic rm 23 | # fi 24 | 25 | # }}} 26 | 27 | cmd-papierpeint command rm -i 28 | -------------------------------------------------------------------------------- /shell/windenv/rofi-disconnect.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | menu=(Non Peut-être Oui) 4 | 5 | choix=$(print -l $menu | rofi -dmenu -p "Déconnexion ? " -i) 6 | 7 | [ $choix = Oui ] || exit 0 8 | 9 | winman=$(wmctrl -m | head -n 1 | cut -d ' ' -f 2) 10 | 11 | if [ $winman = i3 ] 12 | then 13 | i3-msg exit 14 | elif [ $winman = bspwm ] 15 | then 16 | bspwm-autostop.zsh &>>! ~/log/autostop.log 17 | bspc quit 18 | elif [ $winman = herbstluftwm ] 19 | then 20 | hlwm-autostop.zsh &>>! ~/log/autostop.log 21 | herbstclient quit 22 | fi 23 | -------------------------------------------------------------------------------- /site/eclats2vers/generic/musica/lilypond/Makefile: -------------------------------------------------------------------------------- 1 | # vim: set ft=make : 2 | 3 | include ../../Makefile.inc 4 | 5 | .DEFAULT_GOAL := sync-html 6 | 7 | # phony {{{1 8 | 9 | .PHONY: html sync-html 10 | 11 | # html {{{1 12 | 13 | html: sync-html 14 | 15 | # sync -> html dir {{{1 16 | 17 | dry-sync-html: $(LY_TMPL_FILES) $(LY_MLD_FILES) $(LY_GLOB_FILES) 18 | $(DRY_RSYNC) $(CUR_DIR)/ $(HTML_DIR) 19 | @$(ECHO) 20 | 21 | sync-html: $(LY_TMPL_FILES) $(LY_MLD_FILES) $(LY_GLOB_FILES) 22 | $(RSYNC) $(CUR_DIR)/ $(HTML_DIR) 23 | @$(ECHO) 24 | -------------------------------------------------------------------------------- /shell/windenv/dragon.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) 3 | # https://www.youtube.com/user/gotbletu 4 | # DESC: set dragon drag and drop program to be always on top 5 | # DEMO: https://youtu.be/ukIG_OVXa3Q 6 | # DEPEND: wmctrl sed gawk dragon (https://github.com/mwh/dragon) 7 | # REFF: 8 | 9 | dragon='dragon-drag-and-drop --on-top' 10 | 11 | if [ "$1" = -h ] || [ "$1" = --help ]; then 12 | $dragon --help | sed "s/dragon/${0##*/}/g" 13 | exit 0 14 | else 15 | $dragon "$@" 16 | fi 17 | -------------------------------------------------------------------------------- /shell/multiplex/skim-tmux-history.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | [[ $TERM = tmux* ]] || { 4 | 5 | echo "Not in tmux session" 6 | echo 7 | 8 | exit 0 9 | } 10 | 11 | fichier=~/racine/hist/skim/tmux-history 12 | 13 | sort $fichier | uniq >! $fichier.nouveau 14 | 15 | mv -f $fichier.nouveau $fichier 16 | 17 | commande=$( \ 18 | cat $fichier | \ 19 | sk --exact --color=bw \ 20 | ) 21 | 22 | (( $#commande == 0 )) && exit 0 23 | 24 | if [ $# > 0 -a x$1 = x-s ] 25 | then 26 | tmux send-keys " tmux $commande " 27 | else 28 | tmux $commande 29 | fi 30 | -------------------------------------------------------------------------------- /shell/convert/compact-vimwiki.sed: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S sed -f 2 | 3 | # vim:filetype=sed:nofoldenable: 4 | 5 | # Double empty lines 6 | # ------------------------------ 7 | 8 | : empty 9 | 10 | /^$/ { 11 | n 12 | : loop-empty 13 | /^$/ { 14 | d 15 | b loop-empty 16 | } 17 | } 18 | 19 | # Plain lists 20 | # ------------------------------ 21 | 22 | : list 23 | 24 | /^\s*[-+*]/ { 25 | : loop-list 26 | s/^\s*\*/\t\t-/ 27 | s/^\s*+/\t*/ 28 | n 29 | /^$/ ! b loop-list 30 | h 31 | d 32 | /^\s*[-+*]/ b loop-list 33 | H 34 | s/.*// 35 | x 36 | } 37 | -------------------------------------------------------------------------------- /shell/convert/org2vimwiki-folder.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | orgdir=${1:-~/racine/organ} 4 | wikidir=${2:-~/racine/wiki} 5 | 6 | cd $orgdir 7 | 8 | for folder in . **/*(/) 9 | do 10 | echo "cd $orgdir/$folder" 11 | cd $orgdir/$folder 12 | destdir=$wikidir/$folder 13 | [ -d $destdir ] || { 14 | echo "mkdir -p $destdir" 15 | mkdir -p $destdir 16 | } 17 | for orgfile in *.org 18 | do 19 | wikifile=${orgfile%%.*}.wiki 20 | echo "org2vimwiki.sed $orgfile >! $destdir/$wikifile" 21 | org2vimwiki.sed $orgfile >! $destdir/$wikifile 22 | done 23 | done 24 | -------------------------------------------------------------------------------- /shell/convert/vimwiki2org-folder.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | wikidir=${1:-~/racine/wiki} 4 | orgdir=${2:-~/racine/organ} 5 | 6 | cd $wikidir 7 | 8 | for folder in . **/*(/) 9 | do 10 | echo "cd $wikidir/$folder" 11 | cd $wikidir/$folder 12 | destdir=$orgdir/$folder 13 | [ -d $destdir ] || { 14 | echo "mkdir -p $destdir" 15 | mkdir -p $destdir 16 | } 17 | for wikifile in *.wiki 18 | do 19 | orgfile=${wikifile%%.*}.org 20 | echo "vimwiki2org.pl $wikifile >! $destdir/$orgfile" 21 | vimwiki2org.sed $wikifile >! $destdir/$orgfile 22 | done 23 | done 24 | -------------------------------------------------------------------------------- /self/bin/build/build-xmonad.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # {{{ Prérequis 4 | 5 | # sudo aptitude build-dep xmonad 6 | # sudo aptitude install cabal-install libxft-dev 7 | 8 | # }}} 9 | 10 | # {{{ Préconfig 11 | 12 | # Nécessaire dans certains dépôts pour générer le fichier configure 13 | 14 | #sh autogen.sh 15 | 16 | # }}} 17 | 18 | # {{{ Clean 19 | 20 | make clean 21 | make distclean 22 | 23 | # }}} 24 | 25 | # {{{ Configure 26 | 27 | ./configure 28 | 29 | # }}} 30 | 31 | # {{{ Make 32 | 33 | #make 34 | #make check 35 | #sudo make install 36 | 37 | # }}} 38 | -------------------------------------------------------------------------------- /shell/disk/rm-local-zsh.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | (( $# == 0 )) && { 4 | 5 | echo Usage : ${0##*/} version 6 | echo 7 | 8 | exit 9 | } 10 | 11 | version=$1 12 | 13 | # {{{ Dossiers 14 | 15 | dossiers=() 16 | 17 | dossiers+=(/usr/local/lib/zsh) 18 | dossiers+=(/usr/local/share/zsh) 19 | 20 | # }}} 21 | 22 | echo "sudo rm -f /usr/local/bin/zsh-$version" 23 | echo 24 | 25 | sudo rm -f /usr/local/bin/zsh-$version 26 | 27 | for reper in $dossiers 28 | do 29 | echo "sudo rm -rf $reper/$version" 30 | echo 31 | 32 | sudo rm -rf $reper/$version 33 | done 34 | -------------------------------------------------------------------------------- /shell/multimedia/hardlink-image.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # vim: set conceallevel=0 : 4 | 5 | repertoire=$1 6 | 7 | (( $#repertoire > 0 )) || repertoire=$(zenity --file-selection --directory) 8 | 9 | (( $#repertoire > 0 )) || exit 0 10 | 11 | echo "cd $repertoire" 12 | echo 13 | 14 | cd $repertoire 15 | 16 | fichiers=($(print -l *(.) | sxiv -tio)) 17 | 18 | destination=$(zenity --file-selection --directory) 19 | 20 | (( $#destination > 0 )) || exit 0 21 | 22 | for fich in $fichiers 23 | do 24 | [ -e $destination/$fich ] || ln $fich $destination 25 | done 26 | -------------------------------------------------------------------------------- /shell/multimedia/new-score.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | [ $# -gt 0 ] || { 4 | echo Usage : $0 score-title [measure-type [3-2-4]] 5 | echo 6 | exit 0 7 | } 8 | 9 | title=$1 10 | measure=${2:-"3-2-4"} 11 | 12 | echo "cd ~/racine/musica/lilypond/template" 13 | echo 14 | cd ~/racine/musica/lilypond/template 15 | 16 | echo "cp -i meta.ly ../score/$title.ly" 17 | echo 18 | cp -i meta.ly ../score/$title.ly 19 | 20 | echo "cp -i melody/mel-$measure.mld.ly ../score/melody/$title-$measure.mld.ly" 21 | echo 22 | cp -i melody/mel-$measure.mld.ly ../score/melody/$title.mld.ly 23 | -------------------------------------------------------------------------------- /shell/multimedia/sxiv-move-image.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # vim: set conceallevel=0 : 4 | 5 | repertoire=$1 6 | 7 | (( $#repertoire > 0 )) || repertoire=$(zenity --file-selection --directory) 8 | 9 | (( $#repertoire > 0 )) || exit 0 10 | 11 | echo "cd $repertoire" 12 | echo 13 | 14 | cd $repertoire 15 | 16 | fichiers=($(print -l *(.) | sxiv -tio)) 17 | 18 | destination=$(zenity --file-selection --directory) 19 | 20 | (( $#destination > 0 )) || exit 0 21 | 22 | for fich in $fichiers 23 | do 24 | [ -e $destination/$fich ] || mv $fich $destination 25 | done 26 | -------------------------------------------------------------------------------- /shell/network/fix-ethernet-r8168.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # credit : https://askubuntu.com/questions/1029250/ubuntu-18-04-ethernet-disconnected-after-suspend 4 | # make it executable and copy it to /lib/systemd/system-sleep/ 5 | 6 | PROGNAME=$(basename "$0") 7 | state=$1 8 | action=$2 9 | 10 | function log { 11 | logger -i -t "$PROGNAME" "$*" 12 | } 13 | 14 | log "Running $action $state" 15 | 16 | if [[ $state == post ]]; then 17 | modprobe -r r8169 \ 18 | && log "Removed r8169" \ 19 | && modprobe -i r8169 \ 20 | && log "Inserted r8169" 21 | fi 22 | -------------------------------------------------------------------------------- /shell/run/run-neomutt.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | temps=${1:-300} 4 | 5 | alias psgrep='ps auxww | /bin/grep -v grep | /bin/grep --color=never' 6 | 7 | pid=invalid 8 | 9 | psgrep deliver-mail.sh || { 10 | 11 | echo "Launching deliver-mail.sh" 12 | echo 13 | 14 | deliver-mail.sh $temps & 15 | 16 | pid=$! 17 | } 18 | 19 | # echo "Synchronisation IMAP" 20 | # mbsync -a 21 | 22 | cd ~/racine/mail 23 | 24 | neomutt "$@" 25 | 26 | echo 27 | 28 | [ $pid = invalid ] || { 29 | 30 | echo "Stopping deliver-mail.sh" 31 | echo 32 | 33 | kill -TERM $pid 34 | } 35 | -------------------------------------------------------------------------------- /shell/windenv/rofi-clavier.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | setopt extended_glob 4 | 5 | menu=( 6 | "Personnel (hyper = menu, caps & esc inversés)" 7 | "Belge" 8 | "Français" 9 | "Américain" 10 | ) 11 | 12 | choix=$(print -l $menu | rofi -dmenu -p "Disposition du clavier " -i) 13 | 14 | case $choix in 15 | *Personnel*) 16 | setxkbmap be 17 | xmodmap ~/racine/config/windenv/xmodmap/belge-meta-super-hyper 18 | ;; 19 | *Belge*) 20 | setxkbmap be 21 | ;; 22 | *Français*) 23 | setxkbmap fr 24 | ;; 25 | *Américain*) 26 | setxkbmap us 27 | ;; 28 | esac 29 | -------------------------------------------------------------------------------- /shell/disk/rm-local-emacs.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | (( $# == 0 )) && { 4 | 5 | echo Usage : ${0##*/} version 6 | echo 7 | 8 | exit 9 | } 10 | 11 | version=$1 12 | 13 | # {{{ Dossiers 14 | 15 | dossiers=() 16 | 17 | dossiers+=(/usr/local/libexec/emacs) 18 | dossiers+=(/usr/local/share/emacs) 19 | 20 | # }}} 21 | 22 | echo "sudo rm -f /usr/local/bin/emacs-$version" 23 | echo 24 | 25 | sudo rm -f /usr/local/bin/emacs-$version 26 | 27 | for reper in $dossiers 28 | do 29 | echo "sudo rm -rf $reper/$version" 30 | echo 31 | 32 | sudo rm -rf $reper/$version 33 | done 34 | -------------------------------------------------------------------------------- /shell/multimedia/sxiv-copy-image.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # vim: set conceallevel=0 : 4 | 5 | repertoire=$1 6 | 7 | (( $#repertoire > 0 )) || repertoire=$(zenity --file-selection --directory) 8 | 9 | (( $#repertoire > 0 )) || exit 0 10 | 11 | echo "cd $repertoire" 12 | echo 13 | 14 | cd $repertoire 15 | 16 | fichiers=($(print -l *(.) | sxiv -tio)) 17 | 18 | destination=$(zenity --file-selection --directory) 19 | 20 | (( $#destination > 0 )) || exit 0 21 | 22 | for fich in $fichiers 23 | do 24 | [ -e $destination/$fich ] || command cp $fich $destination 25 | done 26 | -------------------------------------------------------------------------------- /shell/run/dmenurun.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | lignes=${1:-'30'} 4 | 5 | #exe=`dmenu_path | dmenu ${1+"$@"}` && exec $exe 6 | 7 | #exe=`dmenu_path | dmenu -l $lignes -fn '-*-*-*-*-*-*-17-*-*-*-*-*-*-*' ${1+"$@"}` && exec $exe 8 | #exe=`dmenu_path | dmenu -l $lignes -fn '-*-terminal-*-*-*-*-17-*-*-*-*-*-*-*' ${1+"$@"}` && exec $exe 9 | 10 | exe=`dmenu_path | \ 11 | dmenu -l $lignes \ 12 | -b -i \ 13 | -p "dmenu > " \ 14 | -nb black -nf '#5b3c11' \ 15 | -sb '#5b3c11' -sf black \ 16 | -fn '-*-latin modern sansquotation-*-*-*-*-17-*-*-*-*-*-*-*' ${1+"$@"}` \ 17 | && exec $exe 18 | -------------------------------------------------------------------------------- /shell/fileman/vifmrun: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -z "$(command -v vifm)" ]; then 4 | printf "vifm isn't installed on your system!\n" 5 | exit 1 6 | elif [ -z "$(command -v ueberzug)" ]; then 7 | exec vifm "$@" 8 | else 9 | cleanup() { 10 | exec 3>&- 11 | rm "$FIFO_UEBERZUG" 12 | } 13 | [ ! -d "$HOME/.cache/vifm" ] && mkdir -p "$HOME/.cache/vifm" 14 | export FIFO_UEBERZUG="$HOME/.cache/vifm/ueberzug-${$}" 15 | mkfifo "$FIFO_UEBERZUG" 16 | ueberzug layer -s <"$FIFO_UEBERZUG" -p json & 17 | exec 3>"$FIFO_UEBERZUG" 18 | trap cleanup EXIT 19 | vifm "$@" 3>&- 20 | vifmimg clear 21 | fi 22 | -------------------------------------------------------------------------------- /shell/run/run-emacs-server.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | { 4 | echo 5 | echo "------------------------------------------------------------" 6 | echo 7 | date +" [=] %A %d %B %Y (o) %H : %M : %S | %:z | " 8 | echo 9 | } >> ~/log/emacs-server.log 2>&1 10 | 11 | pgrep 'emacs.*daemon' > ~/log/psgrep.log 2>&1 && { 12 | echo 'emacs is already running' 13 | echo 14 | exit 0 15 | } >> ~/log/emacs-server.log 2>&1 16 | 17 | initdir=~/racine/dotdir/emacs.d 18 | 19 | echo Init directory : $initdir 20 | echo 21 | 22 | exec emacs --init-directory $initdir --daemon >> ~/log/emacs-server.log 2>&1 23 | -------------------------------------------------------------------------------- /self/bin/build/build-weechat.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # {{{ Documentation 4 | 5 | # }}} 6 | 7 | # {{{ Prérequis 8 | 9 | # sudo aptitude build-dep weechat 10 | 11 | # }}} 12 | 13 | # {{{ Préconfig 14 | 15 | cd ~/source/chaton/weechat 16 | 17 | [ -d build ] || mkdir build 18 | 19 | cd build 20 | 21 | # }}} 22 | 23 | # {{{ Clean 24 | 25 | make clean 26 | 27 | # }}} 28 | 29 | # {{{ Config 30 | 31 | cmake .. -DPREFIX=/usr/local -DCMAKE_BUILD_TYPE=Debug 32 | 33 | #cmake .. -DPREFIX=/usr/local 34 | 35 | # }}} 36 | 37 | # {{{ Make 38 | 39 | #make 40 | #sudo make install 41 | 42 | # }}} 43 | -------------------------------------------------------------------------------- /shell/edit/vim-lite.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | #exec vim \ 4 | # -u ~/racine/config/edit/vim-lite/vimrc \ 5 | # --cmd 'let &runtimepath = substitute(&runtimepath, $HOME."/\.vim", "$HOME/.vim-lite", "g")' \ 6 | # --cmd 'let &packpath = substitute(&packpath, $HOME."/\.vim", "$HOME/.vim-lite", "g")' \ 7 | # "$@" 8 | 9 | exec vim \ 10 | -u ~/racine/config/edit/vim-lite/vimrc \ 11 | --cmd 'let &runtimepath = substitute(&runtimepath, $HOME."/\.config/vim", "$HOME/.config/vim-lite", "g")' \ 12 | --cmd 'let &packpath = substitute(&packpath, $HOME."/\.config/vim", "$HOME/.config/vim-lite", "g")' \ 13 | "$@" 14 | -------------------------------------------------------------------------------- /shell/multiplex/dialog-tmux-session.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | liste=(~/racine/config/multiplex/tmux/session/*) 4 | 5 | numero=1 6 | tagitem=() 7 | 8 | for element in $~liste 9 | do 10 | tagitem+=($numero $element) 11 | (( numero += 1 )) 12 | done 13 | 14 | exec 3>&1 15 | choix=$(dialog --menu "Liste" 0 0 0 $=tagitem 2>&1 1>&3) 16 | exec 3>&- 17 | 18 | code=$? 19 | 20 | fichier=$~liste[$choix] 21 | 22 | echo Fichier : $fichier 23 | echo 24 | 25 | (( $code > 0)) && exit 1 26 | 27 | (( $#fichier == 0 )) && exit 0 28 | 29 | echo Fichier : $fichier 30 | echo 31 | 32 | tmux source-file $fichier 33 | -------------------------------------------------------------------------------- /shell/sync/save-unison-config.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | args="$@" 4 | 5 | syncron () { 6 | rsync \ 7 | --verbose \ 8 | --progress \ 9 | --stats \ 10 | --human-readable \ 11 | --itemize-changes \ 12 | --log-file="$HOME/log/rsync.log" \ 13 | --rsh=ssh \ 14 | --recursive \ 15 | --modify-window=1 \ 16 | --owner \ 17 | --group \ 18 | --times \ 19 | --perms \ 20 | --links \ 21 | --update \ 22 | "$@" 23 | } 24 | 25 | echo "syncron $args ~/racine/config/sync/unison/ ~/racine/syncron/unison/$HOST" 26 | echo 27 | syncron $args ~/racine/config/sync/unison/ ~/racine/syncron/unison/$HOST 28 | -------------------------------------------------------------------------------- /shell/edit/gvim-lite.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # exec gvim -f \ 4 | # -u ~/racine/config/edit/vim-lite/vimrc \ 5 | # --cmd 'let &runtimepath = substitute(&runtimepath, $HOME."/\.vim", "$HOME/.vim-lite", "g")' \ 6 | # --cmd 'let &packpath = substitute(&packpath, $HOME."/\.vim", "$HOME/.vim-lite", "g")' \ 7 | # "$@" 8 | 9 | exec gvim -f \ 10 | -u ~/racine/config/edit/vim-lite/vimrc \ 11 | --cmd 'let &runtimepath = substitute(&runtimepath, $HOME."/\.config/vim", "$HOME/.config/vim-lite", "g")' \ 12 | --cmd 'let &packpath = substitute(&packpath, $HOME."/\.config/vim", "$HOME/.config/vim-lite", "g")' \ 13 | "$@" 14 | -------------------------------------------------------------------------------- /shell/windenv/rofi-close-window.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | menu=(Annuler "Fermer la fenêtre courante" "Choisir une fenêtre à fermer") 4 | 5 | # Rofi dmenu {{{1 6 | 7 | choix=$(print -l $menu | rofi -dmenu -p "fermer " -i) 8 | 9 | # }}}1 10 | 11 | [[ $choix = "Fermer la fenêtre courante" ]] && { 12 | 13 | winman=$(wmctrl -m | head -n 1 | cut -d ' ' -f 2) 14 | 15 | if [ $winman = i3 ] 16 | then 17 | i3-msg kill 18 | elif [ $winman = bspwm ] 19 | then 20 | bspc node -c 21 | fi 22 | 23 | } 24 | 25 | [[ $choix = "Choisir une fenêtre à fermer" ]] && { 26 | 27 | echo "xkill" 28 | echo 29 | 30 | xkill 31 | } 32 | -------------------------------------------------------------------------------- /shell/windenv/rofi-combi.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | #print -l $path 4 | 5 | # Modi disponibles : 6 | # 7 | # drun 8 | 9 | # exec rofi \ 10 | # -modi run,window,ssh,keys,combi \ 11 | # -combi-modi window,run \ 12 | # -show run \ 13 | # -sidebar-mode \ 14 | # -scroll-method 1 \ 15 | # -matching glob \ 16 | # -no-show-match \ 17 | # -lines 15 \ 18 | # -width 60 \ 19 | # -location 0 \ 20 | # -multi-select \ 21 | # -terminal lxterminal 22 | 23 | exec rofi \ 24 | -show combi \ 25 | -mesg "Shift + Gauche ou Droite pour changer de rubrique" \ 26 | -p "combi " 27 | -theme ~/racine/config/terminal/rofi/theme.rasi 28 | -------------------------------------------------------------------------------- /shell/crypte/gpg-export.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | [ $# -eq 0 ] && { 4 | echo Usage : $0 userid 5 | echo 6 | exit 1 7 | } 8 | 9 | userid=$1 10 | 11 | echo Exporting in gpg format 12 | echo 13 | 14 | gpg --export --output $userid.gpg $userid 15 | gpg --export-secret-key --output $userid-secret.gpg $userid 16 | gpg --export-secret-subkeys --output $userid-subkeys.gpg $userid 17 | 18 | echo Exporting in ascii format 19 | echo 20 | 21 | gpg --export --armor --output $userid.asc $userid 22 | gpg --export-secret-key --armor --output $userid-secret.asc $userid 23 | gpg --export-secret-subkeys --armor --output $userid-subkeys.asc $userid 24 | -------------------------------------------------------------------------------- /fun/zsh/autoload/multimedia/cmd-papierpeint: -------------------------------------------------------------------------------- 1 | 2 | # vim: set filetype=zsh : 3 | 4 | # {{{ Options de zsh 5 | 6 | emulate -R zsh 7 | 8 | setopt local_options 9 | 10 | setopt warn_create_global 11 | 12 | setopt null_glob 13 | 14 | # }}} 15 | 16 | local note racine commande nom fichier 17 | 18 | note='0' 19 | racine=~/graphix 20 | 21 | commande=${*:-file} 22 | 23 | commande=($=commande) 24 | 25 | # {{{ Papier peint actuel 26 | 27 | fichier=`sed -n '/.*:.*:.*/p' ~/log/wallpaper.log | tail -n 1 ` 28 | fichier=${fichier##*:} 29 | fichier=${fichier// } 30 | 31 | # }}} 32 | 33 | echo $commande $fichier 34 | echo 35 | 36 | $commande $fichier 37 | -------------------------------------------------------------------------------- /fun/zsh/autoload/multimedia/cmd-chanson: -------------------------------------------------------------------------------- 1 | 2 | # vim: set filetype=zsh : 3 | 4 | # {{{ Options de zsh 5 | 6 | emulate -R zsh 7 | 8 | setopt local_options 9 | 10 | setopt warn_create_global 11 | 12 | setopt null_glob 13 | 14 | # }}} 15 | 16 | local note racine commande nom fichier 17 | 18 | note='0' 19 | racine=~/audio 20 | 21 | commande=${*:-file} 22 | #commande=${@:-file} 23 | 24 | commande=($=commande) 25 | 26 | # {{{ Morceau actuellement joué 27 | 28 | nom=`mpc -f "%file%" | awk '{ if ( NR == 1 ) print $0 }'` 29 | 30 | fichier=${racine}/${nom} 31 | 32 | # }}} 33 | 34 | echo $commande $fichier 35 | echo 36 | 37 | $commande $fichier 38 | -------------------------------------------------------------------------------- /shell/windenv/zen-wego.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | export PATH=$PATH:~/racine/bin/go/bin 4 | 5 | fichier=~/log/wego.log 6 | 7 | choix=$(zenity --list --text "Que faire ?" --radiolist --column "Choix" --column "Action" TRUE "Afficher" FALSE "Rafraîchir" ) 8 | 9 | echo Choix : $choix 10 | 11 | (( $#choix == 0 )) && exit 0 12 | 13 | [ $choix = Rafraîchir ] && { 14 | 15 | echo 16 | echo "==================================" 17 | echo " " $(date +"%H : %M %A %d %B %Y") 18 | echo "==================================" 19 | echo 20 | 21 | wego 22 | 23 | } >>! $fichier 24 | 25 | urxvtc -name meteo -geometry 130x43 -e less -f -r +G $fichier 26 | -------------------------------------------------------------------------------- /automat/update-vim-tags.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | setopt null_glob 4 | 5 | date +" [=] %A %d %B %Y (o) %H:%M | %:z | " 6 | 7 | directory=${1:-.} 8 | 9 | cd $directory 10 | 11 | # Git {{{1 12 | 13 | for folder in *(/) 14 | do 15 | echo "" 16 | echo "------------------------------------" 17 | echo "" 18 | 19 | echo "cd $folder" 20 | echo 21 | cd $folder 22 | 23 | [ -d doc ] || { 24 | cd - 25 | continue 26 | } 27 | 28 | echo "vim -u NONE +'helptags doc' +q" 29 | echo 30 | vim -u NONE +'helptags doc' +q 31 | 32 | cd - 33 | done 34 | 35 | # Fin {{{1 36 | 37 | echo "" 38 | echo "====================================" 39 | echo "" 40 | -------------------------------------------------------------------------------- /shell/convert/pdf-ocr-docx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # convert pdf containing images to text using ocr 4 | 5 | pdffile=$1 6 | head=${pdffile%.*} 7 | 8 | echo "pdftoppm $pdffile $head -png" 9 | pdftoppm $pdffile $head -png 10 | 11 | for pngfile in $head-*.png 12 | do 13 | pnghead=${pngfile%.*} 14 | echo "tesseract $pngfile $pnghead --dpi 150" 15 | tesseract $pngfile $pnghead --dpi 150 16 | done 17 | 18 | textfile=$head.txt 19 | 20 | echo "cat $head-*.txt > $textfile" 21 | cat $head-*.txt > $textfile 22 | 23 | # convert text to docx with pandoc 24 | 25 | docxfile=$head.docx 26 | 27 | echo "pandoc -t docx $textfile > $docxfile" 28 | pandoc -t docx $textfile > $docxfile 29 | -------------------------------------------------------------------------------- /shell/run/run-mpv-server.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # {{{ Options 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | # }}} 12 | 13 | # Déjà lancé ? {{{1 14 | 15 | alias psgrep="ps auxww | grep -v grep | grep --color=never" 16 | 17 | psgrep 'mpv --idle --input-file' &> /dev/null && { 18 | 19 | echo "mpv tourne déjà" 20 | echo 21 | 22 | exit 0 23 | } 24 | 25 | # }}}1 26 | 27 | local tube=~/racine/run/pipe/mpv 28 | 29 | [[ -p $tube ]] || { 30 | 31 | [[ -e $tube ]] && rm -f $tube 32 | 33 | mkdir -p ~/racine/run/pipe 34 | 35 | mkfifo $tube 36 | } 37 | 38 | mpv --idle --input-file=$tube &>>! ~/log/mpv.log &! 39 | -------------------------------------------------------------------------------- /shell/backup/restic-backup.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # necessary because ~/racine/index/backup/restic/include 4 | # contains paths relative to home directory 5 | cd || exit 0 6 | 7 | # see also 8 | 9 | repo=${1:-$RESTIC_REPOSITORY} 10 | 11 | [ $# -gt 0 ] && shift 12 | 13 | echo 14 | echo restic backup 15 | echo 16 | 17 | restic \ 18 | -r "$repo" \ 19 | backup \ 20 | --verbose=2 \ 21 | --files-from ~/racine/index/backup/restic/include \ 22 | --exclude-file ~/racine/index/backup/restic/exclude \ 23 | "$@" | tee -a ~/log/restic.log 24 | 25 | restic-forget-prune.sh "$repo" 26 | restic-check.sh "$repo" 27 | -------------------------------------------------------------------------------- /shell/network/wget-blog.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | level=$1 4 | domains=$2 5 | site=$3 6 | 7 | wget \ 8 | --no-parent \ 9 | --page-requisites \ 10 | --ignore-case \ 11 | --reject .mid,.midi,.mp3,.ogg,.wav,.ogv,.m4v,.webm,.swf,.flv,.zip,.tar.gz,.tar.bz2 \ 12 | --user-agent=firefox \ 13 | --progress=bar \ 14 | --recursive \ 15 | --level=$level \ 16 | --wait=3 \ 17 | --random-wait \ 18 | --convert-links \ 19 | --adjust-extension \ 20 | --timestamping \ 21 | --no-remove-listing \ 22 | --backups=0 \ 23 | --span-hosts \ 24 | --domains=$domains \ 25 | --exclude-directories=page,category,author,comments,feed,tag,feed \ 26 | -b \ 27 | -o wget.log \ 28 | $site 29 | -------------------------------------------------------------------------------- /automat/horodate.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # vim: set filetype=zsh : 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | temps=$(date +" [=] %A %d %B %Y (o) %H:%M | %:z | ") 10 | 11 | (( marge = 72 - ${#temps} )) 12 | 13 | echo "" 14 | echo "========================================================================" 15 | 16 | (( milieu = 0.5 * marge )) 17 | 18 | for (( i = 0 ; i < milieu ; i++ )) 19 | do 20 | echo -n "=" 21 | done 22 | 23 | echo -n $temps 24 | 25 | for (( j = i + 1 ; j <= marge ; j++ )) 26 | do 27 | echo -n "=" 28 | done 29 | 30 | echo "" 31 | 32 | echo "========================================================================" 33 | echo "" 34 | -------------------------------------------------------------------------------- /fun/zsh/zle/biblio-repertoires: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options de zsh 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | setopt extended_glob 12 | 13 | setopt pushd_ignore_dups 14 | setopt pushd_minus 15 | 16 | unsetopt chase_links 17 | 18 | # }}} 19 | 20 | local choix repertoires 21 | 22 | repertoires=( ${(f)"$(dirs -v)"} ) 23 | 24 | choix=$(print -l $repertoires | \ 25 | awk '{print $2}' | \ 26 | sed 's:~/:'$HOME'/:g' | \ 27 | uniq | \ 28 | fzf --cycle --color=bw --prompt='folder> ' 29 | ) 30 | 31 | (( $#choix == 0 )) && return 0 32 | 33 | LBUFFER="builtin pushd $~choix >& /dev/null" 34 | 35 | zle accept-line 36 | -------------------------------------------------------------------------------- /self/bin/build/build-wmii.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # {{{ Prérequis 4 | 5 | # sudo aptitude install txt2tags 6 | 7 | # Ajouter : -ldl à la ligne : 8 | # 9 | # [ -n "$PACKAGES" ] && LDFLAGS="$LDFLAGS $(pkg-config --libs $PACKAGES) -ldl" 10 | # 11 | # dans : 12 | # 13 | # util/link 14 | 15 | # }}} 16 | 17 | # {{{ Clean 18 | 19 | cd ~/source/winman/libixp 20 | 21 | make clean 22 | 23 | cd ~/source/winman/wmii 24 | 25 | make clean 26 | 27 | # }}} 28 | 29 | # {{{ Librairies 30 | 31 | cd ~/source/winman/libixp 32 | 33 | make 34 | 35 | sudo make install 36 | 37 | # }}} 38 | 39 | # {{{ Make 40 | 41 | cd ~/source/winman/wmii 42 | 43 | make 44 | 45 | sudo make install 46 | 47 | # }}} 48 | -------------------------------------------------------------------------------- /self/bin/install/install-pip-packages.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | pipdir=${1:-~/.pip} 4 | 5 | if [ -e $pipdir ] 6 | then 7 | echo $pipdir already exists 8 | echo 9 | else 10 | echo "python -m venv $pipdir" 11 | echo 12 | python -m venv $pipdir 13 | fi 14 | 15 | echo "pip install --upgrade pip" 16 | echo 17 | pip install --upgrade pip 18 | 19 | packages=( 20 | pikaur 21 | tldextract # for qute-pass 22 | getmail 23 | edir 24 | neovim-remote 25 | vimiv 26 | 'aria2p[tui]' 27 | readability 28 | wptranslate 29 | eg 30 | zxcvbn pyaml 31 | mausoleum 32 | py3exiv2 piexif 33 | yt-dlp 34 | ) 35 | 36 | echo "pip install --upgrade $=packages" 37 | echo 38 | pip install --upgrade $=packages 39 | -------------------------------------------------------------------------------- /shell/multiplex/fzf-tmux-command.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | [[ $TERM = tmux* ]] || { 4 | echo "Not in tmux session" 5 | echo 6 | exit 0 7 | } 8 | 9 | export FZF_DEFAULT_OPTS=' 10 | -i 11 | --exact 12 | --info=hidden 13 | --layout=reverse 14 | --scroll-off=5 15 | --tiebreak=index 16 | --bind=alt-space:toggle+down,shift-tab:toggle+down 17 | --bind=alt-a:toggle-all 18 | --bind=ctrl-s:toggle-sort 19 | --bind=ctrl-u:end-of-line+unix-line-discard 20 | --bind=home:first,end:last 21 | --color=bw 22 | ' 23 | 24 | commande=$(tmux list-commands | fzf | cut -d " " -f 1) 25 | 26 | (( $#commande == 0 )) && exit 0 27 | 28 | echo "$commande" >>! ~/racine/hist/fzf/tmux-history 29 | 30 | tmux $commande 31 | -------------------------------------------------------------------------------- /shell/windenv/zen-wttr-in.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | lieu=${1:-Paris} 4 | 5 | export PATH=$PATH:~/racine/bin/go/bin 6 | 7 | fichier=~/log/wttr-in.log 8 | 9 | choix=$(zenity --list --text "Que faire ?" --radiolist --column "Choix" --column "Action" TRUE "Afficher" FALSE "Rafraîchir" ) 10 | 11 | echo Choix : $choix 12 | 13 | (( $#choix == 0 )) && exit 0 14 | 15 | [ $choix = Rafraîchir ] && { 16 | 17 | echo 18 | echo "==================================" 19 | echo " " $(date +"%H : %M %A %d %B %Y") 20 | echo "==================================" 21 | echo 22 | 23 | curl wttr.in/$lieu 2>~/log/wttr-in.err.log 24 | 25 | } >>! $fichier 26 | 27 | urxvtc -geometry 130x47 -e less -f +G $fichier 28 | -------------------------------------------------------------------------------- /shell/multiplex/fzf-tmux-new-tui.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | [[ $TERM = tmux* ]] || { 4 | 5 | echo "Not in tmux session" 6 | echo 7 | 8 | exit 0 9 | } 10 | 11 | choices=( 12 | vim 13 | nvim 14 | 'emacs -nw -q -l ~/racine/config/edit/emacs/leger.el' 15 | vidir 16 | edir 17 | vifm 18 | htop 19 | bpytop 20 | w3m 21 | lazygit 22 | sc-im 23 | elinks 24 | run-neomutt.zsh 25 | 'newsboat -c ~/racine/index/newsboat/cache.db' 26 | aria2p 27 | abook 28 | calcurse 29 | 'alsamixer -c 0' 30 | pulsemixer 31 | ncpamixer 32 | ncmpcpp 33 | cmus 34 | mocp 35 | ) 36 | 37 | command=$(print -l $choices | fzf --prompt='tmux> ') 38 | 39 | (( $#command == 0 )) && exit 0 40 | 41 | tmux new-window $command 42 | -------------------------------------------------------------------------------- /shell/windenv/rofi-aller-vers-bureau.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | menu=() 4 | 5 | #fichier=~/racine/config/windenv/i3/bureaux 6 | #menu+=(${(f)"$(<$fichier)"}) 7 | 8 | menu+=(${(f)"$(wmctrl -d | cut -d' ' -f12- | sed 's/^ //')"}) 9 | menu=(${(u)menu}) 10 | 11 | # Rofi dmenu {{{1 12 | 13 | choix=$(print -l $menu | rofi -dmenu -p "aller vers le bureau " -i) 14 | 15 | # }}}1 16 | 17 | # Affichage {{{1 18 | 19 | echo choix : $choix 20 | echo 21 | 22 | # }}}1 23 | 24 | # Window Manager {{{1 25 | 26 | winman=$(wmctrl -m | head -n 1 | cut -d ' ' -f 2) 27 | 28 | if [ $winman = i3 ] 29 | then 30 | i3-msg workspace $choix 31 | elif [ $winman = bspwm ] 32 | then 33 | bspc desktop -f $choix 34 | fi 35 | 36 | # }}}1 37 | -------------------------------------------------------------------------------- /shell/alarm/chronometre.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | setopt extended_glob 4 | 5 | echo Use Ctrl-C to quit 6 | echo 7 | 8 | seconde=0 9 | minute=0 10 | heure=0 11 | 12 | echo '\t' $heure heu $minute min 13 | echo 14 | 15 | sleep 1 16 | 17 | while true 18 | do 19 | (( seconde += 1 )) 20 | 21 | echo -n '\t' $seconde 22 | 23 | (( seconde % 12 == 0 )) && echo 24 | 25 | (( seconde == 60 )) && { 26 | 27 | seconde=0 28 | 29 | (( minute += 1 )) 30 | 31 | echo 32 | echo '\t' $heure heu $minute min 33 | echo 34 | } 35 | 36 | (( minute == 60 )) && { 37 | 38 | minute=0 39 | 40 | (( heure += 1 )) 41 | 42 | echo 43 | echo '\t' $heure heu $minute min 44 | echo 45 | } 46 | 47 | sleep 1 48 | done 49 | -------------------------------------------------------------------------------- /snippet/hist/slackware.sh: -------------------------------------------------------------------------------- 1 | adduser # su 2 | installpkg paquet # su 3 | installpkg sbopkg-version-noarch-1_wsr.tgz # su 4 | pkgtool # su 5 | sbocheck # su 6 | sboconfig -r http://cgit.ponce.cc/slackbuilds/ # su 7 | sboinstall paquet # su 8 | sbopkg # su 9 | sbosnap fetch # su 10 | setup # su 11 | setup2hd # su 12 | slackpkg clean-system # su 13 | slackpkg info paquet # su 14 | slackpkg install-new # su 15 | slackpkg new-config # su 16 | slackpkg search paquet # su 17 | slackpkg update # su 18 | slackpkg update gpg # su 19 | slackpkg upgrade slackpkg # su 20 | slackpkg upgrade-all # su 21 | slpkg -g edit # su 22 | slpkg repo-enable # su 23 | slpkg update # su 24 | sqg -p paquet-source # su 25 | upgradepkg paquet # su 26 | xwmconfig 27 | -------------------------------------------------------------------------------- /fun/zsh/autoload/multimedia/vlc-shell: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # Interface de type CLI (Command Line Interface) 4 | # avec complétion & historique (grâce à rlwrap) 5 | # pour vlc en mode serveur 6 | 7 | # {{{ Options de zsh 8 | 9 | emulate -R zsh 10 | 11 | setopt local_options 12 | 13 | setopt warn_create_global 14 | 15 | # }}} 16 | 17 | local completion oublie 18 | 19 | #oublie='^ ' 20 | 21 | completion="rlwrap \ 22 | --no-children \ 23 | --complete-filenames \ 24 | --remember \ 25 | --prompt-colour=red \ 26 | --multi-line \ 27 | --case-insensitive \ 28 | --wait-before-prompt=-40 29 | --history-no-dupes 2 \ 30 | --histsize 84127 \ 31 | --command-name $0" 32 | 33 | $=completion netcat localhost 8080 "$@" 34 | -------------------------------------------------------------------------------- /shell/multimedia/dvd-avi.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | [ $# -eq 0 ] && { 4 | echo "Usage : ${0##*/} " 5 | 6 | exit 0 7 | } 8 | 9 | titre=$1 10 | device=$2 11 | audio=$3 12 | soustitre=$4 13 | fichier=$5 14 | 15 | echo "mencoder dvd://$titre -dvd-device $device \ 16 | -alang $audio -slang $soustitre \ 17 | -oac mp3lame -lameopts br=320:cbr -ovc lavc -lavcopts vcodec=mpeg4:vhq \ 18 | -vf scale -zoom -xy 800 \ 19 | -o ${fichier}.avi" 20 | 21 | echo 22 | 23 | mencoder dvd://$titre -dvd-device $device \ 24 | -alang $audio -slang $soustitre \ 25 | -oac mp3lame -lameopts br=320:cbr -ovc lavc -lavcopts vcodec=mpeg4:vhq \ 26 | -vf scale -zoom -xy 800 \ 27 | -o ${fichier}.avi 28 | -------------------------------------------------------------------------------- /automat/stat-econ.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # vim: set filetype=zsh : 4 | 5 | integer jour_mois jour_semaine 6 | 7 | jour_mois=`date +%d` 8 | jour_semaine=`date +%u` 9 | 10 | # {{{ BCE 11 | 12 | bce=0 13 | 14 | (( jour_semaine == 4 )) && (( jour_mois >= 1 )) && (( jour_mois <= 7 )) && bce=1 15 | 16 | # Sonnerie 17 | 18 | (( bce == 1 )) && bell.zsh ~/audio/sonnerie/finance/bce.ogg 19 | 20 | # Affichage 21 | 22 | echo " ------------------------------------" 23 | echo " BCE" 24 | echo " ------------------------------------" 25 | echo 26 | echo " Jour du mois : $jour_mois" 27 | echo 28 | echo " Jour de la semaine : $jour_semaine" 29 | echo 30 | echo " BCE : $bce" 31 | echo 32 | 33 | # }}} 34 | 35 | # Fini 36 | 37 | exit 0 38 | -------------------------------------------------------------------------------- /automat/audio-perm.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | dossier=${1:-~/audio} 4 | 5 | cd $dossier 6 | 7 | # echo chmod u+rwx **/*(/) | sed -e 's/\s\+/\n/g' | less 8 | # echo chmod go+rx **/*(/) | sed -e 's/\s\+/\n/g' | less 9 | # echo chmod go-w **/*(/) | sed -e 's/\s\+/\n/g' | less 10 | # echo 11 | # echo chmod u+rw **/*(.) | sed -e 's/\s\+/\n/g' | less 12 | # echo chmod u-x **/*(.) | sed -e 's/\s\+/\n/g' | less 13 | # echo 14 | # echo chmod go+r **/*(.) | sed -e 's/\s\+/\n/g' | less 15 | # echo chmod go-wx **/*(.) | sed -e 's/\s\+/\n/g' | less 16 | 17 | # ---- 18 | 19 | chmod u+rwx **/*(/) 20 | chmod go+rx **/*(/) 21 | chmod go-w **/*(/) 22 | 23 | chmod u+rw **/*(.) 24 | chmod u-x **/*(.) 25 | 26 | chmod go+r **/*(.) 27 | chmod go-wx **/*(.) 28 | -------------------------------------------------------------------------------- /automat/bspwm-subscribe.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # vim: set filetype=zsh: 4 | 5 | presel=0 6 | 7 | bspc subscribe node_add node_presel | \ 8 | while read ligne 9 | do 10 | date +"%H:%M:%S %d %m %Y" 11 | echo $ligne | grep node_presel | grep -v cancel &>/dev/null && 12 | { 13 | echo Presel on 14 | presel=1 15 | } 16 | echo $ligne | grep node_presel | grep cancel &>/dev/null && 17 | { 18 | echo Presel off 19 | echo Skipping next node added 20 | } 21 | if echo $ligne | grep node_add 22 | then 23 | if (( presel == 1 )) 24 | then 25 | presel=0 26 | else 27 | echo Going to big 28 | bspc node -f $(echo $ligne | awk '{print $5}') 29 | bspc node -s biggest.local 30 | fi 31 | fi 32 | done & 33 | -------------------------------------------------------------------------------- /fun/zsh/autoload/multimedia/ls-chanson: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options de zsh 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | zmodload zsh/regex 12 | 13 | setopt null_glob 14 | 15 | # }}} 16 | 17 | local note racine fanions nom repertoire 18 | 19 | note='0' 20 | racine=~/audio 21 | 22 | fanions=($*) 23 | 24 | # {{{ Morceau actuellement joué 25 | 26 | nom=`mpc -f "%file%" | awk '{ if ( NR == 1 ) print $0 }'` 27 | 28 | nom=${racine}/${nom} 29 | 30 | # }}} 31 | 32 | # {{{ Contenu du répertoire 33 | 34 | repertoire=${nom%/?*} 35 | 36 | [[ $repertoire = $nom ]] && repertoire=. 37 | 38 | echo "ls $=fanions $repertoire" 39 | echo 40 | 41 | ls $=fanions $repertoire 42 | 43 | # }}} 44 | -------------------------------------------------------------------------------- /shell/windenv/rofi-move-to-desktop.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | menu=() 4 | 5 | #fichier=~/racine/config/windenv/i3/bureaux 6 | #menu+=(${(f)"$(<$fichier)"}) 7 | 8 | menu+=(${(f)"$(wmctrl -d | cut -d ' ' -f12- | sed 's/^ //')"}) 9 | 10 | menu=(${(u)menu}) 11 | 12 | # Rofi dmenu {{{1 13 | 14 | choix=$(print -l $menu | rofi -dmenu -p "déplacer vers le bureau " -i) 15 | 16 | choix=${(j: :)choix} 17 | 18 | # }}}1 19 | 20 | # Affichage {{{1 21 | 22 | echo choix : $choix 23 | echo 24 | 25 | # }}}1 26 | 27 | # i3-msg {{{1 28 | 29 | winman=$(wmctrl -m | head -n 1 | cut -d ' ' -f 2) 30 | 31 | if [ $winman = i3 ] 32 | then 33 | i3-msg move workspace \"$choix\" 34 | elif [ $winman = bspwm ] 35 | then 36 | bspc node -d $choix 37 | fi 38 | 39 | # }}}1 40 | -------------------------------------------------------------------------------- /shell/windenv/rofi-rename-desktop.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | menu=() 4 | 5 | #fichier=~/racine/config/windenv/i3/bureaux 6 | #menu+=(${(f)"$(<$fichier)"}) 7 | 8 | menu+=(${(f)"$(wmctrl -d | cut -d' ' -f12- | sed 's/^ //')"}) 9 | 10 | menu=(${(u)menu}) 11 | 12 | # Rofi dmenu {{{1 13 | 14 | choix=$(print -l $menu | rofi -dmenu -p "nouveau nom pour le bureau " -i) 15 | 16 | choix=${(j: :)choix} 17 | 18 | # }}}1 19 | 20 | # Affichage {{{1 21 | 22 | echo choix : $choix 23 | echo 24 | 25 | # }}}1 26 | 27 | # Window Manager {{{1 28 | 29 | winman=$(wmctrl -m | head -n 1 | cut -d ' ' -f 2) 30 | 31 | if [ $winman = i3 ] 32 | then 33 | i3-msg rename workspace to \"$choix\" 34 | elif [ $winman = bspwm ] 35 | then 36 | # todo 37 | fi 38 | 39 | # }}}1 40 | -------------------------------------------------------------------------------- /shell/convert/vimwiki2org.sed: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S sed -f 2 | 3 | # vim:filetype=sed:nofoldenable: 4 | 5 | # Code 6 | # ------------------------------ 7 | 8 | s/`\([^`]\+\)`/~\1~/g 9 | 10 | # Links 11 | # ------------------------------ 12 | 13 | s/\[\[\([^]]*\)\|\([^]]*\)\]\]/[[\1][\2]]/g 14 | 15 | # Headers 16 | # ------------------------------ 17 | 18 | s/^====== \([^=]*\) ======$/****** \1 / 19 | s/^===== \([^=]*\) =====$/***** \1 / 20 | s/^==== \([^=]*\) ====$/**** \1 / 21 | s/^=== \([^=]*\) ===$/*** \1 / 22 | s/^== \([^=]*\) ==$/** \1 / 23 | s/^= \([^=]*\) =$/* \1 / 24 | 25 | # Multiple spaces 26 | 27 | /^\*.*$/! s/ \+/ /g 28 | 29 | # Replace other %% comments by # comments 30 | # --------------------------------------------- 31 | 32 | s/^%%\(.*\)$/# \1/ 33 | -------------------------------------------------------------------------------- /shell/multimedia/ffmpeg-video.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # vim: set conceallevel=0 : 4 | 5 | format=$1 6 | 7 | shift 8 | 9 | if false 10 | then 11 | : 12 | 13 | # {{{ AVI 14 | 15 | elif [ $format = "avi" ] 16 | then 17 | 18 | for entree in "$@" 19 | do 20 | sortie=${entree%.*}.$format 21 | 22 | echo "mencoder $entree \ 23 | -alang fr -slang none \ 24 | -oac mp3lame -lameopts br=320:cbr \ 25 | -ovc lavc -lavcopts vcodec=mpeg4:vhq \ 26 | -vf scale -zoom -xy 800 \ 27 | -o $sortie.avi" 28 | 29 | mencoder $entree \ 30 | -alang fr -slang none \ 31 | -oac mp3lame -lameopts br=320:cbr \ 32 | -ovc lavc -lavcopts vcodec=mpeg4:vhq \ 33 | -vf scale -zoom -xy 800 \ 34 | -o $sortie.avi 35 | done 36 | 37 | # }}} 38 | 39 | fi 40 | -------------------------------------------------------------------------------- /shell/windenv/rofi-bureau.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | setopt extended_glob 4 | 5 | menu=( 6 | "< Aller vers le bureau" 7 | "> Déplacer la fenêtre vers le bureau" 8 | "= Renommer le bureau" 9 | ) 10 | 11 | # Rofi dmenu {{{1 12 | 13 | choix=$(print -l $menu | rofi -dmenu -p "Menu : " -i) 14 | 15 | # }}}1 16 | 17 | # Affichage {{{1 18 | 19 | echo choix : $choix 20 | echo 21 | 22 | # }}}1 23 | 24 | case $choix in 25 | "< Aller vers le bureau") 26 | ~/racine/shell/dialog/rofi-aller-vers-bureau.zsh & disown 27 | ;; 28 | "> Déplacer la fenêtre vers le bureau") 29 | ~/racine/shell/dialog/rofi-deplace-vers-bureau.zsh & disown 30 | ;; 31 | "= Renommer le bureau") 32 | ~/racine/shell/dialog/rofi-renomme-bureau.zsh & disown 33 | ;; 34 | esac 35 | 36 | -------------------------------------------------------------------------------- /fun/zsh/autoload/multimedia/cd-chanson: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options de zsh 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | zmodload zsh/regex 12 | 13 | setopt null_glob 14 | 15 | # }}} 16 | 17 | local note racine nom repertoire 18 | 19 | note='0' 20 | racine=~/audio 21 | 22 | # {{{ Morceau actuellement joué 23 | 24 | nom=`mpc -f "%file%" | awk '{ if ( NR == 1 ) print $0 }'` 25 | 26 | nom=${racine}/${nom} 27 | 28 | # }}} 29 | 30 | # {{{ Changement de répertoire 31 | 32 | repertoire=${nom%/?*} 33 | 34 | [[ $repertoire = $nom ]] && repertoire=. 35 | 36 | echo "cd $repertoire" 37 | echo 38 | 39 | cd $repertoire || { echo "Le répertoire $repertoire n’existe pas !" ; return 1 } 40 | 41 | # }}} 42 | -------------------------------------------------------------------------------- /shell/multimedia/eval-song.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | emulate -R zsh 4 | setopt local_options 5 | setopt warn_create_global 6 | setopt null_glob 7 | zmodload zsh/regex 8 | 9 | path+=(~/racine/shell/filesys) 10 | 11 | evaluation='NONE' 12 | root=${1:-~/audio} 13 | 14 | evaluation=$(\ 15 | zenity \ 16 | --title "Song" \ 17 | --forms \ 18 | --add-entry "evaluation" \ 19 | ) 20 | 21 | [ $#evaluation -gt 0 ] || exit 0 22 | 23 | # Minuscules ? 24 | #evaluation=${evaluation:l} 25 | 26 | # Majuscules ? 27 | evaluation=${evaluation:u} 28 | 29 | name=`mpc -f "%file%" | awk '{ if ( NR == 1 ) print $0 }'` 30 | 31 | name=${root}/${name} 32 | 33 | info=$(evaluation.zsh $evaluation $name) 34 | 35 | #zenity --info --text="$info" 36 | 37 | echo $info >>| ~/log/eval-song.log 38 | -------------------------------------------------------------------------------- /self/bin/version/clone-plugin-source.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | cd ~/racine/plugin/source 4 | 5 | [[ -d modalka ]] || { 6 | 7 | echo "git clone https://github.com/mrkkrp/modalka" 8 | 9 | git clone https://github.com/mrkkrp/modalka 10 | } 11 | 12 | [[ -d origami.el ]] || { 13 | 14 | echo "git clone https://github.com/gregsexton/origami.el.git" 15 | 16 | git clone https://github.com/gregsexton/origami.el.git 17 | } 18 | 19 | [[ -d persp-mode.el ]] || { 20 | 21 | echo "git clone https://github.com/Bad-ptr/persp-mode.el.git" 22 | 23 | git clone https://github.com/Bad-ptr/persp-mode.el.git 24 | } 25 | 26 | [[ -d xah-math-input ]] || { 27 | 28 | echo "git clone https://github.com/xahlee/xah-math-input" 29 | 30 | git clone https://github.com/xahlee/xah-math-input 31 | } 32 | -------------------------------------------------------------------------------- /snippet/hist/freebsd-bhyve.sh: -------------------------------------------------------------------------------- 1 | # bridge 1. sudo sysrc cloned_interfaces+="bridge0" 2 | # bridge 2. sudo sysrc ifconfig_bridge0="inet 192.168.0.1 netmask 255.255.255.0" 3 | # bridge 3. sudo sysrc gateway_enable="yes" 4 | # quickstart 1. sudo pkg install vm-bhyve grub2-bhyve bhyve-firmware 5 | # quickstart 2. sudo zfs create zroot/bhyve-vms 6 | # quickstart 3. sudo sysrc vm_enable="YES" 7 | # quickstart 4. sudo sysrc vm_dir="zfs:zroot/bhyve-vms" 8 | # quickstart 5. sudo kldload vmm 9 | # quickstart 6. sudo vm init 10 | # quickstart 7. sudo cp /usr/local/share/examples/vm-bhyve/* /zroot/bhyve-vms/.templates/ 11 | # quickstart 8. sudo vm set console=tmux 12 | # quickstart 9. sudo vm switch create -t manual -b bridge0 public 13 | sudo vm switch info 14 | sudo kldstat -m vmm -v 15 | sudo kldstat -qm vmm.ko 16 | -------------------------------------------------------------------------------- /self/bin/install/install-with-am.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # see : https://github.com/ivan-hc/AM 4 | 5 | # wget -q https://raw.githubusercontent.com/ivan-hc/AM/main/AM-INSTALLER 6 | # chmod a+x ./AM-INSTALLER 7 | # ./AM-INSTALLER 8 | # rm ./AM-INSTALLER 9 | # 10 | # ---- OR ---- 11 | # 12 | # wget https://raw.githubusercontent.com/ivan-hc/AM/main/INSTALL 13 | # chmod a+x ./INSTALL 14 | # sudo ./INSTALL 15 | # rm ./INSTALL 16 | 17 | which am &> /dev/null || { 18 | am_installer=~/racine/source/software/AM/AM-INSTALLER 19 | chmod +x $am_installer 20 | $am_installer 21 | } 22 | 23 | # -- does not work 24 | # 25 | # viper-browser 26 | # 27 | # -- autres 28 | # 29 | # dezor 30 | # promethium 31 | 32 | packages=( 33 | freetube 34 | xnviewmp 35 | rclone-browser 36 | localsend 37 | ) 38 | 39 | am install $=packages 40 | -------------------------------------------------------------------------------- /shell/windenv/zen-shutdown.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # {{{ Zenity 4 | 5 | choix=`\ 6 | zenity --list --radiolist \ 7 | --width=300 --height=300 \ 8 | --text "Sortir" \ 9 | --print-column=ALL \ 10 | --column "Choix" --column "Action" \ 11 | TRUE "Ne rien faire" \ 12 | FALSE "Mettre en veille" \ 13 | FALSE "Hiberner" \ 14 | FALSE "Eteindre" 15 | ` 16 | 17 | # }}} 18 | 19 | sync 20 | 21 | # Méthode basée sur systemctl {{{1 22 | 23 | case $choix in 24 | 25 | "Mettre en veille") 26 | echo "systemctl suspend" 27 | systemctl suspend 28 | ;; 29 | 30 | "Hiberner") 31 | echo "systemctl hibernate" 32 | #systemctl hibernate 33 | ;; 34 | 35 | "Eteindre") 36 | echo "systemctl poweroff" 37 | systemctl poweroff 38 | ;; 39 | 40 | *) 41 | echo "Aucun choix" 42 | ;; 43 | esac 44 | 45 | # }}}1 46 | -------------------------------------------------------------------------------- /snippet/zsh.snip: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | alias psgrep='ps auxww | /bin/grep -v grep | /bin/grep --color=auto' 4 | 5 | while read ligne 6 | do 7 | eval $ligne 8 | 9 | done < $fichier 10 | 11 | # Tableaux {{{1 12 | 13 | # remove the ith element with 14 | # 15 | # foo[$i] =() 16 | # 17 | # instead. 18 | 19 | # To remove element with content "b" from array: 20 | # 21 | # foo=(a b c) 22 | # foo=(${foo#b}) 23 | 24 | # To remove element number $i: a=("${(@)a[1,$i-1]}" "${(@)a[$i+1,$#a]}") 25 | # 26 | # (The simpler construct a=($a[1,$i-1] $a[$i+1,$#a]) also removes empty elements.) 27 | # 28 | # ADDED: 29 | # 30 | # To remove any occurence of b: a=("${(@)a:#b}") 31 | # :# is the hieroglyph to remove matching elements; "" and (@) is to operate correctly on arrays even if they contain empty elements. 32 | 33 | # }}}1 34 | -------------------------------------------------------------------------------- /self/bin/build/build-mu.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # {{{ Environnement 4 | 5 | sauve_cflags=$CFLAGS 6 | 7 | export CFLAGS= 8 | 9 | sauve_ldflags=$LDFLAGS 10 | 11 | export LDFLAGS= 12 | 13 | sauve_path=$PATH 14 | 15 | export PATH=/bin:/usr/bin:/usr/local/bin:/sbin 16 | 17 | # }}} 18 | 19 | # {{{ Clean 20 | 21 | make clean 22 | 23 | # }}} 24 | 25 | # {{{ Preconfigure 26 | 27 | autoreconf -i 28 | 29 | #sed -i 's|MUGDIR|"/usr/share/pixmaps"|' toys/mug/mug.c 30 | 31 | # }}} 32 | 33 | # {{{ Configure 34 | 35 | ./configure --prefix=/usr/local --disable-webkit --disable-gtk --enable-mu4e 36 | 37 | # }}} 38 | 39 | # {{{ Make 40 | 41 | make 42 | 43 | # }}} 44 | 45 | # {{{ Restauration 46 | 47 | export CFLAGS=$sauve_cflags 48 | 49 | export LDFLAGS=$sauve_ldflags 50 | 51 | export PATH=$sauve_path 52 | 53 | # }}} 54 | -------------------------------------------------------------------------------- /shell/data/jq-search-playlists.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # List videos in playlists 4 | 5 | file=${1:-playlists.db} 6 | string=$2 7 | 8 | #jq '[ .videos.[] | { "title" : .title, "author" : .author } ]' $file 9 | #jq '[ .videos.[] | select(.title | test("^.*'$string'.*$")) ]' $file | grep -v '^\[\]$' 10 | #jq '. | select(.playlistName | test("^.*'$string'.*$"))' $file | grep -v '^\[\]$' 11 | 12 | echo 13 | echo "---- playlists ----" 14 | echo 15 | jq '. | select(.playlistName | test("'$string'"; "i"))' $file | grep playlistName 16 | 17 | echo 18 | echo "---- author ----" 19 | echo 20 | jq '. | select(.videos.[].author | test("'$string'"; "i"))' $file | grep playlistName | uniq 21 | 22 | 23 | echo 24 | echo "---- title ----" 25 | echo 26 | jq '. | select(.videos.[].title | test("'$string'"; "i"))' $file | grep playlistName | uniq 27 | -------------------------------------------------------------------------------- /shell/multiplex/fzf-tmux-history.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | [[ $TERM = tmux* ]] || { 4 | 5 | echo "Not in tmux session" 6 | echo 7 | 8 | exit 0 9 | } 10 | 11 | export FZF_DEFAULT_OPTS=' 12 | -i 13 | --exact 14 | --info=hidden 15 | --layout=reverse 16 | --scroll-off=5 17 | --tiebreak=index 18 | --bind=alt-space:toggle+down,shift-tab:toggle+down 19 | --bind=alt-a:toggle-all 20 | --bind=ctrl-s:toggle-sort 21 | --bind=ctrl-u:end-of-line+unix-line-discard 22 | --bind=home:first,end:last 23 | --color=bw 24 | ' 25 | 26 | fichier=~/racine/hist/fzf/tmux-history 27 | 28 | sort $fichier | uniq | sponge $fichier 29 | 30 | commande=$(cat $fichier | fzf) 31 | 32 | (( $#commande == 0 )) && exit 0 33 | 34 | if [ $# > 0 -a x$1 = x-s ] 35 | then 36 | tmux send-keys " tmux $commande " 37 | else 38 | tmux $commande 39 | fi 40 | -------------------------------------------------------------------------------- /self/bin/build/build-neovim.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # {{{ Prérequis 4 | 5 | # sudo pacman -S base-devel cmake extra-cmake-modules ninja ncurses pkg-config luajit lua-lpeg lua-messagepack 6 | # libtool-bin 7 | 8 | # }}} 9 | 10 | # {{{ Environnement 11 | 12 | sauve_cflags=$CFLAGS 13 | 14 | export CFLAGS= 15 | 16 | sauve_ldflags=$LDFLAGS 17 | 18 | export LDFLAGS= 19 | 20 | sauve_path=$PATH 21 | 22 | export PATH=/bin:/usr/bin:/usr/local/bin:/sbin 23 | 24 | # }}} 25 | 26 | # {{{ Clean 27 | 28 | #make clean 29 | 30 | make distclean 31 | 32 | # }}} 33 | 34 | # {{{ Préconfig 35 | 36 | #make cmake 37 | 38 | # }}} 39 | 40 | # {{{ Make 41 | 42 | make 43 | 44 | # }}} 45 | 46 | # {{{ Restauration 47 | 48 | export CFLAGS=$sauve_cflags 49 | 50 | export LDFLAGS=$sauve_ldflags 51 | 52 | export PATH=$sauve_path 53 | 54 | # }}} 55 | -------------------------------------------------------------------------------- /self/bin/build/build-vit.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | argument=$1 4 | 5 | # {{{ Documentation 6 | 7 | 8 | 9 | # {{{ Prérequis 10 | 11 | 12 | 13 | # }}} 14 | 15 | # }}} 16 | 17 | # {{{ Environnement 18 | 19 | sauve_cflags=$CFLAGS 20 | 21 | export CFLAGS= 22 | 23 | sauve_ldflags=$LDFLAGS 24 | 25 | export LDFLAGS= 26 | 27 | sauve_path=$PATH 28 | 29 | export PATH=/bin:/usr/bin:/usr/local/bin:/sbin 30 | 31 | # }}} 32 | 33 | # {{{ Clean 34 | 35 | #make clean 36 | 37 | # }}} 38 | 39 | # {{{ Préconfig 40 | 41 | 42 | 43 | # }}} 44 | 45 | # {{{ Configure 46 | 47 | ./configure --prefix=/usr/local 48 | 49 | # }}} 50 | 51 | # {{{ Make 52 | 53 | make 54 | 55 | # }}} 56 | 57 | # {{{ Restauration 58 | 59 | export CFLAGS=$sauve_cflags 60 | 61 | export LDFLAGS=$sauve_ldflags 62 | 63 | export PATH=$sauve_path 64 | 65 | # }}} 66 | -------------------------------------------------------------------------------- /shell/multimedia/eval-wallpaper.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | emulate -R zsh 4 | setopt local_options 5 | setopt warn_create_global 6 | setopt null_glob 7 | zmodload zsh/regex 8 | 9 | path+=(~/racine/shell/filesys) 10 | 11 | evaluation='NONE' 12 | root=${1:-~/graphix} 13 | 14 | evaluation=$(\ 15 | zenity \ 16 | --title "Wallpaper" \ 17 | --forms \ 18 | --add-entry "evaluation" \ 19 | ) 20 | 21 | [ $#evaluation -gt 0 ] || exit 0 22 | 23 | # Minuscules ? 24 | #evaluation=${evaluation:l} 25 | 26 | # Majuscules ? 27 | evaluation=${evaluation:u} 28 | 29 | name=`sed -n '/.*:.*:.*/p' ~/log/wallpaper.log | tail -n 1 ` 30 | name=${name##*:} 31 | name=${name// } 32 | 33 | # echo "eve $evaluation $name" 34 | # echo 35 | 36 | info=$(evaluation.zsh $evaluation $name) 37 | 38 | #zenity --info --text="$info" 39 | 40 | echo $info >>| ~/log/eval-wallpaper.log 41 | -------------------------------------------------------------------------------- /shell/windenv/rofi-terminal.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | setopt extended_glob 4 | 5 | menu=( 6 | "0 XTerm" 7 | "1 UXTerm" 8 | "2 URxvtc" 9 | "3 Tilix" 10 | "4 Tilix en mode quake" 11 | "5 Yakuake" 12 | ) 13 | 14 | # Rofi dmenu {{{1 15 | 16 | choix=$(print -l $menu | rofi -dmenu -p "Menu " -i) 17 | 18 | # }}}1 19 | 20 | # Affichage {{{1 21 | 22 | echo choix : $choix 23 | echo 24 | 25 | # }}}1 26 | 27 | case $choix in 28 | [0-9a-z]##" XTerm") 29 | xterm -e zsh -l & disown 30 | ;; 31 | [0-9a-z]##" UXTerm") 32 | uxterm -e zsh -l & disown 33 | ;; 34 | [0-9a-z]##" URxvtc") 35 | urxvtc -e zsh -l & disown 36 | ;; 37 | [0-9a-z]##" Tilix") 38 | tilix -e zsh -l & disown 39 | ;; 40 | [0-9a-z]##" Tilix en mode quake") 41 | tilix -q -e zsh -l & disown 42 | ;; 43 | [0-9a-z]##" Yakuake") 44 | yakuake & disown 45 | ;; 46 | esac 47 | -------------------------------------------------------------------------------- /snippet/hist/ubuntu.sh: -------------------------------------------------------------------------------- 1 | am -f 2 | am -h 3 | am -i nvim 4 | am -l 5 | am -q vim 6 | am -r nvim 7 | apt install flatpak # sudo 8 | flatpak history 9 | flatpak install --from https://flathub.org/repo/appstream/com.spotify.Client.flatpakref 10 | flatpak install flathub org.libreoffice.LibreOffice 11 | flatpak list 12 | flatpak list --app 13 | flatpak permission-reset org.libreoffice.LibreOffice 14 | flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo 15 | flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo 16 | flatpak remote-delete flathub 17 | flatpak remotes 18 | flatpak repair 19 | flatpak run org.libreoffice.LibreOffice 20 | flatpak search qutebrowser 21 | flatpak uninstall --unused 22 | flatpak uninstall org.libreoffice.LibreOffice 23 | flatpak update 24 | sudo make install PREFIX=/usr/local 25 | -------------------------------------------------------------------------------- /shell/alarm/zen-minuter.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | export PATH=$PATH:~/racine/shell/alarm 4 | 5 | alias psgrep="ps auxww | grep -v grep | grep --color=never" 6 | 7 | output=$(\ 8 | zenity \ 9 | --title "Infusion" \ 10 | --forms --separator ":" \ 11 | --add-entry "Hours" \ 12 | --add-entry "Minutes" \ 13 | --add-entry "Seconds" \ 14 | --add-entry "Volume" \ 15 | ) 16 | 17 | (( $? != 0 )) && exit 1 18 | 19 | echo output : $output 20 | echo length output : $#output 21 | echo 22 | 23 | if [[ $output = :: ]] 24 | then 25 | urxvtc -geometry 120x30+300+70 -e less +G ~/log/minuters.log 26 | exit 0 27 | fi 28 | 29 | duration=${output%:*} 30 | volume=${output//*:} 31 | (( $#volume == 0 )) && volume=100 32 | echo duration : $duration 33 | echo volume : $volume 34 | 35 | echo "ding-dong.zsh volume=$volume $duration" 36 | echo 37 | 38 | ding-dong.zsh volume=$volume $duration 39 | -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | 2 | #+STARTUP: showall 3 | 4 | * Repo contents 5 | 6 | - some scripts of mine, I hope you will find some of them useful. 7 | - some scripts may come from elsewhere on the net, I wrote the credit 8 | when I remember the origin, if you see one w/o it, please open an 9 | issue 10 | - some snippets 11 | 12 | * Documentation 13 | 14 | Dependances : 15 | 16 | - multi-tea.zsh -> ding-dong.zsh -> minuter.zsh -> bell.zsh -> audio files 17 | + audio files are not on this repo, just pick your fav and change 18 | them in the script 19 | - meditation.zsh -> random.zsh, mpv-socket.bash, audio files 20 | - I generate "speaking" audio files using pico2wave (svox-pico-git on [[https://aur.archlinux.org/][AUR]]) 21 | - For audio samples, see also https://freesound.org 22 | 23 | * Warning 24 | 25 | I try to be mindful when I code, but some bugs might remain, so be careful. 26 | -------------------------------------------------------------------------------- /shell/run/run-mplayer-serveur.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # {{{ Options 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | #setopt extended_glob 12 | 13 | #setopt null_glob 14 | 15 | #zmodload zsh/regex 16 | 17 | # }}} 18 | 19 | # Déjà lancé ? {{{1 20 | 21 | alias psgrep="ps auxww | grep -v grep | grep --color=never" 22 | 23 | psgrep 'mplayer -idle -slave' &> /dev/null && { 24 | 25 | echo "Mplayer tourne déjà" 26 | echo 27 | 28 | exit 0 29 | } 30 | 31 | # }}}1 32 | 33 | local tube=~/racine/run/pipe/mplayer 34 | 35 | [[ -p $tube ]] || { 36 | 37 | [[ -e $tube ]] && rm -f $tube 38 | 39 | mkdir -p ~/racine/run/pipe 40 | 41 | mkfifo $tube 42 | } 43 | 44 | # -noconsolecontrols ? 45 | 46 | mplayer \ 47 | -idle \ 48 | -slave \ 49 | -input file=$tube \ 50 | -softvol \ 51 | -softvol-max 150 \ 52 | &>>! ~/log/mplayer.log &! 53 | -------------------------------------------------------------------------------- /self/bin/build/build-musescore.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # /!\ Sur shari, ne pas oublier d’ajouter : 4 | # 5 | # CPUS := 1 6 | # 7 | # dans le Makefile 8 | # 9 | # sinon, chauffe beaucoup 10 | # 11 | # ouais, chauffe quand même trop 12 | 13 | argument=$1 14 | 15 | # {{{ Documentation 16 | 17 | 18 | 19 | # {{{ Prérequis 20 | 21 | 22 | 23 | # }}} 24 | 25 | # }}} 26 | 27 | # {{{ Environnement 28 | 29 | sauve_cflags=$CFLAGS 30 | 31 | export CFLAGS= 32 | 33 | sauve_ldflags=$LDFLAGS 34 | 35 | export LDFLAGS= 36 | 37 | sauve_path=$PATH 38 | 39 | export PATH=/bin:/usr/bin:/usr/local/bin:/sbin 40 | 41 | # }}} 42 | 43 | # {{{ Clean 44 | 45 | #make clean 46 | 47 | # }}} 48 | 49 | # {{{ Make 50 | 51 | make release 52 | 53 | # }}} 54 | 55 | # {{{ Restauration 56 | 57 | export CFLAGS=$sauve_cflags 58 | 59 | export LDFLAGS=$sauve_ldflags 60 | 61 | export PATH=$sauve_path 62 | 63 | # }}} 64 | -------------------------------------------------------------------------------- /fun/zsh/completion/fileman/_autojump: -------------------------------------------------------------------------------- 1 | #compdef autojump 2 | 3 | #Copyright Joel Schaerer 2008, 2009 4 | #This file is part of autojump 5 | 6 | #autojump is free software: you can redistribute it and/or modify 7 | #it under the terms of the GNU General Public License as published by 8 | #the Free Software Foundation, either version 3 of the License, or 9 | #(at your option) any later version. 10 | # 11 | #autojump is distributed in the hope that it will be useful, 12 | #but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | #GNU General Public License for more details. 15 | # 16 | #You should have received a copy of the GNU General Public License 17 | #along with autojump. If not, see . 18 | 19 | cur=${words[2, -1]} 20 | 21 | autojump --completion ${=cur[*]} | while read i; do 22 | compadd -U "$i"; 23 | done 24 | -------------------------------------------------------------------------------- /shell/multiplex/fzf-tmux-menu.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | [[ $TERM = tmux* ]] || { 4 | 5 | echo "Not in tmux session" 6 | echo 7 | 8 | exit 0 9 | } 10 | 11 | menu=( \ 12 | "Exécuter une commande tmux" \ 13 | "Historique des commandes tmux" \ 14 | "Visualiser le contenu du pane dans un pager" \ 15 | "Charger une session" \ 16 | "Annuler" \ 17 | ) 18 | 19 | choix=$( \ 20 | print -l $menu | fzf --prompt='tmux> ' 21 | ) 22 | 23 | case $choix in 24 | 25 | "Exécuter une commande tmux") 26 | exec ~/racine/shell/dialog/fzf-tmux-command.zsh 27 | ;; 28 | "Historique des commandes tmux") 29 | exec ~/racine/shell/dialog/fzf-tmux-history.zsh 30 | ;; 31 | "Visualiser le contenu du pane dans un pager") 32 | tmux send-keys "tmux capture-pane -S - -p | less" Enter 33 | ;; 34 | "Charger une session") 35 | exec ~/racine/shell/dialog/fzf-tmux-session.zsh 36 | ;; 37 | "Annuler") 38 | exit 0 39 | ;; 40 | esac 41 | -------------------------------------------------------------------------------- /shell/multimedia/fluidsynth-ogg.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Variables {{{1 4 | 5 | operasys=$(uname -s) 6 | 7 | if [ $operasys = Linux ] 8 | then 9 | sound=/usr/share/soundfonts/FluidR3_GM.sf2 10 | elif [ $operasys = FreeBSD ] 11 | then 12 | sound=/usr/local/share/sounds/sf2/FluidR3_GM.sf2 13 | else 14 | sound=/usr/share/soundfonts/FluidR3_GM.sf2 15 | fi 16 | 17 | #sound=/usr/share/soundfonts/freepats-general-midi.sf2 18 | #sound=~/racine/musica/soundfont/Unison.sf2 19 | 20 | argumen=($@) 21 | 22 | # Aide {{{1 23 | 24 | [ $#argumen -eq 0 ] && { 25 | echo Usage : $0 ' file(s)' 26 | echo 27 | echo Convert midi files to ogg 28 | exit 0 29 | } 30 | 31 | # Boucle {{{1 32 | 33 | for midi in $=argumen 34 | do 35 | ogg=${midi%.midi}.ogg 36 | echo 37 | echo "fluidsynth -a alsa -nli -r 44100 -o synth.cpu-cores=2 -T oga -F $ogg $sound $midi" 38 | echo 39 | fluidsynth -a alsa -nli -r 44100 -o synth.cpu-cores=2 -T oga -F $ogg $sound $midi 40 | done 41 | -------------------------------------------------------------------------------- /fun/zsh/autoload/multimedia/eval-chanson: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options de zsh 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | zmodload zsh/regex 12 | 13 | setopt null_glob 14 | 15 | # }}} 16 | 17 | # {{{ Variables 18 | 19 | local note racine nom 20 | 21 | # }}} 22 | 23 | note='NONE' 24 | racine=~/audio 25 | 26 | # {{{ Boucle arguments 27 | 28 | while true 29 | do 30 | case $1 in 31 | [0-9a-zA-Z]) 32 | note=$1 33 | shift 34 | ;; 35 | ?*) 36 | racine=$1 37 | shift 38 | ;; 39 | *) 40 | break 41 | ;; 42 | esac 43 | done 44 | 45 | # }}} 46 | 47 | # {{{ Format de la note 48 | 49 | # Minuscules ? 50 | #note=${note:l} 51 | 52 | # Majuscules ? 53 | note=${note:u} 54 | 55 | # }}} 56 | 57 | # {{{ Morceau actuellement joué 58 | 59 | nom=`mpc -f "%file%" | awk '{ if ( NR == 1 ) print $0 }'` 60 | 61 | nom=${racine}/${nom} 62 | 63 | # }}} 64 | 65 | eve $note $nom 66 | -------------------------------------------------------------------------------- /shell/run/run-neovim-qt-client.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | xdotool search --class nvim-qt windowactivate && exit 0 4 | 5 | # ---- we need neovim-remote to equalize windows 6 | which nvr || { 7 | echo Please install neovim-remote with pip first 8 | exit 0 9 | } 10 | 11 | # ---- log and err files 12 | logfile=~/log/neovim-server.log 13 | errfile=~/log/neovim-server.err 14 | # ---- save old channels 15 | exec 3>&1 16 | exec 4>&2 17 | # ---- ensure log and err files exist 18 | [ -e $logfile ] || touch $logfile 19 | [ -e $errfile ] || touch $errfile 20 | # ---- redirect to log and err files 21 | exec 1>> $logfile 22 | exec 2>> $errfile 23 | 24 | rundir=$XDG_RUNTIME_DIR 25 | 26 | if [ -d $rundir ] 27 | then 28 | socket=$rundir/neovim-socket 29 | else 30 | socket=~/racine/run/socket/neovim 31 | fi 32 | 33 | nvim-qt --server $socket -- "$@" 34 | 35 | # ---- restore old channels 36 | exec 1>&3 37 | exec 2>&4 38 | 39 | sleep 1 40 | nvr --remote-expr 'library#equal_windows()' 41 | -------------------------------------------------------------------------------- /snippet/hist/artix.sh: -------------------------------------------------------------------------------- 1 | avahi-browse --all --ignore-local --resolve --terminate 2 | avahi-discover 3 | avahi-resolve-host-name taijitu.local 4 | avahi-resolve-host-name taijitu.local 5 | cpu=ls-modules ; ls /usr/lib/modules/$(uname -r)/kernel/drivers/cpufreq/ 6 | cpu=max-freq ; sudo cpupower frequency-set -u 1300MHz 7 | cpu=powersave ; sudo cpupower frequency-set -g $cpu 8 | cpu_epb=12 ; sudo cpupower set -b $cpu_epb 9 | cpu_epb=12 ; sudo echo $cpu_epb | sudo tee /sys/devices/system/cpu/cpu*/power/energy_perf_bias 10 | dbus=list ; busctl list 11 | sudo dinitctl enable avahi-daemon 12 | sudo dinitctl enable sshd 13 | sudo dinitctl restart dinit-user-spawn 14 | sudo pacman -S artix-archlinux-support 15 | sudo pacman -S avahi avahi-dinit nss-mdns 16 | sudo pacman -S pacman-contrib 17 | sudo pacman -S xfce4-whiskermenu-plugin 18 | sudo swapon /swap/swapfile 19 | sudo update-ca-trust 20 | sudo yay pacman-static 21 | xdg-settings get default-web-browser 22 | zramctl ; echo ; swapon -s 23 | -------------------------------------------------------------------------------- /fun/zsh/autoload/multimedia/cmd-dir-chanson: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options de zsh 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | setopt null_glob 12 | 13 | # }}} 14 | 15 | local note racine commande nom repertoire 16 | 17 | note='0' 18 | racine=~/audio 19 | 20 | commande=${*:-file} 21 | #commande=${@:-file} 22 | 23 | commande=($=commande) 24 | 25 | # {{{ Morceau actuellement joué 26 | 27 | nom=`mpc -f "%file%" | awk '{ if ( NR == 1 ) print $0 }'` 28 | 29 | nom=${racine}/${nom} 30 | 31 | # }}} 32 | 33 | # {{{ Changement de répertoire 34 | 35 | repertoire=${nom%/?*} 36 | 37 | [[ $repertoire = $nom ]] && repertoire=. 38 | 39 | echo "cd $repertoire" 40 | echo 41 | 42 | pushd $repertoire >& /dev/null || { echo "Le répertoire $repertoire n’existe pas !" ; return 1 } 43 | 44 | # }}} 45 | 46 | echo $~commande 47 | echo 48 | 49 | $~commande 50 | 51 | echo 52 | 53 | popd >& /dev/null 54 | 55 | echo "popd --> $PWD" 56 | -------------------------------------------------------------------------------- /shell/run/run-neovim-server.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # ---- log and err files 4 | logfile=~/log/neovim-server.log 5 | errfile=~/log/neovim-server.err 6 | # ---- save old channels 7 | exec 3>&1 8 | exec 4>&2 9 | # ---- ensure log and err files exist 10 | [ -e $logfile ] || touch $logfile 11 | [ -e $errfile ] || touch $errfile 12 | # ---- redirect to log and err files 13 | exec 1>> $logfile 14 | exec 2>> $errfile 15 | 16 | rundir=$XDG_RUNTIME_DIR 17 | 18 | if [ -d $rundir ] 19 | then 20 | socket=$rundir/neovim-socket 21 | else 22 | socket=~/racine/run/socket/neovim 23 | fi 24 | 25 | if [ -S $socket -o -e $socket ] 26 | then 27 | echo 'neovim is already started' 28 | echo 29 | exit 0 30 | fi 31 | 32 | echo 33 | echo "------------------------------------------------------------" 34 | echo 35 | date +" [=] %A %d %B %Y (o) %H : %M : %S | %:z | " 36 | echo 37 | 38 | # ---- restore old channels 39 | exec 1>&3 40 | exec 2>&4 41 | 42 | exec nvim --listen $socket --headless >> $logfile 2>&1 43 | -------------------------------------------------------------------------------- /shell/alarm/notify-sound.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | exec >> ~/log/notify-sound.log 4 | exec 2>&1 5 | 6 | appname=$1 7 | summary=$2 8 | body=$3 9 | icon=$4 10 | urgency=$5 11 | 12 | echo "appname : $appname" 13 | echo "summary : $summary" 14 | echo "body : $body" 15 | echo "icon : $icon" 16 | echo "urgency : $urgency" 17 | echo 18 | 19 | [ "$urgency" = CRITICAL ] || \ 20 | [ "$summary" = Reminder ] || \ 21 | [[ $summary = *mentioned*you* ]] || \ 22 | exit 0 23 | 24 | mpvsocket=~/racine/shell/multimedia/mpv-socket.bash 25 | 26 | if [ "$urgency" = CRITICAL ] 27 | then 28 | soundfile=~/audio/bell/ding/alarm-bell.ogg 29 | elif [ "$summary" = Reminder ] 30 | then 31 | soundfile=~/audio/bell/ding/bol-tibetain.ogg 32 | else 33 | soundfile=~/audio/bell/ding/aether.ogg 34 | fi 35 | 36 | $mpvsocket add $soundfile 37 | 38 | if [ "$HOST" = taijitu ] 39 | then 40 | $mpvsocket volume 96 41 | else 42 | $mpvsocket volume 84 43 | fi 44 | 45 | echo 46 | echo "------------------------------" 47 | echo 48 | -------------------------------------------------------------------------------- /fun/zsh/autoload/multimedia/eval-papierpeint: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options de zsh 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | zmodload zsh/regex 12 | 13 | setopt null_glob 14 | 15 | # }}} 16 | 17 | local note racine nom repertoire fichier titre nouveauNom 18 | 19 | note='NONE' 20 | racine=~/graphix 21 | 22 | # {{{ Boucle arguments 23 | 24 | while true 25 | do 26 | case $1 in 27 | [0-9a-zA-Z]) 28 | note=$1 29 | shift 30 | ;; 31 | ?*) 32 | racine=$1 33 | shift 34 | ;; 35 | *) 36 | break 37 | ;; 38 | esac 39 | done 40 | 41 | # }}} 42 | 43 | # {{{ Format de la note 44 | 45 | # Minuscules ? 46 | #note=${note:l} 47 | 48 | # Majuscules ? 49 | note=${note:u} 50 | 51 | # }}} 52 | 53 | # {{{ Fond d'écran actuel 54 | 55 | nom=`sed -n '/.*:.*:.*/p' ~/log/wallpaper.log | tail -n 1 ` 56 | nom=${nom##*:} 57 | nom=${nom// } 58 | 59 | # }}} 60 | 61 | # echo "eve $note $nom" 62 | # echo 63 | 64 | eve $note $nom 65 | -------------------------------------------------------------------------------- /shell/multimedia/mpc-auto-toggle.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | delai_court=${1:-5} 4 | delai_long=${2:-700} 5 | 6 | while true 7 | do 8 | autre=0 9 | 10 | pulsemixer --list-sinks | grep 'Name: Chromium' &>/dev/null && autre=1 11 | pulsemixer --list-sinks | grep 'Name: qutebrowser' &>/dev/null && autre=1 12 | pulsemixer --list-sinks | grep 'Name: qutebrowser' &>/dev/null && autre=1 13 | pulsemixer --list-sinks | grep 'Name: Falkon' &>/dev/null && autre=1 14 | pulsemixer --list-sinks | grep 'Name: VLC media player' &>/dev/null && autre=1 15 | pulsemixer --list-sinks | grep 'Name: AudioIPC Server' &>/dev/null && autre=1 16 | 17 | echo "== $(date +%H:%M:%S) ==" 18 | echo 19 | echo Autre : $autre 20 | echo 21 | 22 | if (( autre == 0 )) 23 | then 24 | mpc play 25 | echo 26 | echo "sleep $delai_court" 27 | echo 28 | sleep $delai_court 29 | else 30 | mpc pause 31 | echo 32 | echo "sleep $delai_long" 33 | echo 34 | sleep $delai_long 35 | fi 36 | 37 | done 38 | -------------------------------------------------------------------------------- /fun/zsh/autoload/multimedia/repartition-eval: -------------------------------------------------------------------------------- 1 | # vim: set filetype=zsh : 2 | 3 | # {{{ Options de zsh 4 | 5 | emulate -R zsh 6 | 7 | setopt local_options 8 | 9 | setopt warn_create_global 10 | 11 | setopt null_glob 12 | 13 | # }}} 14 | 15 | local chiffresLettres total src alphanum fichiers nombre 16 | 17 | typeset -U chiffresLettres 18 | 19 | chiffresLettres=(\ 20 | '0' '1' '2' '3' '4' '5' '6' '7' '8' '9' \ 21 | 'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' \ 22 | 'M' 'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'\ 23 | ) 24 | 25 | total=0 26 | 27 | echo 28 | 29 | for src in "$@" 30 | do 31 | echo "Dossier : $src" 32 | echo 33 | 34 | for alphanum in $chiffresLettres 35 | do 36 | fichiers=(${src}/**/${alphanum}-*.*(.)) 37 | 38 | nombre=$#fichiers 39 | 40 | (( nombre > 0 )) && { 41 | echo " $alphanum : $nombre" 42 | (( total += nombre )) 43 | } 44 | done 45 | 46 | echo " _______________________" 47 | echo 48 | echo " Total : " $total 49 | echo 50 | 51 | total=0 52 | done 53 | -------------------------------------------------------------------------------- /shell/multimedia/fluidsynth-mp3.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # does not work 4 | 5 | # Variables {{{1 6 | 7 | operasys=$(uname -s) 8 | 9 | if [ $operasys = Linux ] 10 | then 11 | sound=/usr/share/soundfonts/FluidR3_GM.sf2 12 | elif [ $operasys = FreeBSD ] 13 | then 14 | sound=/usr/local/share/sounds/sf2/FluidR3_GM.sf2 15 | else 16 | sound=/usr/share/soundfonts/FluidR3_GM.sf2 17 | fi 18 | 19 | #sound=/usr/share/soundfonts/freepats-general-midi.sf2 20 | #sound=~/racine/musica/soundfont/Unison.sf2 21 | 22 | argumen=($@) 23 | 24 | # Aide {{{1 25 | 26 | [ $#argumen -eq 0 ] && { 27 | echo Usage : $0 ' file(s)' 28 | echo 29 | echo Convert midi files to ogg 30 | exit 0 31 | } 32 | 33 | # Boucle {{{1 34 | 35 | for midi in $=argumen 36 | do 37 | ogg=${midi%.midi}.ogg 38 | echo 39 | echo "fluidsynth -a alsa -nli -r 44100 -o synth.cpu-cores=2 -T raw -F - $sound $midi | lame -q 0 -b 128 - $mpthree" 40 | echo 41 | fluidsynth -a alsa -nli -r 44100 -o synth.cpu-cores=2 -T raw -F - $sound $midi | lame -q 0 -b 128 - $mpthree 42 | done 43 | -------------------------------------------------------------------------------- /shell/windenv/rofi-internet.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | setopt extended_glob 4 | 5 | menu=( 6 | "/ Recherche Web -> Qutebrowser" 7 | "? Recherche Web -> Firefox" 8 | "£ Signets -> Qutebrowser" 9 | "@ Signets -> Firefox" 10 | "< Ouvrir Qutebrowser" 11 | "> Ouvrir Firefox" 12 | ) 13 | 14 | # Rofi dmenu {{{1 15 | 16 | choix=$(print -l $menu | rofi -dmenu -p "Menu : " -i) 17 | 18 | # }}}1 19 | 20 | # Affichage {{{1 21 | 22 | echo choix : $choix 23 | echo 24 | 25 | # }}}1 26 | 27 | case $choix in 28 | "/ Recherche Web -> Qutebrowser") 29 | ~/racine/shell/dialog/rofi-surfraw.zsh & disown 30 | ;; 31 | "? Recherche Web -> Firefox") 32 | ~/racine/shell/dialog/rofi-surfraw.zsh firefox & disown 33 | ;; 34 | "£ Signets -> Qutebrowser") 35 | ~/racine/shell/dialog/rofi-buku.zsh & disown 36 | ;; 37 | "@ Signets -> Firefox") 38 | ~/racine/shell/dialog/rofi-buku.zsh firefox & disown 39 | ;; 40 | "< Ouvrir Qutebrowser") 41 | qutebrowser & disown 42 | ;; 43 | "> Ouvrir Firefox") 44 | firefox & disown 45 | ;; 46 | esac 47 | -------------------------------------------------------------------------------- /self/bin/build/build-unison.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # {{{ Prérequis 4 | 5 | # sudo apt install ocaml liblablgtk2-ocaml 6 | 7 | # }}} 8 | 9 | # {{{ Environnement 10 | 11 | sauve_cflags=$CFLAGS 12 | 13 | export CFLAGS= 14 | 15 | sauve_ldflags=$LDFLAGS 16 | 17 | export LDFLAGS= 18 | 19 | sauve_path=$PATH 20 | 21 | export PATH=/bin:/usr/bin:/usr/local/bin:/sbin 22 | 23 | # }}} 24 | 25 | # {{{ Clean 26 | 27 | make clean 28 | 29 | # }}} 30 | 31 | # {{{ Préconfig 32 | 33 | #./autogen.sh all 34 | 35 | # }}} 36 | 37 | # {{{ Configure 38 | 39 | # Attention à ne pas mettre de commentaire 40 | # entre deux lignes, sinon le shell croit 41 | # qu'il s'agit de la commande suivante 42 | 43 | # ./configure \ 44 | # --prefix=/usr/local 45 | 46 | # }}} 47 | 48 | # {{{ Make 49 | 50 | make UISTYLE=text 51 | 52 | echo "sudo cp ./src/unison /usr/local/bin" 53 | echo 54 | 55 | # }}} 56 | 57 | # {{{ Restauration 58 | 59 | export CFLAGS=$sauve_cflags 60 | 61 | export LDFLAGS=$sauve_ldflags 62 | 63 | export PATH=$sauve_path 64 | 65 | # }}} 66 | -------------------------------------------------------------------------------- /automat/update-locate-db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DB_DIR=${1:-"$HOME/racine/index/filesys/locate"} 4 | 5 | RACINE=$HOME/racine 6 | 7 | updatedb -v -l 0 -U ~/racine -o "$DB_DIR/racine.db" \ 8 | -n ".git .hg .bzr _darcs" \ 9 | -e " 10 | $RACINE/archive 11 | $RACINE/local/share/astronvim 12 | $RACINE/local/share/lazyvim 13 | $RACINE/local/share/lunarvim 14 | $RACINE/local/share/lvim 15 | $RACINE/local/share/nvchad 16 | $RACINE/local/share/nvim-kickstarter 17 | $RACINE/pack/aged 18 | $RACINE/plugin/manager 19 | $RACINE/system/conf 20 | $RACINE/source/software 21 | $RACINE/test 22 | $RACINE/trash 23 | $RACINE/varia 24 | " 25 | 26 | updatedb -v -l 0 -U ~/graphix -o "$DB_DIR"/graphix.db 27 | updatedb -v -l 0 -U ~/audio -o "$DB_DIR"/audio.db 28 | updatedb -v -l 0 -U ~/photo -o "$DB_DIR"/photo.db 29 | 30 | updatedb -v -l 0 -U ~/.config -o "$DB_DIR"/dotconfig.db 31 | updatedb -v -l 0 -U ~/.local -o "$DB_DIR"/dotlocal.db 32 | 33 | updatedb -v -l 0 -U /usr/local -o "$DB_DIR"/usr-local.db 34 | updatedb -v -l 0 -U /var/lib/pacman/local -o "$DB_DIR"/pacman-lib.db 35 | -------------------------------------------------------------------------------- /shell/network/connection-test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | temps=${1:-30} 4 | 5 | volume=${2:-100} 6 | 7 | echo temps = $temps 8 | echo 9 | echo volume = $volume 10 | echo 11 | 12 | # functions {{{1 13 | 14 | lecteur () { 15 | fu_volume=$1 16 | fu_fichier=$2 17 | mpv-socket.bash add $fu_fichier > ~/log/mpv-socket.log 2>&1 18 | mpv-socket.bash volume $fu_volume > ~/log/mpv-socket.log 2>&1 19 | } 20 | 21 | # loop {{{1 22 | 23 | while true 24 | do 25 | ping -W 1 -c 1 www.fedoraproject.org > /dev/null 2>&1 && { 26 | echo " [$(date +%H:%M:%S)] Connexion établie" 27 | echo 28 | lecteur $volume ~/audio/bell/notification/connexion-etablie.ogg 29 | break 30 | } 31 | if ! ping -W 1 -c 1 192.168.1.1 > /dev/null 2>&1 32 | then 33 | echo " [$(date +%H:%M:%S)] Pas de connexion du tout" 34 | echo 35 | lecteur $volume ~/audio/bell/notification/pas-de-connexion.ogg 36 | else 37 | echo " [$(date +%H:%M:%S)] Connexion au routeur" 38 | echo 39 | lecteur $volume ~/audio/bell/notification/connexion-au-routeur.ogg 40 | fi 41 | sleep $temps 42 | done 43 | -------------------------------------------------------------------------------- /shell/process/toggle-process.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # vim: set filetype=zsh: 3 | 4 | [ $# -eq 0 ] && { 5 | echo Usage : ${0##*/} process-name 6 | exit 0 7 | } 8 | 9 | process=$1 10 | 11 | nominees=("${(f)$(ps -A -o pid,state,args | grep $process | grep -v grep | grep -v $0)}") 12 | 13 | # print -l $nominees 14 | # echo $#nominees 15 | 16 | [ $#nominees -gt 1 ] && { 17 | echo There is more than one match, you have to be more specific. 18 | exit 0 19 | } 20 | 21 | procinfo=$nominees[1] 22 | 23 | espaces=${procinfo%%[^[:blank:]]*} 24 | procinfo=${procinfo#${espaces}} 25 | 26 | # echo Process info 27 | # print -l $procinfo 28 | 29 | pid=$(cut -d ' ' -f 1 <<< $procinfo) 30 | state=$(cut -d ' ' -f 2 <<< $procinfo) 31 | 32 | echo pid : $pid 33 | echo state : $state 34 | 35 | if [ $state = T ] 36 | then 37 | echo "kill -CONT $pid" 38 | echo 39 | kill -CONT $pid 40 | elif [ $state = R -o $state = S ] 41 | then 42 | echo "kill -STOP $pid" 43 | echo 44 | kill -STOP $pid 45 | else 46 | echo Your process is in a ambiguous state. 47 | fi 48 | 49 | exit 0 50 | -------------------------------------------------------------------------------- /shell/windenv/keyboard-layout.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | emulate -R zsh 4 | setopt local_options 5 | setopt warn_create_global 6 | setopt null_glob 7 | zmodload zsh/regex 8 | 9 | layout=$(\ 10 | zenity \ 11 | --width=600 \ 12 | --height=600 \ 13 | --title "Keyboard layout" \ 14 | --list --radiolist \ 15 | --column "Select" --column "Menu Item" \ 16 | FALSE "belgian meta super hyper" \ 17 | FALSE "french meta super hyper" \ 18 | FALSE "belgian" \ 19 | FALSE "french" \ 20 | FALSE "usa" \ 21 | ) 22 | 23 | echo $layout 24 | echo 25 | 26 | case $layout in 27 | "belgian meta super hyper") 28 | setxkbmap be 29 | xmodmap ~/racine/config/windenv/xmodmap/belge-meta-super-hyper 30 | ;; 31 | "french meta super hyper") 32 | setxkbmap fr 33 | xmodmap ~/racine/config/windenv/xmodmap/belge-meta-super-hyper 34 | ;; 35 | belgian) 36 | setxkbmap be 37 | ;; 38 | french) 39 | setxkbmap fr 40 | ;; 41 | usa) 42 | setxkbmap us 43 | ;; 44 | *) 45 | exit 0 46 | ;; 47 | esac 48 | 49 | #zenity --info --text="layout changed to $layout" 50 | -------------------------------------------------------------------------------- /shell/multimedia/lilypond-to-musicxml.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Arguments {{{1 4 | 5 | xmldir=. 6 | 7 | argumen=() 8 | 9 | while true 10 | do 11 | case $1 in 12 | -d) 13 | shift 14 | xmldir=$1 15 | shift 16 | ;; 17 | ?*) 18 | argumen+=$1 19 | shift 20 | ;; 21 | *) 22 | break 23 | ;; 24 | esac 25 | done 26 | 27 | [ -e $xmldir -a ! -d $xmldir ] && { 28 | echo Lilypond dir must be a directory 29 | echo 30 | exit 1 31 | } 32 | 33 | [ -d $xmldir ] || mkdir -p $xmldir 34 | 35 | # }}}1 36 | 37 | # Aide {{{1 38 | 39 | [ $#argumen -eq 0 ] && { 40 | echo Usage : $0 '[-d xml-dest-dir] file(s)' 41 | echo 42 | echo Convert lilypond files to xml 43 | exit 0 44 | } 45 | 46 | # }}}1 47 | 48 | # Boucle {{{1 49 | 50 | for score in $=argumen 51 | do 52 | lilydir=${score%/*} 53 | 54 | echo "cd $lilydir" 55 | 56 | cd $lilydir 57 | echo 58 | 59 | score=${score#$PWD/} 60 | xml=$xmldir/ly-${score%.*}.musicxml 61 | 62 | echo "ly musicxml -o $xml $score" 63 | echo 64 | ly musicxml -o $xml $score 65 | echo 66 | done 67 | 68 | # }}}1 69 | -------------------------------------------------------------------------------- /self/bin/system/update-void.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # player {{{1 4 | 5 | player () { 6 | 7 | local fu_volume=$1 8 | local fu_fichier=$2 9 | 10 | [[ $fu_fichier[1] != / ]] && { 11 | 12 | fu_fichier=~/audio/bell/$fu_fichier 13 | } 14 | 15 | mpv-socket.bash add $fu_fichier 16 | mpv-socket.bash volume $fu_volume 17 | } 18 | 19 | # refresh {{{1 20 | 21 | sudo xbps-install -S 22 | 23 | # clean cache {{{1 24 | 25 | sudo xbps-remove -O 26 | 27 | # check site {{{1 28 | 29 | w3m https://voidlinux.org/news/ 30 | 31 | # new keys {{{1 32 | 33 | 34 | 35 | # update {{{1 36 | 37 | sudo xbps-install -Su xbps 38 | sudo xbps-install -Su 39 | 40 | # playing {{{1 41 | 42 | fini=$HOME/audio/bell/notification/fin-mise-a-jour.ogg 43 | integer volume=100 44 | 45 | player $volume $fini 46 | 47 | # config diff {{{1 48 | 49 | 50 | 51 | # remove orphans {{{1 52 | 53 | sudo xbps-remove -o 54 | 55 | # update files db {{{1 56 | 57 | xlocate -S 58 | 59 | # reset keyboard to custom layout {{{1 60 | 61 | setxkbmap be 62 | xmodmap ~/racine/config/windenv/xmodmap/belge-meta-super-hyper 63 | -------------------------------------------------------------------------------- /automat/qute-history.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # vim: set filetype=zsh: 4 | 5 | localdir=$HOME/.local/share/qutebrowser 6 | 7 | indexdir=$HOME/racine/index/webrowser/qutebrowser 8 | 9 | cp -v $localdir/history.dmenu $indexdir/history.dmenu 1>&2 10 | echo 1>&2 11 | 12 | { 13 | cat $indexdir/history.dmenu 14 | 15 | sqlite3 -line \ 16 | $localdir/history.sqlite \ 17 | 'select * from history' | \ 18 | grep url | sed 's/ url = //' 19 | 20 | } | sort | uniq >! $localdir/history.dmenu 21 | 22 | sed -i '/duckduckgo.com/d' $localdir/history.dmenu 23 | sed -i '/google.com/d' $localdir/history.dmenu 24 | sed -i '/google.be/d' $localdir/history.dmenu 25 | sed -i '/google.fr/d' $localdir/history.dmenu 26 | sed -i '/youtube.com/d' $localdir/history.dmenu 27 | sed -i '/windy.com../d' $localdir/history.dmenu 28 | sed -i '/192.168.1.1/d' $localdir/history.dmenu 29 | 30 | cp -v $localdir/history.dmenu $indexdir/history.dmenu 1>&2 31 | echo 1>&2 32 | 33 | echo Nombre de lignes : `wc -l $localdir/history.dmenu` 1>&2 34 | echo 1>&2 35 | echo Nombre de lignes : `wc -l $indexdir/history.dmenu` 1>&2 36 | echo 1>&2 37 | -------------------------------------------------------------------------------- /shell/crypte/passmenu.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # credit : www.passwordstore.org 4 | 5 | shopt -s nullglob globstar 6 | 7 | typeit=0 8 | if [[ $1 == "--type" ]]; then 9 | typeit=1 10 | shift 11 | fi 12 | 13 | if [[ -n $WAYLAND_DISPLAY ]]; then 14 | dmenu=dmenu-wl 15 | xdotool="ydotool type --file -" 16 | elif [[ -n $DISPLAY ]]; then 17 | #dmenu=dmenu 18 | dmenu=(dmenu -p 'pass : ' -b -l 35 -fn "DejaVu Sans Mono 12" -nb black -nf '#5b3c11' -sb '#5b3c11' -sf black) 19 | xdotool="xdotool type --clearmodifiers --file -" 20 | else 21 | echo "Error: No Wayland or X11 display detected" >&2 22 | exit 1 23 | fi 24 | 25 | prefix=${PASSWORD_STORE_DIR-~/.password-store} 26 | password_files=( "$prefix"/**/*.gpg ) 27 | password_files=( "${password_files[@]#"$prefix"/}" ) 28 | password_files=( "${password_files[@]%.gpg}" ) 29 | 30 | password=$(printf '%s\n' "${password_files[@]}" | "${dmenu[@]}" "$@") 31 | 32 | [[ -n $password ]] || exit 33 | 34 | if [[ $typeit -eq 0 ]]; then 35 | pass show -c "$password" 2>/dev/null 36 | else 37 | pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | $xdotool 38 | fi 39 | -------------------------------------------------------------------------------- /shell/process/limit-program-time.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | setopt extended_glob 4 | 5 | # {{{ Initialisation 6 | 7 | integer temps=60 8 | 9 | script=`basename $0` 10 | 11 | # }}} 12 | 13 | # {{{ Arguments 14 | 15 | while true 16 | do 17 | case $1 in 18 | [0-9]##) 19 | temps=$1 20 | shift 21 | ;; 22 | -[0-9]##) 23 | quantum=${1#-} 24 | shift 25 | ;; 26 | ?*) 27 | programme=$1 28 | shift 29 | ;; 30 | *) 31 | break 32 | ;; 33 | esac 34 | done 35 | 36 | # }}} 37 | 38 | # {{{ Affichage 39 | 40 | echo Programme : $programme 41 | echo 42 | echo Script : $script 43 | echo 44 | echo Temps : $temps 45 | echo 46 | echo Quantum : $quantum 47 | echo 48 | 49 | # }}} 50 | 51 | # {{{ Self 52 | 53 | [[ $0 = *${programme}* ]] && { 54 | 55 | echo "Le script ne peut se surveiller lui-même" 56 | echo 57 | 58 | exit 0 59 | } 60 | 61 | # }}} 62 | 63 | alias psgrep="ps auxww | grep -v grep | grep -v $script | grep" 64 | 65 | sleep $temps 66 | 67 | zenity --info --no-wrap --text "Le programme $programme va bientot s’arreter !" & 68 | 69 | sleep $quantum 70 | 71 | psgrep $programme && pkill -f $programme 72 | -------------------------------------------------------------------------------- /snippet/hist/debian.sh: -------------------------------------------------------------------------------- 1 | apt list --installed 2 | apt-clone clone nom-source 3 | apt-clone restore nom-source.apt-clone.tar.gz # sudo 4 | apt=get-auto ; apt-mark showauto > liste-auto 5 | apt=get-manual ; apt-mark showmanual > liste-manuel 6 | apt=get-pkg ; apt-get update ; apt-get dist-upgrade ; dpkg --get-selections > liste-paquets 7 | apt=set-auto ; xargs apt-mark auto < liste-auto # sudo 8 | apt=set-manuel ; apt-mark manual $(cat liste-manuel) # sudo 9 | apt=set-pkg ; apt-get update ; dselect update ; dselect upgrade ; dpkg --set-selections < liste-paquets ; dselect install # sudo 10 | apt=set-pkg ; dpkg --set-selections < liste-paquets ; apt-get dselect-upgrade # sudo 11 | apt=sync-available ; apt-cache dumpavail | dpkg --merge-avail 12 | apt=sync-available ; apt-get install dctrl-tools ; sync-available 13 | apt=sync-available-and-update ; dselect update 14 | dpkg --set-selections < liste-paquets ; apt-get dselect-upgrade # sudo 15 | dpkg-query -l # sudo 16 | dpkg-reconfigure paquet # sudo 17 | update-alternatives --display java # sudo 18 | update-alternatives --list java # sudo 19 | update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java # sudo 20 | -------------------------------------------------------------------------------- /shell/search/ripgrep-pipe.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | fichier=$1 4 | 5 | type_fichier=$(file -L -z $fichier) || type_fichier=$(file -L $fichier) 6 | 7 | if [[ $type_fichier = *:*PDF* ]] 8 | then 9 | exec pdftotext $fichier - 10 | 11 | elif [[ $fichier = *.html ]] 12 | then 13 | exec w3m -dump $fichier 14 | 15 | elif [[ $type_fichier = *:*OpenDocument* ]] 16 | then 17 | exec odt2txt $fichier 18 | 19 | elif [[ $type_fichier = *:*gzip*compressed* ]] 20 | then 21 | exec zcat $fichier 22 | 23 | elif [[ $type_fichier = *:*bzip*compressed* ]] 24 | then 25 | exec bzcat $fichier 26 | 27 | elif [[ $type_fichier = *:*lzma*compressed* ]] 28 | then 29 | exec lzcat $fichier 30 | 31 | elif [[ $type_fichier = *:*XZ*compressed* ]] 32 | then 33 | exec xzcat $fichier 34 | 35 | elif [[ $type_fichier = *:*Zstandard*compressed* ]] 36 | then 37 | exec zstdcat $fichier 38 | 39 | elif [[ $type_fichier = *:*(PNG|JPEG|GIF)*image* ]] 40 | then 41 | exec exiv2 pr $fichier 42 | 43 | elif [[ $type_fichier = *:*Ogg*Vorbis*audio* ]] 44 | then 45 | exec ogginfo $fichier 46 | 47 | elif [[ $type_fichier = *:*MPEG*ADTS*layer*III* ]] 48 | then 49 | exec mediainfo $fichier 50 | 51 | fi 52 | -------------------------------------------------------------------------------- /shell/multimedia/pico-words-to-ogg.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | [ $# -eq 0 -o x$1 = x-h -o x$1 = x--help ] && { 4 | echo Usage : $(basename $0) audiofile "words" language 5 | echo 6 | echo language is en-US by default 7 | echo 8 | echo Prerequisites : pico2wave sox ffmpeg 9 | echo 10 | exit 0 11 | } 12 | 13 | audiofile=${1:-"audiofile"} 14 | text=${2:-"Example text."} 15 | language=${3:-"en-US"} 16 | 17 | echo pico2wave -l $language -w $audiofile.wav $text 18 | echo 19 | pico2wave -l $language -w $audiofile.wav "$text" 20 | 21 | echo 22 | echo "------------------------------" 23 | echo 24 | 25 | echo ffmpeg -i "$audiofile.wav" -threads 2 -vn -codec:a libvorbis -q:a 7 -ac 2 "$audiofile-tmp.ogg" 26 | echo 27 | ffmpeg -i "$audiofile.wav" -threads 2 -vn -codec:a libvorbis -q:a 7 -ac 2 "$audiofile-tmp.ogg" 28 | 29 | echo 30 | echo "------------------------------" 31 | echo 32 | 33 | echo sox $audiofile-tmp.ogg $audiofile.ogg pad 0.5 0.5 34 | echo 35 | sox $audiofile-tmp.ogg $audiofile.ogg pad 0.5 0.5 36 | 37 | echo 38 | echo "------------------------------" 39 | echo 40 | 41 | echo rm -rf $audiofile.wav $audiofile-tmp.ogg 42 | echo 43 | rm -rf $audiofile.wav $audiofile-tmp.ogg 44 | -------------------------------------------------------------------------------- /self/bin/system/update-artix.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # player {{{1 4 | 5 | player () { 6 | 7 | local fu_volume=$1 8 | local fu_fichier=$2 9 | 10 | [[ $fu_fichier[1] != / ]] && { 11 | 12 | fu_fichier=~/audio/bell/$fu_fichier 13 | } 14 | 15 | mpv-socket.bash add $fu_fichier 16 | mpv-socket.bash volume $fu_volume 17 | } 18 | 19 | # clean cache {{{1 20 | 21 | sudo pacman -Scc --noconfirm 22 | 23 | # check site {{{1 24 | 25 | w3m https://artixlinux.org 26 | w3m https://archlinux.org 27 | 28 | # refresh {{{1 29 | 30 | sudo pacman -Syy 31 | 32 | # new keys {{{1 33 | 34 | sudo pacman -S --needed artix-keyring archlinux-keyring 35 | 36 | # update {{{1 37 | 38 | sudo pacman -Su 39 | 40 | # playing {{{1 41 | 42 | fini=$HOME/audio/bell/notification/fin-mise-a-jour.ogg 43 | integer volume=100 44 | 45 | player $volume $fini 46 | 47 | # config diff {{{1 48 | 49 | sudo pacdiff -s 50 | 51 | # remove orphans {{{1 52 | 53 | sudo pacman -Qdtq | sudo pacman -Rns - 54 | 55 | # update files db {{{1 56 | 57 | sudo pacman -Fy 58 | sudo pkgfile -u 59 | 60 | # reset keyboard to custom layout {{{1 61 | 62 | setxkbmap be 63 | xmodmap ~/racine/config/windenv/xmodmap/belge-meta-super-hyper 64 | -------------------------------------------------------------------------------- /automat/alarm-memory.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # vim: set filetype=zsh: 3 | 4 | zmodload zsh/mathfunc 5 | 6 | # {{{ Fonctions 7 | 8 | player () { 9 | 10 | local fu_volume=$1 11 | local fu_fichier=$2 12 | 13 | [[ $fu_fichier[1] != / ]] && { 14 | 15 | fu_fichier=~/audio/bell/$fu_fichier 16 | } 17 | 18 | mpv-socket.bash replace $fu_fichier 19 | mpv-socket.bash volume $fu_volume 20 | } 21 | 22 | # }}} 23 | 24 | low=${1:-10} 25 | volume=${2:-100} 26 | fichier=~/audio/bell/notification/memoire.ogg 27 | 28 | zzz=30 29 | 30 | while true 31 | do 32 | float available=$(free | grep Mem | awk '{print $7}') 33 | float total=$(free | grep Mem | awk '{print $2}') 34 | float used=$(free | grep Mem | awk '{print $2 - $7}') 35 | integer ratio_available=$(( available / total * 100 )) 36 | integer ratio_used=$(( used / total * 100 )) 37 | if (( ratio_available < low )) 38 | then 39 | echo playing $fichier 40 | echo 41 | player $volume $fichier 42 | zzz=4 43 | elif (( ratio_available < 2 * low )) 44 | then 45 | zzz=5 46 | else 47 | zzz=30 48 | fi 49 | echo available : $ratio_available % 50 | echo used : $ratio_used % 51 | echo sleep : $zzz seconds 52 | echo 53 | sleep $zzz 54 | done 55 | -------------------------------------------------------------------------------- /automat/bspwm-autostop.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | # vim: set filetype=sh : 4 | # vim: set fdm=marker : 5 | 6 | # Chemins d’accès {{{1 7 | 8 | source ~/racine/config/cmdline/zsh/zprofile 9 | 10 | # }}}1 11 | 12 | # Variables {{{1 13 | 14 | HOST=`hostname -s` 15 | 16 | # }}}1 17 | 18 | pkill -f redshift-gtk & 19 | pkill -f xcape & 20 | pkill -f flameshot & 21 | pkill -f unclutter & 22 | pkill -f udiskie & 23 | pkill -f alarm-battery.zsh & 24 | pkill -f alarm-memory.zsh & 25 | pkill -f alarm-sensor.zsh & 26 | pkill -f load_cycle_fix & 27 | pkill -f nm-applet & 28 | pkill -f blueman-applet & 29 | pkill -f wallpaper.zsh & 30 | pkill -f sxhkd & 31 | pkill -f keynav & 32 | pkill -f picom & 33 | pkill -f /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & 34 | pkill -f greenclip & 35 | pkill -f clipmenud & 36 | pkill -f dunst & 37 | pkill -f log-notifications.bash & 38 | pkill -f remind-server.zsh & 39 | pkill -f remind & 40 | pkill -f mpd & 41 | pkill -f clock.zsh & 42 | pkill -f syncthing.sh & 43 | dad -d ~/racine/gate/download stop & 44 | #pkill -f hexchat & 45 | pkill -f quasselcore & 46 | pkill -f quasselclient & 47 | pkill -f element-desktop & 48 | pkill -f kdeconnect & 49 | pkill -f bspwm-subscribe.zsh & 50 | -------------------------------------------------------------------------------- /self/bin/build/build-creambrowser.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env sh 2 | 3 | # {{{ Documentation 4 | 5 | # Usage: ./build.sh [options...] 6 | # 7 | # Options: 8 | # --prefix= Use PREFIX for installation (default: /usr) 9 | # --sysconfdir= Use SYSCONFDIR for configuration installation (default: /etc 10 | # --enable-vte Enable VTE Terminal support (if present) 11 | # --disable-vte Disable VTE Terminal support (even if present) 12 | # --help Print this message 13 | 14 | # }}} 15 | 16 | # {{{ Préconfig 17 | 18 | # Nécessaire dans certains dépôts pour générer le fichier configure 19 | 20 | #sh autogen.sh 21 | 22 | # }}} 23 | 24 | # {{{ Clean 25 | 26 | make clean 27 | make distclean 28 | 29 | # }}} 30 | 31 | # {{{ Configure 32 | 33 | # Prérequis : 34 | # 35 | # sudo aptitude install cmake 36 | # sudo aptitude install libwebkit-dev libconfuse-dev libvte-dev 37 | 38 | # Attention à ne pas mettre de commentaire 39 | # entre deux lignes, sinon le shell croit 40 | # qu'il s'agit de la commande suivante 41 | 42 | ./build.sh \ 43 | --prefix=/usr/local \ 44 | --enable-vte 45 | 46 | # }}} 47 | 48 | # {{{ Make 49 | 50 | #make 51 | #make check 52 | #sudo make install 53 | 54 | # }}} 55 | -------------------------------------------------------------------------------- /shell/multimedia/mpv-pipe.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # vim: set filetype=zsh : 4 | 5 | # Options {{{1 6 | 7 | emulate -R zsh 8 | 9 | setopt local_options 10 | 11 | setopt warn_create_global 12 | 13 | setopt extended_glob 14 | 15 | # }}}1 16 | 17 | # Fonctions {{{1 18 | 19 | mpv-msg() { 20 | local tosend='' 21 | local arg 22 | for arg in "$@"; do 23 | tosend="$tosend \"$arg\" " 24 | done 25 | echo $tosend 26 | echo $tosend > ~/racine/run/pipe/mpv 27 | } 28 | 29 | # }}}1 30 | 31 | # exit mpv 32 | [ "$1" = "quit" ] && mpv-msg 'quit' 33 | # adjust volume 34 | [ "$1" = "volume" ] && mpv-msg 'set' 'volume' $2 35 | # toggle play-pause 36 | [ "$1" = "play-pause" ] && mpv-msg 'cycle' 'pause' 37 | # start playing 38 | [ "$1" = "pause" ] && mpv-msg 'set' 'pause' 'yes' 39 | # stop playing 40 | [ "$1" = "play" ] && mpv-msg 'set' 'pause' 'no' 41 | # play next item in playlist 42 | [ "$1" = "next" ] && mpv-msg 'playlist_next' 43 | # play previous item in playlist 44 | [ "$1" = "previous" ] && mpv-msg 'playlist_prev' 45 | # add item(s) to playlist 46 | [ "$1" = "add" ] && shift && 47 | for video in "$@"; do 48 | mpv-msg 'loadfile' "$video" 'append-play'; 49 | done; 50 | # replace 51 | [ "$1" = "replace" ] && mpv-msg 'loadfile' "$2" 'replace'; 52 | -------------------------------------------------------------------------------- /shell/windenv/tabbed-client.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Credit: 4 | # https://gist.github.com/jpentland/468a42c172eb607bb950f5d00606312c 5 | 6 | # Usage: 7 | # tabc.sh 8 | # Commands: 9 | # add - Add window to tabbed 10 | # remove - Remove window from tabbed 11 | # list - List all clients of tabbed 12 | 13 | # 14 | # Functions 15 | # 16 | 17 | # Get wid of root window 18 | function get_root_wid { 19 | xwininfo -root | awk '/Window id:/{print $4}' 20 | } 21 | 22 | # Get children of tabbed 23 | function get_clients { 24 | id=$1 25 | xwininfo -id $id -children | sed -n '/[0-9]\+ \(child\|children\):/,$s/ \+\(0x[0-9a-z]\+\).*/\1/p' 26 | } 27 | 28 | # Get class of a wid 29 | function get_class { 30 | id=$1 31 | xprop -id $id | sed -n '/WM_CLASS/s/.*, "\(.*\)"/\1/p' 32 | } 33 | 34 | # 35 | # Main Program 36 | # 37 | 38 | tabbed=$1; shift 39 | if [ "$(get_class $tabbed)" != "tabbed" ]; then 40 | echo "Not an instance of tabbed" 2>&1 41 | fi 42 | 43 | cmd=$1; shift 44 | 45 | case $cmd in 46 | add) 47 | wid=$1; shift 48 | xdotool windowreparent $wid $tabbed 49 | ;; 50 | remove) 51 | wid=$1; shift 52 | xdotool windowreparent $wid $(get_root_wid) 53 | ;; 54 | list) 55 | get_clients $tabbed 56 | ;; 57 | esac 58 | -------------------------------------------------------------------------------- /snippet/hist/mint.sh: -------------------------------------------------------------------------------- 1 | # apt autoremove 2 | # apt clean 3 | apt autoclean # sudo 4 | apt install build-essential checkinstall # sudo 5 | apt install mintupgrade # sudo 6 | apt install snapd # sudo 7 | apt-file search notify-send 8 | apt-file update # sudo 9 | clavier=1 ; onboard&! 10 | dpkg=list-packages-by-size ; dpkg-query -Wf '${Installed-size}\t${Package}\n' | column -t | sort -n -k1 11 | dpkg=purge-uninstalled-packages ; dpkg --list |grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg --purge 12 | install=unison ; sudo cp ./src/unison /usr/local/bin 13 | mintupgrade check 14 | mintupgrade download 15 | mintupgrade upgrade 16 | monte=diskext-sdb1 ; udevil mount /dev/sdb1 /media/user_name/diskext-sdb1 17 | nala upgrade 18 | nmcli networking connectivity 19 | signal=i3blocks-mpd ; k -36 $(pid i3blocks) 20 | signal=i3blocks-volume ; k -35 $(pid i3blocks) 21 | snap changes 22 | snap find qutebrowser 23 | snap list 24 | sudo ln -s ~/.w3m/cgi-bin/*clipboard* /usr/lib/w3m/cgi-bin 25 | sudo make install PREFIX=/usr/local 26 | sudo snap install qutebrowser 27 | sudo snap refresh qutebrowser 28 | sudo snap remove qutebrowser 29 | sudo systemctl enable --now snapd.socket # pas nécessaire sur mint 30 | sync=cleusb ; sn ~syncron/cleusb/ /media/cleusb/syncron 31 | ~source/unison-2.51.2 && make UISTYLE=text 32 | -------------------------------------------------------------------------------- /shell/multimedia/fluid-player.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # rlwrap solution {{{1 4 | 5 | rlwrap \ 6 | --always-readline --history-no-dupes 2 \ 7 | -H ~/racine/hist/rlwrap/fluid.history \ 8 | -f ~/racine/hist/rlwrap/fluid.comp \ 9 | fluidsynth -a alsa -m alsa_seq /usr/share/soundfonts/FluidR3_GM.sf2 "$@" 10 | 11 | # pipe solution, doesnt work {{{1 12 | 13 | # pipe=~/racine/run/pipe/fluidsynth 14 | # fluidsynth -a alsa -m alsa_seq /usr/share/soundfonts/FluidR3_GM.sf2 "$@" < $pipe & 15 | # printf 'fluid > ' 16 | # while read -r line 17 | # do 18 | # case $line in 19 | # q) 20 | # echo quit > $pipe 21 | # ;; 22 | # p) 23 | # echo player_stop > $pipe 24 | # ;; 25 | # c) 26 | # echo player_cont > $pipe 27 | # ;; 28 | # j) 29 | # echo 'player_seek +3000' > $pipe 30 | # ;; 31 | # k) 32 | # echo 'player_seek -3000' > $pipe 33 | # ;; 34 | # l) 35 | # echo 'player_seek +9000' > $pipe 36 | # ;; 37 | # h) 38 | # echo 'player_seek -9000' > $pipe 39 | # ;; 40 | # esac 41 | # printf 'fluid > ' 42 | # done 43 | 44 | # server solution, doesnt work {{{1 45 | 46 | # fluidsynth \ 47 | # --audio-driver=alsa \ 48 | # --midi-driver=alsa_seq \ 49 | # --server \ 50 | # -o shell.port=9988 \ 51 | # /usr/share/soundfonts/FluidR3_GM.sf2 \ 52 | # "$@" & 53 | -------------------------------------------------------------------------------- /automat/hlwm-autostop.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # vim: set fdm=marker : 4 | 5 | # Chemins d’accès {{{1 6 | 7 | source ~/racine/config/cmdline/zsh/zprofile 8 | 9 | # Variables {{{1 10 | 11 | HOST=`hostname -s` 12 | 13 | # Clean up {{{1 14 | 15 | pkill -f redshift-gtk & 16 | pkill -f redshift & 17 | pkill -f xcape & 18 | pkill -f unclutter & 19 | pkill -f udiskie & 20 | pkill -f alarm-battery.zsh & 21 | pkill -f alarm-memory.zsh & 22 | pkill -f alarm-sensor.zsh & 23 | pkill -f load_cycle_fix & 24 | pkill -f nm-applet & 25 | pkill -f protonvpn-app & 26 | pkill -f blueman-applet & 27 | pkill -f wallpaper.zsh & 28 | pkill -f sxhkd & 29 | #pkill -f keynav & 30 | pkill -f picom & 31 | pkill -f /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & 32 | pkill -f clipmenud & 33 | pkill -f dunst & 34 | pkill -f log-notifications.bash & 35 | pkill -f remind-server.zsh & 36 | pkill -f remind & 37 | pkill -f mpd & 38 | pkill -f timidity & 39 | pkill -f clock.zsh & 40 | pkill -f aria2c & 41 | pkill -f transmission-daemon & 42 | pkill -f syncthing.sh & 43 | dad -d ~/racine/gate/download stop & 44 | #pkill -f hexchat & 45 | #pkill -f quasselcore & 46 | #pkill -f quasselclient & 47 | pkill -f element-desktop & 48 | pkill -f kdeconnect & 49 | 50 | if [ $HOST = mandala ] 51 | then 52 | # ... 53 | fi 54 | -------------------------------------------------------------------------------- /snippet/Makefile: -------------------------------------------------------------------------------- 1 | # vim: set ft=make : 2 | 3 | SHELL=/bin/bash 4 | 5 | TREE_LS = $(shell ls **/*) 6 | TREE_C = $(shell zsh -c 'print **/*') 7 | 8 | tree: 9 | @echo $(TREE_LS) 10 | @echo 11 | @echo $(TREE_C) 12 | @echo 13 | 14 | ZSH_FILES := $(shell find . -maxdepth 2 -type f -regex '.*\.zsh') 15 | FIND := $(filter-out ./,$(dir $(ZSH_FILES))) 16 | 17 | find: 18 | echo $(ZSH_FILES}) 19 | echo $(FIND) 20 | 21 | 22 | LS := $(shell ls -d */) 23 | 24 | ls: 25 | echo $(LS) 26 | 27 | rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)) 28 | 29 | RWILD := $(call rwildcard,./,*.zsh) 30 | 31 | rwild: 32 | echo $(RWILD) 33 | 34 | # -- 35 | 36 | subdirs := $(wildcard */) 37 | sources := $(wildcard $(addsuffix *.zsh,$(subdirs))) 38 | patsub := $(patsubst %.zsh,%.coucou,$(sources)) 39 | snip_files := $(wildcard *.snip) 40 | ps := $(snip_files:%.snip=%.replaced) 41 | 42 | patsub: 43 | @echo $(patsub) 44 | @echo $(ps) 45 | 46 | 47 | recurfind = $(shell find $(1) -name '$(2)') 48 | SRCS := $(call recurfind,.,*.zsh) $(call recurfind,.,*.snip) 49 | 50 | recurfind: 51 | echo $(SRCS) 52 | 53 | SNIP_FILES = hist/archlinux.snip hist/freebsd.snip hist/linuxmint.snip 54 | 55 | $(filter %.snip,$(SNIP_FILES)): %.snip: %.zsh 56 | @echo "target: $@ prereq: $<" 57 | -------------------------------------------------------------------------------- /self/bin/system/update-manjaro.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # player {{{1 4 | 5 | player () { 6 | 7 | local fu_volume=$1 8 | local fu_fichier=$2 9 | 10 | [[ $fu_fichier[1] != / ]] && { 11 | 12 | fu_fichier=~/audio/bell/$fu_fichier 13 | } 14 | 15 | mpv-socket.bash add $fu_fichier 16 | mpv-socket.bash volume $fu_volume 17 | } 18 | 19 | # clean cache {{{1 20 | 21 | sudo pacman -Scc --noconfirm 22 | 23 | # check site {{{1 24 | 25 | w3m https://archlinux.org 26 | 27 | # update mirrors {{{1 28 | 29 | #sudo pacman-mirrors --fasttrack 30 | sudo pacman-mirrors --country Germany --timeout 5 31 | 32 | # refresh {{{1 33 | 34 | sudo pacman -Syy 35 | 36 | # new keys {{{1 37 | 38 | # the manjaro pacman should to it by itself 39 | #sudo pacman -S --needed manjaro-keyring 40 | 41 | # update {{{1 42 | 43 | sudo pacman -Su 44 | 45 | # playing {{{1 46 | 47 | fini=$HOME/audio/bell/notification/fin-mise-a-jour.ogg 48 | integer volume=100 49 | 50 | player $volume $fini 51 | 52 | # config diff {{{1 53 | 54 | sudo pacdiff -s 55 | 56 | # remove orphans {{{1 57 | 58 | sudo pacman -Qdtq | sudo pacman -Rns - 59 | 60 | # update files db {{{1 61 | 62 | sudo pacman -Fy 63 | #sudo pkfile -u 64 | 65 | # reset keyboard to custom layout {{{1 66 | 67 | setxkbmap be 68 | xmodmap ~/racine/config/windenv/xmodmap/belge-meta-super-hyper 69 | -------------------------------------------------------------------------------- /self/bin/system/update-archlinux.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # player {{{1 4 | 5 | player () { 6 | 7 | local fu_volume=$1 8 | local fu_fichier=$2 9 | 10 | [[ $fu_fichier[1] != / ]] && { 11 | 12 | fu_fichier=~/audio/bell/$fu_fichier 13 | } 14 | 15 | mpv-socket.bash add $fu_fichier 16 | mpv-socket.bash volume $fu_volume 17 | } 18 | 19 | # clean cache {{{1 20 | 21 | sudo pacman -Scc --noconfirm 22 | 23 | # check site {{{1 24 | 25 | w3m https://archlinux.org 26 | 27 | # update mirrors {{{1 28 | 29 | echo 30 | echo Updating mirror list with reflector 31 | echo 32 | 33 | sudo reflector --latest 12 --sort rate --save /etc/pacman.d/mirrorlist 34 | 35 | # refresh {{{1 36 | 37 | sudo pacman -Syy 38 | 39 | # new keys {{{1 40 | 41 | sudo pacman -S --needed archlinux-keyring 42 | 43 | # update {{{1 44 | 45 | sudo pacman -Su 46 | 47 | # playing {{{1 48 | 49 | fini=$HOME/audio/bell/notification/fin-mise-a-jour.ogg 50 | integer volume=100 51 | 52 | player $volume $fini 53 | 54 | # config diff {{{1 55 | 56 | sudo pacdiff -s 57 | 58 | # remove orphans {{{1 59 | 60 | sudo pacman -Qdtq | sudo pacman -Rns - 61 | 62 | # update files db {{{1 63 | 64 | sudo pacman -Fy 65 | #sudo pkfile -u 66 | 67 | # reset keyboard to custom layout {{{1 68 | 69 | setxkbmap be 70 | xmodmap ~/racine/config/windenv/xmodmap/belge-meta-super-hyper 71 | -------------------------------------------------------------------------------- /shell/pack/owlman_update_repository: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | if [ $# -eq 0 ] ; then 4 | printf "'%s' %s\n" "$0" "requires a path as argument" >&2 5 | exit 3 6 | fi 7 | 8 | repo=$1 9 | format=$(find "$repo" -maxdepth 1 -type d -regex '.*\(\.git\|\.hg\|\.bzr\|\.svn\|_darcs\|CVS\)' -printf '%f' | head -1 | tr -dc '[:alpha:]') 10 | 11 | if [ -z "$format" ] ; then 12 | printf "%s\n" "no repository found" >&2 13 | exit 2 14 | fi 15 | 16 | no_changes=0 17 | tmp_out=$(mktemp) 18 | 19 | cd "$repo" 20 | 21 | case "$format" in 22 | git) 23 | git pull | tee "$tmp_out" 24 | if [ -s "$tmp_out" ] ; then 25 | grep -iq '^already up-to-date' "$tmp_out" && no_changes=1 26 | else 27 | no_changes=1 28 | fi 29 | ;; 30 | hg) 31 | hg pull -u | tee "$tmp_out" 32 | grep -iq '^no changes found' "$tmp_out" && no_changes=1 33 | ;; 34 | bzr) 35 | bzr update > "$tmp_out" 2>&1 36 | grep -iq '^tree is up to date' "$tmp_out" && no_changes=1 37 | ;; 38 | svn) 39 | svn update | tee "$tmp_out" 40 | grep -iq '^at revision' "$tmp_out" && no_changes=1 41 | ;; 42 | darcs) 43 | darcs pull | tee "$tmp_out" 44 | grep -iq '^no remote changes to pull' "$tmp_out" && no_changes=1 45 | ;; 46 | CVS) 47 | cvs update > "$tmp_out" 2>&1 48 | cat "$tmp_out" 49 | grep -iqv '^cvs update:' "$tmp_out" || no_changes=1 50 | ;; 51 | esac 52 | 53 | rm "$tmp_out" 54 | 55 | exit $no_changes 56 | -------------------------------------------------------------------------------- /shell/windenv/adapt-screens.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | if [ $HOST = taijitu ] 4 | then 5 | connected=$(xrandr --query | grep -w connected | grep 'HDMI-1') 6 | hdmi=$? 7 | else 8 | connected=$(xrandr --query | grep -w connected | grep 'HDMI1') 9 | hdmi=$? 10 | fi 11 | 12 | echo connected hdmi : $connected 13 | echo hdmi : $hdmi 14 | echo 15 | 16 | if [[ $hdmi -eq 0 ]] 17 | then 18 | echo "HDMI connected" 19 | # -- xrandr 20 | if [ $HOST = taijitu ] 21 | then 22 | xrandr --output eDP-1 --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-1 --mode 1920x1080 --pos 1920x0 --rotate normal --output DP-1 --off 23 | else 24 | xrandr --output LVDS1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI1 --mode 1920x1080 --pos 1920x0 --rotate normal --output DP-1 --off 25 | fi 26 | # -- bspwm 27 | #bspc monitor LVDS1 -n 0 -d term edit browser office artisan entertain misc 28 | #bspc monitor HDMI1 -n 1 -d movie sport game 29 | # -- polybar 30 | polybar.zsh 31 | echo "---" | tee -a ~/log/polybar/superieur_hdmi.log ~/log/polybar/inferieur_hdmi.log 32 | polybar superieur_hdmi >>~/log/polybar/superieur_hdmi.log 2>&1 & 33 | polybar inferieur_hdmi >>~/log/polybar/inferieur_hdmi.log 2>&1 & 34 | echo "Bars launched..." 35 | else 36 | echo "HDMI disconnected" 37 | #bspc monitor eDP-1 -d term edit browser office artisan entertain misc 38 | polybar.zsh 39 | fi 40 | -------------------------------------------------------------------------------- /snippet/git.snip: -------------------------------------------------------------------------------- 1 | 2 | # Git snippets 3 | 4 | # vim: set filetype=conf: 5 | 6 | # Github 7 | # ============================== 8 | 9 | # HTTPS 10 | # --------------- 11 | 12 | …or create a new repository on the command line 13 | 14 | echo "# eclats2vers" >> README.md 15 | git init 16 | git add README.md 17 | git commit -m "first commit" 18 | git remote add origin https://github.com/user_name/eclats2vers.git 19 | git push -u origin master 20 | 21 | …or push an existing repository from the command line 22 | 23 | git remote add origin https://github.com/user_name/eclats2vers.git 24 | git push -u origin master 25 | 26 | …or import code from another repository 27 | 28 | You can initialize this repository with code from a Subversion, Mercurial, or TFS project. 29 | 30 | # SSH 31 | # --------------- 32 | 33 | …or create a new repository on the command line 34 | 35 | echo "# eclats2vers" >> README.md 36 | git init 37 | git add README.md 38 | git commit -m "first commit" 39 | git remote add origin git@github.com:user_name/eclats2vers.git 40 | git push -u origin master 41 | 42 | …or push an existing repository from the command line 43 | 44 | git remote add origin git@github.com:user_name/eclats2vers.git 45 | git push -u origin master 46 | 47 | …or import code from another repository 48 | 49 | You can initialize this repository with code from a Subversion, Mercurial, or TFS project. 50 | -------------------------------------------------------------------------------- /automat/mail-boxes.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | setopt nullglob 4 | 5 | boites=() 6 | 7 | # Boîte spool {{{1 8 | 9 | # /var/spool/mail/$USER 10 | # ou 11 | # /var/mail/$USER 12 | 13 | boites+=(/var/spool/mail/$USER) 14 | 15 | # Boites mbox dans ~/racine/mail {{{1 16 | 17 | cd ~/racine/mail 18 | 19 | reps=(system theme list search archive) 20 | 21 | for repertoire in $reps 22 | do 23 | globe=(${repertoire}/**/*(.)) 24 | boites+=("="$^globe) 25 | done 26 | 27 | # Boîtes maildir {{{1 28 | 29 | boites+=("=procmail/save") 30 | 31 | # Boites imap dans ~/racine/mail/imap {{{1 32 | 33 | boites+=($(find ~/racine/mail/imap -type d -name cur | sort | sed -e 's:/cur/*$::' -e 's/ /\\ /g' | tr '\n' ' ')) 34 | 35 | # Usenet (plus ou moins boites MH) {{{1 36 | 37 | cd ~/racine/news/spool/news 38 | 39 | repertoires=($(find ~/racine/news/spool/news -type d | sort)) 40 | 41 | groupes=() 42 | 43 | for candidat in $=repertoires 44 | do 45 | # Le répertoire doit contenir des fichiers 46 | # pour être considéré comme une boîte aux lettres 47 | fichiers=($candidat/*(.)) 48 | Nfichiers=${#fichiers} 49 | if (( Nfichiers == 0 )) 50 | then 51 | continue 52 | fi 53 | #echo $Nfichiers $repertoire 54 | groupes+=($candidat) 55 | done 56 | 57 | boites+=($groupes) 58 | 59 | # Saved {{{2 60 | 61 | boites+=($(find ~/racine/news/saved -type f | sort)) 62 | 63 | # Final {{{1 64 | 65 | echo -n $=boites 66 | -------------------------------------------------------------------------------- /shell/sync/save-pass.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # functions {{{1 4 | 5 | syncron () { 6 | rsync \ 7 | --verbose \ 8 | --progress \ 9 | --stats \ 10 | --human-readable \ 11 | --itemize-changes \ 12 | --log-file="$HOME/log/rsync.log" \ 13 | --rsh=ssh \ 14 | --recursive \ 15 | --modify-window=1 \ 16 | --owner \ 17 | --group \ 18 | --times \ 19 | --perms \ 20 | --links \ 21 | --update \ 22 | "$@" 23 | } 24 | 25 | copyforce () { 26 | rsync \ 27 | --verbose \ 28 | --progress \ 29 | --stats \ 30 | --human-readable \ 31 | --itemize-changes \ 32 | --log-file="$HOME/log/rsync.log" \ 33 | --rsh=ssh \ 34 | --recursive \ 35 | --modify-window=1 \ 36 | --owner \ 37 | --group \ 38 | --times \ 39 | --perms \ 40 | --links \ 41 | --ignore-times \ 42 | "$@" 43 | } 44 | 45 | # open pass {{{1 46 | 47 | pass_was_open=1 48 | 49 | tomb list || { 50 | pass_was_open=0 51 | pass open -vf || exit 1 52 | } 53 | 54 | # crypte directory {{{1 55 | 56 | cd ~/racine/config/crypte 57 | 58 | # backup password-store {{{1 59 | 60 | syncron ~/.password-store/ password-store-tomb 61 | 62 | # close pass {{{1 63 | 64 | pass close -v || exit 1 65 | 66 | # backup tomb and key {{{1 67 | 68 | copyforce password.tomb password.tomb.bak 69 | copyforce password.tomb.key password.tomb.key.bak 70 | 71 | # reopen pass {{{1 72 | 73 | [ $pass_was_open -eq 1 ] && pass open -vf 74 | -------------------------------------------------------------------------------- /shell/windenv/hlwm-swap.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Like hc's move command, but the moved window is replaced by a swap 3 | 4 | # credit: https://github.com/everett1992/herbstluftwm/blob/master/swap 5 | 6 | function hc() { 7 | herbstclient "$@" 8 | } 9 | 10 | function lock() { 11 | hc lock 12 | } 13 | function unlock() { 14 | hc unlock 15 | } 16 | 17 | direction=$1 18 | follow=${2:-dont-follow} 19 | 20 | echo direction : $direction 21 | echo 22 | 23 | case $direction in 24 | left) 25 | reverse=right 26 | ;; 27 | right) 28 | reverse=left 29 | ;; 30 | up) 31 | reverse=down 32 | ;; 33 | down) 34 | reverse=up 35 | ;; 36 | *) 37 | exit 1 38 | esac 39 | 40 | #lock 41 | #trap unlock EXIT 42 | 43 | prime_winid=$(hc attr clients.focus.winid) 44 | 45 | echo prime id : $prime_winid 46 | echo 47 | 48 | # focus window to switch with 49 | echo "hc focus $1" 50 | echo 51 | hc focus $1 52 | 53 | if [ $? -ne 0 ]; then 54 | echo $? 55 | exit 1 56 | fi 57 | 58 | next_winid=$(hc attr clients.focus.winid) 59 | 60 | echo next id : $next_winid 61 | echo 62 | 63 | layout=$(hc dump) 64 | 65 | echo $layout 66 | echo 67 | 68 | new_layout="$(echo "$layout" | sed -e "s/$prime_winid/SWAP_TOKEN/g; s/$next_winid/$prime_winid/g; s/SWAP_TOKEN/$next_winid/g")" 69 | 70 | echo $new_layout 71 | echo 72 | 73 | hc load "$new_layout" 74 | 75 | [ $follow = follow ] || hc focus $reverse 76 | 77 | #unlock 78 | -------------------------------------------------------------------------------- /site/eclats2vers/generic/image/Makefile: -------------------------------------------------------------------------------- 1 | # vim: set ft=make : 2 | 3 | include ../Makefile.inc 4 | 5 | .DEFAULT_GOAL := sync-html 6 | 7 | # phony {{{1 8 | 9 | .PHONY: debug 10 | 11 | .PHONY: html 12 | .PHONY: epub 13 | 14 | .PHONY: all install 15 | .PHONY: clean clean-html clean-epub wipe 16 | 17 | 18 | # debug {{{1 19 | 20 | debug: 21 | @echo $(SUBDIRS) 22 | 23 | 24 | # org -> html {{{1 25 | 26 | html: 27 | $(ECHO) nothing to do 28 | @$(ECHO) 29 | 30 | 31 | # org -> epub {{{1 32 | 33 | epub: 34 | $(ECHO) nothing to do 35 | @$(ECHO) 36 | 37 | 38 | # sync -> html dir {{{1 39 | 40 | dry-sync-html: html 41 | $(DRY_RSYNC) $(CUR_DIR)/ $(HTML_DIR) 42 | @$(ECHO) 43 | 44 | sync-html: html 45 | $(RSYNC) $(CUR_DIR)/ $(HTML_DIR) 46 | @$(ECHO) 47 | 48 | 49 | # sync -> epub dir {{{1 50 | 51 | dry-sync-epub: epub 52 | $(DRY_RSYNC) $(CUR_DIR)/ $(EPUB_DIR) 53 | @$(ECHO) 54 | 55 | sync-epub: epub 56 | $(RSYNC) $(CUR_DIR)/ $(EPUB_DIR) 57 | @$(ECHO) 58 | 59 | 60 | #sync all {{{1 61 | 62 | dry-sync: dry-sync-html dry-sync-epub 63 | 64 | sync: sync-html sync-epub 65 | 66 | 67 | # all, install, clean, wipe {{{1 68 | 69 | all: sync-html 70 | 71 | install: sync-html 72 | 73 | clean: 74 | rm -f ?*~ 75 | 76 | clean-html: 77 | rm -f ?*.html 78 | rm -f ?*~ 79 | 80 | clean-epub: 81 | rm -f ?*.epub 82 | rm -f ?*~ 83 | 84 | wipe: 85 | rm -f ?*.html 86 | rm -f ?*.epub 87 | rm -f ?*~ 88 | 89 | -------------------------------------------------------------------------------- /site/eclats2vers/generic/image/grimoire/Makefile: -------------------------------------------------------------------------------- 1 | # vim: set ft=make : 2 | 3 | include ../../Makefile.inc 4 | 5 | .DEFAULT_GOAL := sync-html 6 | 7 | # phony {{{1 8 | 9 | .PHONY: debug 10 | 11 | .PHONY: html 12 | .PHONY: epub 13 | 14 | .PHONY: all install 15 | .PHONY: clean clean-html clean-epub wipe 16 | 17 | 18 | # debug {{{1 19 | 20 | debug: 21 | @echo $(SUBDIRS) 22 | 23 | 24 | # org -> html {{{1 25 | 26 | html: 27 | $(ECHO) nothing to do 28 | @$(ECHO) 29 | 30 | 31 | # org -> epub {{{1 32 | 33 | epub: 34 | $(ECHO) nothing to do 35 | @$(ECHO) 36 | 37 | 38 | # sync -> html dir {{{1 39 | 40 | dry-sync-html: html 41 | $(DRY_RSYNC) $(CUR_DIR)/ $(HTML_DIR) 42 | @$(ECHO) 43 | 44 | sync-html: html 45 | $(RSYNC) $(CUR_DIR)/ $(HTML_DIR) 46 | @$(ECHO) 47 | 48 | 49 | # sync -> epub dir {{{1 50 | 51 | dry-sync-epub: epub 52 | $(DRY_RSYNC) $(CUR_DIR)/ $(EPUB_DIR) 53 | @$(ECHO) 54 | 55 | sync-epub: epub 56 | $(RSYNC) $(CUR_DIR)/ $(EPUB_DIR) 57 | @$(ECHO) 58 | 59 | 60 | #sync all {{{1 61 | 62 | dry-sync: dry-sync-html dry-sync-epub 63 | 64 | sync: sync-html sync-epub 65 | 66 | 67 | # all, install, clean, wipe {{{1 68 | 69 | all: sync-html 70 | 71 | install: sync-html 72 | 73 | clean: 74 | rm -f ?*~ 75 | 76 | clean-html: 77 | rm -f ?*.html 78 | rm -f ?*~ 79 | 80 | clean-epub: 81 | rm -f ?*.epub 82 | rm -f ?*~ 83 | 84 | wipe: 85 | rm -f ?*.html 86 | rm -f ?*.epub 87 | rm -f ?*~ 88 | 89 | -------------------------------------------------------------------------------- /site/eclats2vers/generic/image/musica/Makefile: -------------------------------------------------------------------------------- 1 | # vim: set ft=make : 2 | 3 | include ../../Makefile.inc 4 | 5 | .DEFAULT_GOAL := sync-html 6 | 7 | # phony {{{1 8 | 9 | .PHONY: debug 10 | 11 | .PHONY: html 12 | .PHONY: epub 13 | 14 | .PHONY: all install 15 | .PHONY: clean clean-html clean-epub wipe 16 | 17 | 18 | # debug {{{1 19 | 20 | debug: 21 | @echo $(SUBDIRS) 22 | 23 | 24 | # org -> html {{{1 25 | 26 | html: 27 | $(ECHO) nothing to do 28 | @$(ECHO) 29 | 30 | 31 | # org -> epub {{{1 32 | 33 | epub: 34 | $(ECHO) nothing to do 35 | @$(ECHO) 36 | 37 | 38 | # sync -> html dir {{{1 39 | 40 | dry-sync-html: html 41 | $(DRY_RSYNC) $(CUR_DIR)/ $(HTML_DIR) 42 | @$(ECHO) 43 | 44 | sync-html: html 45 | $(RSYNC) $(CUR_DIR)/ $(HTML_DIR) 46 | @$(ECHO) 47 | 48 | 49 | # sync -> epub dir {{{1 50 | 51 | dry-sync-epub: epub 52 | $(DRY_RSYNC) $(CUR_DIR)/ $(EPUB_DIR) 53 | @$(ECHO) 54 | 55 | sync-epub: epub 56 | $(RSYNC) $(CUR_DIR)/ $(EPUB_DIR) 57 | @$(ECHO) 58 | 59 | 60 | #sync all {{{1 61 | 62 | dry-sync: dry-sync-html dry-sync-epub 63 | 64 | sync: sync-html sync-epub 65 | 66 | 67 | # all, install, clean, wipe {{{1 68 | 69 | all: sync-html 70 | 71 | install: sync-html 72 | 73 | clean: 74 | rm -f ?*~ 75 | 76 | clean-html: 77 | rm -f ?*.html 78 | rm -f ?*~ 79 | 80 | clean-epub: 81 | rm -f ?*.epub 82 | rm -f ?*~ 83 | 84 | wipe: 85 | rm -f ?*.html 86 | rm -f ?*.epub 87 | rm -f ?*~ 88 | 89 | -------------------------------------------------------------------------------- /snippet/orgmode.snip: -------------------------------------------------------------------------------- 1 | 2 | # Org mode snippets 3 | 4 | # vim: set filetype=conf: 5 | 6 | # Listes à puces 7 | # ============================================================ 8 | 9 | 10 | 0. [@0] Coucou 11 | 12 | 1. Beu 13 | 14 | # En-têtes 15 | # ============================================================ 16 | 17 | # #+INCLUDE: "include/menu.org" :minlevel 1 18 | 19 | #+OPTIONS: H:6 20 | 21 | #+OPTIONS: tex:imagemagick 22 | #+OPTIONS: toc:0 23 | 24 | #+STARTUP: overview 25 | #+STARTUP: content 26 | #+STARTUP: showall 27 | 28 | # Voir aussi org-indent-mode : 29 | 30 | #+STARTUP: indent 31 | 32 | :PROPERTIES: 33 | :RESET_CHECK_BOXES: t 34 | :END: 35 | 36 | # Sous le titre d’une section à référencer 37 | # ============================================================ 38 | 39 | :PROPERTIES: 40 | :CUSTOM_ID: section:metriqueQuantitative 41 | :END: 42 | 43 | # Référence vers une section 44 | # ============================================================ 45 | 46 | [[file:musica-03-triangle.org::#section:dominanteSeconde][dominante seconde]] 47 | 48 | [[file:matemat-11-equadiff.org::#section:eulerLagrange][Euler - Lagrange]] 49 | 50 | # Lilypond 51 | # ============================================================ 52 | 53 | #+begin_src lilypond :file ionian.png :exports results 54 | \relative c' { 55 | c d e f g a b c b a g f e d c d e f g a b c b a g f e d c1 56 | } 57 | #+end_src 58 | 59 | #+RESULTS: 60 | [[file:ionian.png]] 61 | -------------------------------------------------------------------------------- /fun/zsh/zle/biblio-edit-command-line: -------------------------------------------------------------------------------- 1 | # Edit the command line using your usual editor. 2 | # Binding this to '!' in the vi command mode map, 3 | # autoload -Uz edit-command-line 4 | # zle -N edit-command-line 5 | # bindkey -M vicmd '!' edit-command-line 6 | # will give ksh-like behaviour for that key, 7 | # except that it will handle multi-line buffers properly. 8 | 9 | () { 10 | exec 0 )) 10 | then 11 | dossiers=($*) 12 | else 13 | cd ~/racine 14 | 15 | dossiers=() 16 | 17 | dossiers+=(artisan) 18 | dossiers+=(automat) 19 | dossiers+=(common) 20 | dossiers+=(config/*(/)) 21 | dossiers+=(dotdir) 22 | dossiers+=(feder) 23 | dossiers+=(fun) 24 | dossiers+=(hist) 25 | dossiers+=(hub) 26 | dossiers+=(index) 27 | dossiers+=(litera) 28 | dossiers+=(log) 29 | dossiers+=(musica) 30 | dossiers+=(news) 31 | dossiers+=(omni) 32 | dossiers+=(pack/bin) 33 | dossiers+=(pictura) 34 | dossiers+=(plain) 35 | dossiers+=(plugin/data) 36 | dossiers+=(refer) 37 | dossiers+=(science) 38 | dossiers+=(self) 39 | dossiers+=(session) 40 | dossiers+=(shell) 41 | dossiers+=(snippet) 42 | 43 | # Via hub 44 | 45 | #dossiers+=(hub/log) 46 | fi 47 | 48 | # Boucle {{{1 49 | 50 | for reper in $dossiers 51 | do 52 | echo 53 | echo "------------------------------------" 54 | echo 55 | 56 | echo "cd $reper" 57 | echo 58 | 59 | cd $reper 60 | 61 | [[ -d .hg ]] || { 62 | 63 | echo "hg init" 64 | echo 65 | 66 | hg init 67 | 68 | echo "hg add ." 69 | echo 70 | 71 | hg add . 72 | 73 | echo "hg commit -m \"Importation initiale\"" 74 | echo 75 | 76 | hg commit -m "Importation initiale" 77 | } 78 | 79 | cd - 80 | done 81 | -------------------------------------------------------------------------------- /self/bin/version/git-init.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | setopt null_glob 4 | 5 | date +" [=] %A %d %B %Y (o) %H:%M | %:z | " 6 | 7 | # Dossiers à archiver {{{1 8 | 9 | if (( $# > 0 )) 10 | then 11 | dossiers=($*) 12 | else 13 | cd ~/racine 14 | 15 | dossiers=() 16 | 17 | dossiers+=(artisan) 18 | dossiers+=(automat) 19 | dossiers+=(common) 20 | dossiers+=(config/*(/)) 21 | dossiers+=(dotdir) 22 | dossiers+=(feder) 23 | dossiers+=(fun) 24 | dossiers+=(hist) 25 | dossiers+=(hub) 26 | dossiers+=(index) 27 | dossiers+=(litera) 28 | dossiers+=(log) 29 | dossiers+=(musica) 30 | dossiers+=(news) 31 | dossiers+=(omni) 32 | dossiers+=(pack/bin) 33 | dossiers+=(pictura) 34 | dossiers+=(plain) 35 | dossiers+=(plugin/data) 36 | dossiers+=(refer) 37 | dossiers+=(science) 38 | dossiers+=(self) 39 | dossiers+=(session) 40 | dossiers+=(shell) 41 | dossiers+=(snippet) 42 | 43 | # Via hub 44 | 45 | #dossiers+=(hub/log) 46 | fi 47 | 48 | # Boucle {{{1 49 | 50 | for reper in $dossiers 51 | do 52 | echo 53 | echo "------------------------------------" 54 | echo 55 | 56 | echo "cd $reper" 57 | echo 58 | 59 | cd $reper 60 | 61 | [[ -d .git ]] || { 62 | 63 | echo "git init" 64 | echo 65 | 66 | git init 67 | 68 | echo "git add -A" 69 | echo 70 | 71 | git add -A 72 | 73 | echo "git commit -a -m \"Importation initiale\"" 74 | echo 75 | 76 | git commit -a -m "Importation initiale" 77 | } 78 | 79 | cd - 80 | done 81 | -------------------------------------------------------------------------------- /shell/multimedia/musescore-midi-to-ogg.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # vim: set filetype=zsh: 4 | 5 | # Variables {{{1 6 | 7 | #musescore=/usr/bin/musescore 8 | musescore=/usr/bin/mscore 9 | 10 | # }}}1 11 | 12 | # {{{ Arguments 13 | 14 | oggdir=. 15 | 16 | argumen=() 17 | 18 | while true 19 | do 20 | case $1 in 21 | -d) 22 | shift 23 | oggdir=$1 24 | shift 25 | ;; 26 | ?*) 27 | argumen+=$1 28 | shift 29 | ;; 30 | *) 31 | break 32 | ;; 33 | esac 34 | done 35 | 36 | [ -e $oggdir -a ! -d $oggdir ] && { 37 | echo Ogg dir must be a directory 38 | echo 39 | exit 1 40 | } 41 | 42 | [ -d $oggdir ] || mkdir -p $oggdir 43 | 44 | # }}} 45 | 46 | # Aide {{{1 47 | 48 | [ $#argumen -eq 0 ] && { 49 | echo Usage : $0 '[-d lily-dest-dir] file(s)' 50 | echo 51 | echo Convert musescore files to lilypond 52 | exit 0 53 | } 54 | 55 | # }}}1 56 | 57 | # Boucle {{{1 58 | 59 | for midi in $=argumen 60 | do 61 | [[ $midi = */* ]] || { 62 | midi=./$midi 63 | } 64 | 65 | musedir=${midi%/*} 66 | 67 | echo "cd $musedir" 68 | 69 | cd $musedir 70 | 71 | midi=${midi#$PWD/} 72 | 73 | # ogg dir 74 | 75 | echo 76 | echo "cd $oggdir" 77 | 78 | cd $oggdir 79 | 80 | ogg=${midi%.midi}.ogg 81 | 82 | [ ! -f $ogg -o $midi -nt $ogg ] && { 83 | echo 84 | echo "$musescore -o $ogg $midi" 85 | echo 86 | $musescore -o $ogg $midi 87 | } 88 | 89 | # back to last dir 90 | 91 | echo 92 | echo "cd -" 93 | 94 | cd - 95 | done 96 | 97 | # }}}1 98 | -------------------------------------------------------------------------------- /shell/multimedia/musescore-midi-to-mp3.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # vim: set filetype=zsh: 4 | 5 | # Variables {{{1 6 | 7 | #musescore=/usr/bin/musescore 8 | musescore=/usr/bin/mscore 9 | 10 | # }}}1 11 | 12 | # {{{ Arguments 13 | 14 | mp_dir=. 15 | 16 | argumen=() 17 | 18 | while true 19 | do 20 | case $1 in 21 | -d) 22 | shift 23 | mp_dir=$1 24 | shift 25 | ;; 26 | ?*) 27 | argumen+=$1 28 | shift 29 | ;; 30 | *) 31 | break 32 | ;; 33 | esac 34 | done 35 | 36 | [ -e $mp_dir -a ! -d $mp_dir ] && { 37 | echo mp3 dir must be a directory 38 | echo 39 | exit 1 40 | } 41 | 42 | [ -d $mp_dir ] || mkdir -p $mp_dir 43 | 44 | # }}} 45 | 46 | # Aide {{{1 47 | 48 | [ $#argumen -eq 0 ] && { 49 | echo Usage : $0 '[-d lily-dest-dir] file(s)' 50 | echo 51 | echo Convert musescore files to lilypond 52 | exit 0 53 | } 54 | 55 | # }}}1 56 | 57 | # Boucle {{{1 58 | 59 | for midi in $=argumen 60 | do 61 | [[ $midi = */* ]] || { 62 | midi=./$midi 63 | } 64 | 65 | musedir=${midi%/*} 66 | 67 | echo "cd $musedir" 68 | 69 | cd $musedir 70 | 71 | midi=${midi#$PWD/} 72 | 73 | # mp3 dir 74 | 75 | echo 76 | echo "cd $mp_dir" 77 | 78 | cd $mp_dir 79 | 80 | mpfile=${midi%.midi}.mp3 81 | 82 | [ ! -f $mpfile -o $midi -nt $mpfile ] && { 83 | echo 84 | echo "$musescore -o $mpfile $midi" 85 | echo 86 | $musescore -o $mpfile $midi 87 | } 88 | 89 | # back to last dir 90 | 91 | echo 92 | echo "cd -" 93 | 94 | cd - 95 | done 96 | 97 | # }}}1 98 | -------------------------------------------------------------------------------- /snippet/hist/void.sh: -------------------------------------------------------------------------------- 1 | source_repo=boootstrap ; ./xbps-src binary-bootstrap 2 | source_repo=build ; ./xbps-src pkg -o nonfree -f intel-media-driver 3 | source_repo=build ; ./xbps-src pkg paquet 4 | source_repo=git ; git clone https://github.com/void-linux/void-packages.git 5 | source_repo=help ; ./xbps-src -h 6 | source_repo=install ; xbps-install --repository ./hostdir/binpkgs paquet 7 | source_repo=show-options ; ./xbps-src show-options intel-media-driver 8 | sudo echo "KEYMAP=be" >> /etc/rc.conf 9 | sudo echo "echo bye" >> /etc/rc.conf.shutdown 10 | sudo echo "echo hello" >> /etc/rc.conf.local 11 | sudo ln -s /etc/sv/sshd /etc/runit/runsvdir/default 12 | sudo ln -s /etc/sv/sshd /var/service 13 | sudo vim /etc/default/libc-locales 14 | sudo vkpurge rm all 15 | sudo xbps-install -S octoxbps 16 | sudo xbps-install -S void-repo-multilib 17 | sudo xbps-install -S void-repo-multilib-nonfree 18 | sudo xbps-install -S void-repo-nonfree 19 | sudo xbps-install -S xtools 20 | sudo xbps-install -Su 21 | sudo xbps-install -Su xbps 22 | sudo xbps-reconfigure -f glibc-locales 23 | sv down sshd # sudo 24 | sv restart sshd # sudo 25 | sv status sshd 26 | sv up sshd # sudo 27 | void-installer # sudo 28 | xbps-pkgdb -m hold paquet 29 | xbps-pkgdb -m repolock paquet 30 | xbps-pkgdb -m repounlock paquet 31 | xbps-pkgdb -m unhold paquet 32 | xbps-query -Rs nom_paquet 33 | xbps-query -f paquet 34 | xbps-query -l 35 | xcheckrestart 36 | xdbg bash 37 | xdowngrade paquet.xbps 38 | xlocate -S # sudo 39 | xlocate fichier_dans_paquet 40 | -------------------------------------------------------------------------------- /shell/multimedia/play-fuzzy-list.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # vim: set filetype=zsh: 4 | 5 | unsetopt case_glob 6 | 7 | numarg=$# 8 | 9 | # {{{ Arguments 10 | 11 | aide=0 12 | 13 | stdin=0 14 | 15 | fanions=() 16 | 17 | while true 18 | do 19 | case $1 in 20 | -h) 21 | aide=1 22 | shift 23 | ;; 24 | -) 25 | stdin=1 26 | shift 27 | ;; 28 | -?*) 29 | fanions+=$1 30 | shift 31 | ;; 32 | ?*) 33 | fichier=$1 34 | shift 35 | ;; 36 | *) 37 | break 38 | ;; 39 | esac 40 | done 41 | 42 | [ -z $fichier ] && stdin=1 43 | 44 | # }}} 45 | 46 | # Affichage {{{1 47 | 48 | echo Fichier : $fichier 49 | echo Stdin : $stdin 50 | echo Fanions : $fanions 51 | echo 52 | 53 | # }}}1 54 | 55 | # Aide {{{1 56 | 57 | [ $numarg -eq 0 -o $aide -eq 1 ] && { 58 | echo "Usage: $(basename $0) list-file mpv-flags" 59 | echo "\tif list-file = - or none : reads stdin" 60 | echo 61 | exit 0 62 | } 63 | 64 | # }}}1 65 | 66 | liste=() 67 | 68 | if [ $stdin -gt 0 ] 69 | then 70 | echo Reading stdin 71 | echo 72 | while read motif 73 | do 74 | liste+=(**/*$motif*(.)) 75 | done 76 | else 77 | echo Reading $fichier 78 | echo 79 | cat $fichier | while read motif 80 | do 81 | liste+=(**/*$motif*(.)) 82 | done 83 | fi 84 | 85 | echo Playlist 86 | echo "------------------------------" 87 | echo 88 | print -l $liste 89 | echo 90 | echo Playing 91 | echo "------------------------------" 92 | echo 93 | echo "mpv $=fanions " 94 | echo 95 | mpv $=fanions $=liste 96 | -------------------------------------------------------------------------------- /shell/multimedia/sox-deejay.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # vim: set filetype=zsh: 4 | 5 | # {{{ Options 6 | 7 | emulate -R zsh 8 | 9 | setopt local_options 10 | 11 | setopt warn_create_global 12 | 13 | setopt extended_glob 14 | 15 | #setopt null_glob 16 | 17 | #zmodload zsh/regex 18 | 19 | # }}} 20 | 21 | # {{{ Arguments 22 | 23 | aide=0 24 | 25 | nombres=() 26 | 27 | autres=() 28 | 29 | while true 30 | do 31 | case $1 in 32 | -h) 33 | aide=1 34 | shift 35 | ;; 36 | [0-9.]##) 37 | nombres+=$1 38 | shift 39 | ;; 40 | ?*) 41 | autres+=$1 42 | shift 43 | ;; 44 | *) 45 | break 46 | ;; 47 | esac 48 | done 49 | 50 | # }}} 51 | 52 | # Aide {{{1 53 | 54 | [ $#autres -lt 2 -o $aide -eq 1 ] && { 55 | echo "Usage: $(basename $0) [duration] file-in-1 ... file-in-N file-out" 56 | exit 0 57 | } 58 | 59 | # }}}1 60 | 61 | # Variables {{{1 62 | 63 | duree=${${nombres[1]}:-1.0} 64 | 65 | entrees=($autres[1,-2]) 66 | sortie=($autres[-1]) 67 | 68 | temp=$$.$sortie 69 | 70 | # }}}1 71 | 72 | echo "cp $entrees[1] $temp" 73 | echo 74 | 75 | cp $entrees[1] $temp 76 | 77 | for ind in {2..$#entrees} 78 | do 79 | ajout=$entrees[$ind] 80 | 81 | echo "sox -V3 $temp $ajout $sortie splice -h $(soxi -D $temp),$duree" 82 | echo 83 | 84 | sox -V3 $temp $ajout $sortie splice -h $(soxi -D $temp),$duree 85 | 86 | echo 87 | echo "mv -f $sortie $temp" 88 | echo 89 | 90 | mv -f $sortie $temp 91 | done 92 | 93 | echo 94 | echo "mv -f $temp $sortie" 95 | echo 96 | 97 | mv -f $temp $sortie 98 | -------------------------------------------------------------------------------- /automat/update-version.zsh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env zsh 2 | 3 | setopt null_glob 4 | 5 | date +" [=] %A %d %B %Y (o) %H:%M | %:z | " 6 | 7 | directory=${1:-.} 8 | 9 | cd $directory 10 | 11 | # Git {{{1 12 | 13 | for folder in */.git(:h) */*/.git(:h) 14 | do 15 | echo "" 16 | echo "------------------------------------" 17 | echo "" 18 | 19 | echo "cd $folder" 20 | echo 21 | echo "git pull" 22 | 23 | cd $folder 24 | 25 | git pull || { git fetch --all && git reset --hard origin/master } 26 | 27 | cd - 28 | done 29 | 30 | # Mercurial {{{1 31 | 32 | for folder in */.hg(:h) */*/.hg(:h) 33 | do 34 | echo "" 35 | echo "------------------------------------" 36 | echo "" 37 | 38 | echo "cd $folder" 39 | echo 40 | echo "hg pull ; hg update" 41 | 42 | cd $folder 43 | 44 | hg pull ; hg update 45 | 46 | cd - 47 | done 48 | 49 | # Breezy {{{1 50 | 51 | for folder in */.brz(:h) */*/.bzr(:h) 52 | do 53 | echo "" 54 | echo "------------------------------------" 55 | echo "" 56 | 57 | echo "cd $folder" 58 | echo 59 | echo "bzr pull ; bzr update" 60 | 61 | cd $folder 62 | 63 | bzr pull ; bzr update 64 | 65 | cd - 66 | done 67 | 68 | # Concurrent Version System {{{1 69 | 70 | for folder in */CVS(:h) 71 | do 72 | echo "" 73 | echo "------------------------------------" 74 | echo "" 75 | 76 | echo "cd $folder" 77 | echo 78 | echo "cvs up" 79 | 80 | cd $folder 81 | 82 | cvs up 83 | 84 | cd - 85 | done 86 | 87 | # Fin {{{1 88 | 89 | echo "" 90 | echo "====================================" 91 | echo "" 92 | -------------------------------------------------------------------------------- /snippet/hist/irssi.irc: -------------------------------------------------------------------------------- 1 | # /server add -ssl -ssl_verify -ssl_capath /etc/ssl/certs -network liberachat -port 6697 irc.libera.chat 2 | /away singing in the rain 3 | /ban pseudo 4 | /bind end command /sb end 5 | /bind home command /sb home 6 | /channel add -auto #archlinux liberachat 7 | /close 8 | /connect liberachat 9 | /ignore * joins parts quits 10 | /invite pseudo 11 | /join #libera-cloak ; ! cloakme # libera 12 | /kick pseudo 13 | /list *ubuntu* 14 | /list >1000 15 | /me action 16 | /mode +a pseudo 17 | /mode +h pseudo 18 | /mode +o pseudo 19 | /mode +q pseudo 20 | /mode +v pseudo 21 | /mode -a pseudo 22 | /mode -h pseudo 23 | /mode -o pseudo 24 | /mode -q pseudo 25 | /mode -v pseudo 26 | /motd 27 | /msg alis list gen -min 100 -max 200 28 | /msg alis list gentoo 29 | /msg chanserv chan_nel pass_word 30 | /msg nickserv ghost pseudo 31 | /msg nickserv group 32 | /msg nickserv identity pseudo pass_word 33 | /msg nickserv register pass_word mail@example 34 | /msg nickserv reverify # oftc 35 | /msg nickserv set cloak on # oftc 36 | /msg pseudo message 37 | /names 38 | /network add -sasl_mechanism plain -sasl_username user_name -sasl_password pass_word liberachat 39 | /part 40 | /query pseudo message 41 | /quote help list 42 | /run scriptassist 43 | /save 44 | /say /commande truc 45 | /script autorun mouse.pl 46 | /script install mouse.pl 47 | /script load mouse.pl 48 | /script unload mouse.pl 49 | /server add -auto -tls -tls_verify -network liberachat -port 6697 irc.libera.chat 50 | /set autolog on 51 | /topic 52 | /wc 53 | /window goto #vim 54 | -------------------------------------------------------------------------------- /snippet/hist/Grenier: -------------------------------------------------------------------------------- 1 | 2 | doas svn co https://svn.FreeBSD.org/base/head /usr/src 3 | doas svn co https://svn.FreeBSD.org/doc/head /usr/doc 4 | git=set-default-remove ; git push -u codeberg --all 5 | zfs snapshot -r zroot/ROOT/vanilla@tarballs 6 | 7 | # @backup 01. ---- First time 8 | # @backup 02. sudo zfs snapshot -r zroot/ROOT/default@backup 9 | # @backup 03. sudo gpart modify -i 1 -t freebsd-zfs da0 # gpt partition table 10 | # @backup 04. sudo gpart modify -i 1 -t freebsd da0 # dos mbr partition table 11 | # @backup 05. sudo zpool create -o altroot=/mnt/diskextpool -O compression=zstd -O atime=off diskextpool da0s1 12 | # @backup 06. sudo zfs send -R zroot/ROOT/default@backup | sudo zfs receive -vF diskextpool 13 | # @backup 07. ---- Incremental 14 | # @backup 08. sudo zfs rename -r zroot/ROOT/default@backup{,-old} 15 | # @backup 09. sudo zfs snapshot -r zroot/ROOT/default@backup 16 | # @backup 10. sudo zpool import -R /mnt/diskextpool diskextpool 17 | # @backup 11. sudo zfs send -Ri zroot/ROOT/default@backup-old zroot/ROOT/default@backup | sudo zfs receive -vF diskextpool 18 | # @backup 12. sudo zfs destroy -r zroot/ROOT/default@backup-old 19 | # @backup 13. sudo zfs umount diskextpool 20 | # @backup 14. sudo zpool export diskextpool 21 | sudo sysrc ezjail_enable="YES" 22 | chflags -v noschg /usr/jails/yinyang.antra/var/empty 23 | sudo ezjail-admin create yinyang.antra 'lo1|127.0.1.1,fxp0|192.168.1.100' 24 | sudo ezjail-admin install 25 | sudo ezjail-admin start yinyang.antra 26 | sudo ezjail-admin stop yinyang.antra 27 | sudo service ezjail restart 28 | -------------------------------------------------------------------------------- /shell/edit/neovim-qt-lite.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # solution 1 : run nvim and nvim-qt at the same time {{{1 4 | 5 | # ---- only works when no other nvim is running 6 | # ---- how to tell nvim-qt to use another socket ? 7 | 8 | # NVIM_APPNAME=neovim-lite nvim-qt \ 9 | # -- \ 10 | # "$@" >> ~/log/neovim-qt-lite.log 2>&1 11 | 12 | # exit 0 13 | 14 | # solution 2 : run nvim before nvim-qt {{{1 15 | 16 | # ---- we need neovim-remote to add files on a running neovim 17 | which nvr || { 18 | echo Please install neovim-remote with pip first 19 | exit 0 20 | } 21 | 22 | # ---- log and err files 23 | logfile=~/log/neovim-qt-lite.log 24 | errfile=~/log/neovim-qt-lite.err 25 | # ---- save old channels 26 | exec 3>&1 27 | exec 4>&2 28 | # ---- ensure log and err files exist 29 | [ -e $logfile ] || touch $logfile 30 | [ -e $errfile ] || touch $errfile 31 | # ---- redirect to log and err files 32 | exec 1>> $logfile 33 | exec 2>> $errfile 34 | 35 | rundir=$XDG_RUNTIME_DIR 36 | 37 | if [ -d $rundir ] 38 | then 39 | socket=$rundir/neovim-qt-lite-socket 40 | else 41 | socket=~/racine/run/socket/neovim-qt-lite 42 | fi 43 | 44 | echo neovim lite socket : $socket 45 | echo 46 | 47 | if [ -S $socket -o -e $socket ] 48 | then 49 | # ---- neovim server lite already runs, 50 | # ---- let's add args files to it 51 | nvr --servername $socket --remote-tab "$@" 52 | else 53 | # ---- no nvim server lite, let's run it 54 | NVIM_APPNAME=neovim-lite nvim --listen $socket --headless "$@" & 55 | fi 56 | 57 | nvim-qt --server $socket 58 | 59 | # ---- restore old channels 60 | exec 1>&3 61 | exec 2>&4 62 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2023, chimay 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | --------------------------------------------------------------------------------