Compare commits
5 Commits
2858a37fd5
...
linux
| Author | SHA1 | Date | |
|---|---|---|---|
| 3c60117501 | |||
|
|
e9519cd5b4 | ||
|
|
09d839d92a | ||
|
|
35f09d5871 | ||
|
|
2d56e0cbc8 |
36
README.md
36
README.md
@@ -0,0 +1,36 @@
|
||||
# Script collection
|
||||
|
||||
This is a collection of scripts I use on different systems
|
||||
|
||||
## Unix
|
||||
|
||||
#### run
|
||||
|
||||
Simple script to run programs detached from terminal.
|
||||
No nohup.out, no stdout or stderr, don't close program when terminating the terminal.
|
||||
|
||||
|
||||
#### rgit
|
||||
|
||||
Utility to remotely work on git repos through ssh.
|
||||
Create, list or delete bare repos on git server. Edit your config and description locally in your $EDITOR.
|
||||
|
||||
***TODO***
|
||||
- Create, list, delete, edit hooks
|
||||
|
||||
|
||||
|
||||
## MacOS
|
||||
|
||||
#### mcal
|
||||
|
||||
Show a calendar in your terminal the way gcal **should**.
|
||||
From [this](https://apple.stackexchange.com/questions/93906/cal-command-start-monday) stackexchange post.
|
||||
|
||||
This does not work perfectly but **WHOSE** idea was it to display a calendar vertically?!
|
||||
|
||||
|
||||
#### displayer
|
||||
|
||||
Reorganize your displays with displayplacer. Documentation on how to properly set this up is [here](https://github.com/jakehilborn/displayplacer).
|
||||
And again, I just have to ask: **WTF APPLE ?!** How hard is it to not fuck my displays up after every boot?
|
||||
|
||||
37
animatedWallpaper
Executable file
37
animatedWallpaper
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
PIDFILE="/var/run/user/$UID/bg.pid"
|
||||
|
||||
# Declare PIDs array
|
||||
declare -a PIDs
|
||||
|
||||
_screen() {
|
||||
# g specify geometry heightxwidth+xcoord+ycoord
|
||||
# ni Ignore Input
|
||||
# ov For Desktop background
|
||||
# fs fullscreen
|
||||
# vo=gpu gpu accelerated video output
|
||||
# hwdec=vdpau use vdpau for gpu acceleration
|
||||
xwinwrap -ov -ni -g "$1" -- mpv -fs\
|
||||
--no-stop-screensaver\
|
||||
--vo=gpu --hwdec=vaapi\
|
||||
--loop-file --no-audio --no-osc --no-osd-bar\
|
||||
-wid WID --no-input-default-bindings\
|
||||
"$2" &
|
||||
# Needs more testing not in fullscreen mode
|
||||
#xwinwrap -ov -ni -g "$1" -- sxiv "$2" -f -b -a -e WID &
|
||||
PIDs+=($!)
|
||||
}
|
||||
|
||||
while read p; do
|
||||
[[ $(ps -p "$p" -o comm=) == "xwinwrap" ]] && kill -9 "$p";
|
||||
done < $PIDFILE
|
||||
|
||||
sleep 0.5
|
||||
|
||||
for i in $(xrandr -q | grep ' connected' | grep -oP '\d+x\d+\+\d+\+\d+')
|
||||
do
|
||||
_screen "$i" "$1"
|
||||
done
|
||||
|
||||
printf "%s\n" "${PIDs[@]}" > $PIDFILE
|
||||
60
autoscript
Executable file
60
autoscript
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
oldIFS=$IFS
|
||||
|
||||
help() {
|
||||
echo "Usage: ${0##*/} [-l lang][-h] FILENAME"
|
||||
echo "Supported languages: python, crystal, bash (default)"
|
||||
}
|
||||
|
||||
if [ $# -eq 0 ];then
|
||||
help
|
||||
exit 0
|
||||
fi
|
||||
|
||||
read -d '' bashShebang << 'EOF' || true
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
IFS=$'\\n\\t'
|
||||
EOF
|
||||
|
||||
read -d '' pythonShebang << EOF || true
|
||||
#!/usr/bin/env python
|
||||
EOF
|
||||
|
||||
read -d '' crystalShebang << EOF || true
|
||||
#!/usr/bin/env crystal
|
||||
EOF
|
||||
|
||||
shebang=$bashShebang
|
||||
|
||||
while getopts ":hl:" opt;do
|
||||
if [ $opt == "h" ];then
|
||||
help
|
||||
exit 0
|
||||
else
|
||||
case $OPTARG in
|
||||
py | python)shebang=$pythonShebang ;;
|
||||
cr | crystal)shebang=$crystalShebang ;;
|
||||
sh | bash | shell | *)shebang=$bashShebang ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
SCRIPT_FOLDER=$HOME/.local/bin
|
||||
SCRIPT_FILE=$SCRIPT_FOLDER/$1
|
||||
|
||||
if [[ -f $SCRIPT_FILE ]]; then
|
||||
$EDITOR $SCRIPT_FILE
|
||||
else
|
||||
touch $SCRIPT_FILE
|
||||
chmod +x $SCRIPT_FILE
|
||||
echo "$shebang" >> $SCRIPT_FILE
|
||||
$EDITOR $SCRIPT_FILE
|
||||
fi
|
||||
|
||||
exit 0
|
||||
9
click_test.sh
Executable file
9
click_test.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
xdotool search --class "Minecraft\*\ 1\.16\.4" mousemove --window %1 950 350 click 1;
|
||||
while true; do
|
||||
sleep 1;
|
||||
xdotool search --class "Minecraft\*\ 1\.16\.4" click 1;
|
||||
echo "click";
|
||||
done
|
||||
|
||||
20
dmenu_quit
Executable file
20
dmenu_quit
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
test=$(echo -e "Shutdown\nLogout\nSuspend\nReboot\nCancel" | dmenu -i -p "$1" -h 25)
|
||||
|
||||
case "$test" in
|
||||
Shutdown)
|
||||
poweroff
|
||||
;;
|
||||
Logout)
|
||||
#herbstclient quit
|
||||
killall xinit
|
||||
;;
|
||||
Suspend)
|
||||
systemctl suspend
|
||||
;;
|
||||
Reboot)
|
||||
reboot
|
||||
;;
|
||||
esac
|
||||
|
||||
12
glances
Executable file
12
glances
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/python
|
||||
# EASY-INSTALL-ENTRY-SCRIPT: 'Glances==3.1.4.1','console_scripts','glances'
|
||||
__requires__ = 'Glances==3.1.4.1'
|
||||
import re
|
||||
import sys
|
||||
from pkg_resources import load_entry_point
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(
|
||||
load_entry_point('Glances==3.1.4.1', 'console_scripts', 'glances')()
|
||||
)
|
||||
43
initializeANSI
Executable file
43
initializeANSI
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# ANSI color--Use these variables to make output in different colors
|
||||
# and formats. Color names that end with 'f' are foreground colors,
|
||||
# and those ending with 'b' are background colors.
|
||||
|
||||
initializeANSI()
|
||||
{
|
||||
#esc="\033" # If this doesn't work, enter an ESC directly. In insert mode press <C-v> and Esc (^[)
|
||||
esc=""
|
||||
|
||||
# Foreground colors (as denoted by the 'f' at the end of the names)
|
||||
blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m"
|
||||
yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m"
|
||||
cyanf="${esc}[36m"; whitef="${esc}[37m"
|
||||
|
||||
# Background colors
|
||||
blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m"
|
||||
yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m"
|
||||
cyanb="${esc}[46m"; whiteb="${esc}[47m"
|
||||
|
||||
# Bold, italic, underline, and inverse style toggles
|
||||
boldon="${esc}[1m"; boldoff="${esc}[22m"
|
||||
italicson="${esc}[3m"; italicsoff="${esc}[23m"
|
||||
ulon="${esc}[4m"; uloff="${esc}[24m"
|
||||
invon="${esc}[7m"; invoff="${esc}[27m"
|
||||
|
||||
reset="${esc}[0m"
|
||||
}
|
||||
|
||||
initializeANSI
|
||||
|
||||
cat << EOF
|
||||
${yellowf}This is a phrase in yellow${redb} and red${reset}
|
||||
${boldon}This is bold${ulon} this is underlined${reset} bye-bye
|
||||
${italicson}This is italics${italicsoff} and this is not
|
||||
${ulon}This is ul${uloff} and this is not
|
||||
${invon}This is inv${invoff} and this is not
|
||||
${yellowf}${redb}Warning I ${yellowb}${redf}Warning II${reset}
|
||||
EOF
|
||||
9
launch_multimc_instance
Executable file
9
launch_multimc_instance
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
instance=$(ls -I _MMC_TEMP -I instgroups.json ~/.local/share/multimc/instances | dmenu -i -p "Choose minecraft instance: " -h 25)
|
||||
|
||||
multimc --launch "$instance"
|
||||
|
||||
5
udmenu
Executable file
5
udmenu
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
grep -v "#" ~/.local/bin/unicode | dmenu -i -h 25 -l 20 -fn "JoyPixels:pixelsize=10" | awk '{print $1}' | tr -d '\n' | xclip -selection clipboard
|
||||
|
||||
pgrep -x dunst > /dev/null && notify-send "$(xclip -o -selection clipboard) copied to clipboard"
|
||||
Reference in New Issue
Block a user