diff options
Diffstat (limited to 'home-manager/i3/scripts')
| -rwxr-xr-x | home-manager/i3/scripts/exit.sh | 20 | ||||
| -rwxr-xr-x | home-manager/i3/scripts/image_upload.sh | 7 | ||||
| -rwxr-xr-x | home-manager/i3/scripts/monitor-config.sh | 23 | ||||
| -rwxr-xr-x | home-manager/i3/scripts/workspaces.sh | 7 | ||||
| -rw-r--r-- | home-manager/i3/scripts/workspaces.txt | 11 |
5 files changed, 68 insertions, 0 deletions
diff --git a/home-manager/i3/scripts/exit.sh b/home-manager/i3/scripts/exit.sh new file mode 100755 index 0000000..6e1f492 --- /dev/null +++ b/home-manager/i3/scripts/exit.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +choice=$(echo -e "Sleep\nLock\nLock and sleep\nExit i3" | rofi -dmenu -i -p "What do you want to do") +case $choice in + "Sleep") + systemctl suspend + ;; + "Lock") + i3lock -eti /usr/share/backgrounds/lockscreen.png + ;; + "Lock and sleep") + i3lock -eti /usr/share/backgrounds/lockscreen.png + systemctl suspend + ;; + "Exit i3") + i3-msg exit + ;; + *) + notify-send "Canceling" + ;; +esac diff --git a/home-manager/i3/scripts/image_upload.sh b/home-manager/i3/scripts/image_upload.sh new file mode 100755 index 0000000..896f23f --- /dev/null +++ b/home-manager/i3/scripts/image_upload.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +image_name=$(rofi -dmenu -l 0 -p "Image name") +xclip -selection clipboard -t image/png -o > ~/Documents/tehbox-files/$image_name +eval $(ssh-agent) +rsync ~/Documents/tehbox-files/$image_name files@tehbox.org:/srv/files +notify-send "uploaded https://files.tehbox.org/$image_name" +echo -n "https://files.tehbox.org/$image_name" | xclip -i -selection clipboard diff --git a/home-manager/i3/scripts/monitor-config.sh b/home-manager/i3/scripts/monitor-config.sh new file mode 100755 index 0000000..8f17660 --- /dev/null +++ b/home-manager/i3/scripts/monitor-config.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +choice=$(echo -e "One monitor\nTwo monitors" | rofi -dmenu -i -p "What monitor setup to use") + +monitor1=$(xrandr | grep -E "eDP(-1(-1)?)?" | awk '{print $1 }') +monitor2=$(xrandr | grep -E "HDMI(-A-0)?(-1(-1)?)?" | awk '{print $1 }') + +case $choice in + "One monitor") + xrandr --output $monitor1 --primary --mode 1920x1080 --rate 144 --pos 0x0 --rotate normal --output $monitor2 --off + sleep 1 + i3-msg restart + ;; + "Two monitors") + xrandr --output $monitor1 --primary --mode 1920x1080 --rate 144 --pos 0x0 --rotate normal --output $monitor2 --mode 1920x1080 --rate 144 --pos 1920x0 --rotate normal + sleep 1 + i3-msg restart + ;; + *) + notify-send "Invalid response, canceling" + ;; +esac + diff --git a/home-manager/i3/scripts/workspaces.sh b/home-manager/i3/scripts/workspaces.sh new file mode 100755 index 0000000..3ad68ef --- /dev/null +++ b/home-manager/i3/scripts/workspaces.sh @@ -0,0 +1,7 @@ +choice=$(cat ~/.i3_commands/workspaces.txt | rofi -dmenu -i -p "Which workspace to switch to") +if [[ $1 == "move" ]] +then + i3-msg move container to workspace \"$choice\" +else + i3-msg workspace \"$choice\" +fi diff --git a/home-manager/i3/scripts/workspaces.txt b/home-manager/i3/scripts/workspaces.txt new file mode 100644 index 0000000..84b3bf0 --- /dev/null +++ b/home-manager/i3/scripts/workspaces.txt @@ -0,0 +1,11 @@ +1: +2: +3: +4: +5: +6: +7: +8: +9: +10: +S: |
