From b9fa2818e300e216dd66214e9d114db5c8ba9fe9 Mon Sep 17 00:00:00 2001 From: _N3m0 Date: Sun, 3 Mar 2024 22:52:11 +0100 Subject: [PATCH] small fix + screenshot --- bashrc | 7 +++++-- monitor-display | 8 ++++++-- screenshot | 12 ++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100755 screenshot diff --git a/bashrc b/bashrc index f58ea4a..27131ae 100755 --- a/bashrc +++ b/bashrc @@ -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 /$;} diff --git a/monitor-display b/monitor-display index 7a74a7b..cd74f9a 100755 --- a/monitor-display +++ b/monitor-display @@ -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 diff --git a/screenshot b/screenshot new file mode 100755 index 0000000..df57bc6 --- /dev/null +++ b/screenshot @@ -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