inital commit
This commit is contained in:
22
.local/bin/i3cmds/hover
Executable file
22
.local/bin/i3cmds/hover
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -z "$1" ] && exit # If $1 is left, hovers in the bottom left, if right, the bottom right
|
||||
current=$(xdotool getwindowfocus)
|
||||
newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3))
|
||||
newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3))
|
||||
centerwidth=$(( $(xdotool getdisplaygeometry | awk '{print $1}') / 2))
|
||||
newsize=$(xdotool getwindowgeometry "$current" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}')
|
||||
newwidth=$(xdotool getwindowgeometry "$current" | grep Geometry | grep -o " [0-9]*")
|
||||
baroffset=47
|
||||
|
||||
case "$1" in
|
||||
left) horizontal=0; vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) ;;
|
||||
right) horizontal=$(($(xdotool getdisplaygeometry | awk '{print $1}') - newwidth)) ; vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) ;;
|
||||
center) echo "$centerwidth"
|
||||
horizontal=$(( ( $(xdotool getdisplaygeometry | awk '{print $1}') - centerwidth ) / 2 ));
|
||||
vertical=$baroffset
|
||||
newheight=$(( $(xdotool getdisplaygeometry | awk '{print $2}' ) - baroffset -5))
|
||||
newwidth=$centerwidth;;
|
||||
esac
|
||||
xdotool windowsize "$current" $newwidth $newheight
|
||||
xdotool windowmove "$current" $horizontal $vertical
|
28
.local/bin/i3cmds/i3resize
Executable file
28
.local/bin/i3cmds/i3resize
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script was made by `goferito` on Github.
|
||||
# Some cleanup by Luke.
|
||||
|
||||
[ -z "$1" ] && echo "No direction provided" && exit 1
|
||||
distanceStr="2 px or 2 ppt"
|
||||
|
||||
moveChoice() {
|
||||
i3-msg resize "$1" "$2" "$distanceStr" | grep '"success":true' || \
|
||||
i3-msg resize "$3" "$4" "$distanceStr"
|
||||
}
|
||||
|
||||
case $1 in
|
||||
up)
|
||||
moveChoice grow up shrink down
|
||||
;;
|
||||
down)
|
||||
moveChoice shrink up grow down
|
||||
;;
|
||||
left)
|
||||
moveChoice shrink right grow left
|
||||
;;
|
||||
right)
|
||||
moveChoice grow right shrink left
|
||||
;;
|
||||
esac
|
||||
|
7
.local/bin/i3cmds/killrecording
Executable file
7
.local/bin/i3cmds/killrecording
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
kill -9 "$(cat ~/.recordingpid)"
|
||||
|
||||
# Update i3bar.
|
||||
echo "" > ~/.recordingicon
|
||||
pkill -RTMIN+9 i3blocks
|
9
.local/bin/i3cmds/maimpick
Executable file
9
.local/bin/i3cmds/maimpick
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in
|
||||
"a selected area") maim -s pic-selected-"$(date '+%y%m%d-%H%M-%S').png" ;;
|
||||
"current window") maim -i "$(xdotool getactivewindow)" pic-window-"$(date '+%y%m%d-%H%M-%S').png" ;;
|
||||
"full screen") maim pic-full-"$(date '+%y%m%d-%H%M-%S').png" ;;
|
||||
"a selected area (copy)") maim -s | xclip -selection clipboard -t image/png ;;
|
||||
"current window (copy)") maim -i "$(xdotool getactivewindow)" | xclip -selection clipboard -t image/png ;;
|
||||
"full screen (copy)") maim | xclip -selection clipboard -t image/png ;;
|
||||
esac
|
7
.local/bin/i3cmds/prompt
Executable file
7
.local/bin/i3cmds/prompt
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# A dmenu binary prompt script.
|
||||
# Gives a dmenu prompt labeled with $1 to perform command $2.
|
||||
# For example:
|
||||
# `./prompt "Do you want to shutdown?" "shutdown -h now"`
|
||||
|
||||
[ "$(printf "No\\nYes" | dmenu -i -n -p "$1" -nb darkred -sb red -sf white -nf gray )" = "Yes" ] && $2
|
5
.local/bin/i3cmds/samedir
Executable file
5
.local/bin/i3cmds/samedir
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
PID=$(xprop -id "$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" | grep -m 1 PID | cut -d " " -f 3)
|
||||
PID=$(echo "$(pstree -lpA "$PID" | tail -n 1)" | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g')
|
||||
cd "$(readlink /proc/"$PID"/cwd)"
|
||||
"$TERMINAL"
|
10
.local/bin/i3cmds/td-toggle
Executable file
10
.local/bin/i3cmds/td-toggle
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
# If transmission-daemon is running, will ask to kill, else will ask to start.
|
||||
if pgrep -x transmission-da >/dev/null ;
|
||||
then
|
||||
[ "$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?")" = "Yes" ] && killall transmission-da && notify-send "transmission-daemon killed."
|
||||
else
|
||||
ifinstalled transmission-cli || exit
|
||||
[ "$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "tranmission-daemon started."
|
||||
fi
|
||||
sleep 3 && pkill -RTMIN+7 i3blocks
|
5
.local/bin/i3cmds/tmuxdd
Executable file
5
.local/bin/i3cmds/tmuxdd
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This is the script that i3 runs to either start tmux in
|
||||
# the dropdown terminal or log into a previous session.
|
||||
tmux a || tmux
|
10
.local/bin/i3cmds/toggle-welcome
Executable file
10
.local/bin/i3cmds/toggle-welcome
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Toggles the LARBS welcome message.
|
||||
|
||||
PIC="${XDG_DATA_HOME:-$HOME/.local/share}/larbs/larbs.png"
|
||||
|
||||
grep LARBSWELCOME "$HOME/.xprofile" &&
|
||||
( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send -i "$PIC" "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) ||
|
||||
( echo "notify-send -i \"$PIC\" \"Welcome to LARBS\" \"Press super+F1 for the help menu.\" # LARBSWELCOME" >> ~/.xprofile &&
|
||||
notify-send -i "$PIC" "LARBS welcome message" "Welcome message re-enabled." )
|
4
.local/bin/i3cmds/toggletouchpad
Executable file
4
.local/bin/i3cmds/toggletouchpad
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
# Toggle touchpad. Requires xf86-input-synaptics.
|
||||
(synclient | grep "TouchpadOff.*1" && synclient TouchpadOff=0)>/dev/null && echo "TouchPad reactivated." && exit
|
||||
synclient TouchpadOff=1 && echo "TouchPad deactivated."
|
6
.local/bin/i3cmds/torwrap
Executable file
6
.local/bin/i3cmds/torwrap
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
ifinstalled transmission-remote-cli transmission-cli || exit
|
||||
|
||||
! pgrep -x transmission-da >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..." && sleep 3 && pkill -RTMIN+7 i3blocks
|
||||
|
||||
$TERMINAL -e transmission-remote-cli
|
2
.local/bin/i3cmds/winresize
Executable file
2
.local/bin/i3cmds/winresize
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
echo "📐" | dmenu -p "Give width and height:" | xargs xdotool windowsize "$(xdotool getwindowfocus)"
|
Reference in New Issue
Block a user