Skip to content

Instantly share code, notes, and snippets.

View Wabri's full-sized avatar
:octocat:
Loading...

GabrielePuliti Wabri

:octocat:
Loading...
View GitHub Profile
@Wabri
Wabri / extract.sh
Created July 14, 2020 07:24
Extract them all
#! /usr/bin/env bash
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.tar.xz) tar -xf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
@Wabri
Wabri / dtest.sh
Created July 14, 2020 07:23
Dunst configuration test
#! /usr/bin/env bash
pidof dunst && killall dunst
dunst &
notify-send --expire-time=80000 --urgency=critical critical
notify-send --expire-time=80000 --urgency=normal normal
notify-send --expire-time=80000 --urgency=low low
@Wabri
Wabri / compilepreview.sh
Created July 14, 2020 07:06
One compiler to rule them all
#! /usr/bin/env bash
file=$(readlink -f "$1")
dir=$(dirname "$file")
base="${file%.*}"
cd "$dir" || exit
case "$file" in
*\.tex) pandoc "$file" -f latex -s -o "$base".pdf ;;
@Wabri
Wabri / chkey.sh
Created July 14, 2020 07:04
Switch layout key from a keymap to another
#! /usr/bin/env bash
case "$(setxkbmap -v | awk -F '+' '/symbols/ {print $2}')" in
us)
setxkbmap it
;;
it)
setxkbmap us
;;
*)