small fix + screenshot

This commit is contained in:
_N3m0 2024-03-03 22:52:11 +01:00
parent a71c8844b4
commit b9fa2818e3
3 changed files with 23 additions and 4 deletions

7
bashrc
View File

@ -33,9 +33,11 @@ export DEV_OPT_PATH="$OPT_PATH/dev"
export SCRIPT_PATH="$DEV_PATH/script"
export PATH="$SCRIPT_PATH/:$PATH"
export PATH="$SCRIPT_PATH.download/:$PATH"
export PATH="$DEV_OPT_PATH/script.download/:$PATH"
export PATH="$DEV_OPT_PATH/built/:$PATH"
export PATH="$DEV_OPT_PATH/bin/:$PATH"
export PATH="/usr/sbin:$PATH"
export PATH="/opt/dmenu_path:$PATH"
export EDITOR="nvim"
export TERM="st"
@ -68,7 +70,7 @@ alias clr="clm"
alias clm="clear && mcphrase"
alias cll="clear && ls"
alias rm="trash"
alias shut="figlet 'finito' && sleep 0.5; shutdown 0"
#alias shut="figlet 'finito' && sleep 0.5; shutdown 0"
alias v="nvim"
alias g="git"
alias hm="gnome-terminal --full-screen -- bash -c \"exec bash; cd $DEV_PATH && cls\" && exit"
@ -144,6 +146,7 @@ alias qr-network="nmcli device wifi show-password"
emoji(){ grep -i $1 $OPT_PATH/emoji; }
dev(){ [ -z $1 ] && cd $DEV_PATH/ || cd $DEV_PATH/*$1* ;}
opt(){ [ -z $1 ] && cd $OPT_PATH/ || cd $OPT_PATH/*$1* ;}
work(){ [ -z $1 ] && cd ~/work/ || cd ~/work/*$1* ;}
cours(){ [ -z $1 ] && cd ~/cours/ || cd ~/cours/*$1* ;}
lsd(){ ls -d $1*/;}
lsf(){ ls -p $1 | grep -v /$;}

View File

@ -1,7 +1,8 @@
#!/bin/bash
mode=$(echo -e "same\ndifferent" | dmenu -p "monitors layout:")
monitors=$(xrandr --listmonitors | sort -r | cut -d' ' -f6)
#monitors=$(xrandr --listmonitors | sort -r | cut -d' ' -f6)
monitors=$(xrandr -q | grep "^[^ ]" | cut -d' ' -f1 | grep -v Screen)
main=$(echo $monitors | tr ' ' '\n' | dmenu -p "which monitor is main:")
monitors=$(echo $monitors | sed "s/$main//")
@ -12,7 +13,7 @@ if [[ $mode == "same" ]]; then
done
elif [[ $mode == "different" ]]; then
for m in $monitors; do
direction=$(echo -e "left\nright\nabove\nbelow\nsame" | dmenu -p "monitor '$m' direction from '$main'")
direction=$(echo -e "left\nright\nabove\nbelow\nsame\nnone" | dmenu -p "monitor '$m' direction from '$main'")
case $direction in
"left" | "right")
@ -24,6 +25,9 @@ elif [[ $mode == "different" ]]; then
"same")
direction="--$direction-as"
;;
"none")
continue
;;
esac
xrandr --output $main --primary --mode 1920x1080 --output $m --mode 1920x1080 $direction $main

12
screenshot Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
set -xe
path=$OPT_PATH/img/screenshot/
file=screenshot$(date "+%F_%T")
ffmpeg -f x11grab -framerate 1 -video_size 1920x1080 -i :0.0 -vframes 1 $path$file.png
newfile=$(echo $file | dmenu -p "rename $file :")
mv $path$file.png $path$newfile.png