aboutsummaryrefslogtreecommitdiff
path: root/laptop/.config/hypr/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'laptop/.config/hypr/scripts')
-rwxr-xr-xlaptop/.config/hypr/scripts/battery-notifier.sh36
-rwxr-xr-xlaptop/.config/hypr/scripts/capture-window.sh10
-rwxr-xr-xlaptop/.config/hypr/scripts/current-brightness.sh4
-rwxr-xr-xlaptop/.config/hypr/scripts/equalize-windows.sh87
-rwxr-xr-xlaptop/.config/hypr/scripts/randomize-wallpaper.sh11
-rwxr-xr-xlaptop/.config/hypr/scripts/zoom.sh9
6 files changed, 0 insertions, 157 deletions
diff --git a/laptop/.config/hypr/scripts/battery-notifier.sh b/laptop/.config/hypr/scripts/battery-notifier.sh
deleted file mode 100755
index d586879..0000000
--- a/laptop/.config/hypr/scripts/battery-notifier.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-
-while true; do
- # get battery status
- acpi_info=$(acpi)
- stat=$(echo $acpi_info | awk -F" " '{print $3}')
- stat=${stat::-1}
- perc=$(echo $acpi_info | awk -F" " '{print $4}')
- perc=${perc::-2}
-
- # check if battery is discharging
- if [[ $stat == Discharging ]]; then
- # send notification if low power
- if [[ $perc -le 15 ]]; then
- notify-send -a Battery BATTERY\ CRITICAL\ -h int:value:$perc -u critical
- elif [[ $perc -le 30 ]]; then
- notify-send -a Battery Battery\ low\ -h int:value:$perc
- fi
- fi
-
- # calculate time until next check using interpolating polynomial
- # of points (battery %, time [s] until next check):
- # (100, 600)
- # (50, 120)
- # (30, 60)
- # (15, 30)
- # (0, 0)
- x1=$(echo "scale=10; 188/85*$perc" | bc)
- x2=$(echo "scale=10; -603/29750*$perc*$perc" | bc)
- x3=$(echo "scale=10; 113/297500*$perc*$perc*$perc" | bc)
- x4=$(echo "scale=10; 3/1487500*$perc*$perc*$perc*$perc" | bc)
- sleep_time=$(echo $x1+$x2+$x3+$x4 | bc | awk -F"." '{print $1}')
-
- # sleep for calculated time
- sleep $sleep_time
-done
diff --git a/laptop/.config/hypr/scripts/capture-window.sh b/laptop/.config/hypr/scripts/capture-window.sh
deleted file mode 100755
index 2299cb0..0000000
--- a/laptop/.config/hypr/scripts/capture-window.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-# get size and offset of active window
-size=$(hyprctl activewindow | grep size: | awk -F" " '{print $2}')
-size=${size/,/x}
-offset=$(hyprctl activewindow | grep at: | awk -F" " '{print $2}')
-offset=${offset/,/+}
-
-# open gui with selected region
-flameshot gui --region $size+$offset
diff --git a/laptop/.config/hypr/scripts/current-brightness.sh b/laptop/.config/hypr/scripts/current-brightness.sh
deleted file mode 100755
index 4856e59..0000000
--- a/laptop/.config/hypr/scripts/current-brightness.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-s=$(brightnessctl | grep % | awk -F" " '{print $4}')
-echo ${s:1:-2}
diff --git a/laptop/.config/hypr/scripts/equalize-windows.sh b/laptop/.config/hypr/scripts/equalize-windows.sh
deleted file mode 100755
index cd43729..0000000
--- a/laptop/.config/hypr/scripts/equalize-windows.sh
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/bash
-
-ITERS=3
-
-# get address of the window to return to
-address=$(hyprctl activewindow | awk -F" " 'NR==1 {print $2}')
-
-# define move directions
-dir1=$1
-dir2=r
-if [[ $dir1 == u ]]; then
- dir2=d
-fi
-
-# move max to the left/top
-prev_window=""
-window=$(hyprctl activewindow | awk -F" " 'NR==1 {print $2}')
-while [[ $window != $prev_window ]]; do
- hyprctl dispatch movefocus $dir1
- prev_window=$window
- window=$(hyprctl activewindow | awk -F" " 'NR==1 {print $2}')
-done
-
-# get start location
-at=$(hyprctl activewindow | awk -F" " 'NR==4 {print $2}')
-if [[ $dir1 == l ]]; then
- start_location=$(echo $at | awk -F"," '{print $1}')
-else
- start_location=$(echo $at | awk -F"," '{print $2}')
-fi
-
-# count windows in the line
-window_count=0
-prev_window=""
-while [[ $window != $prev_window ]]; do
- hyprctl dispatch movefocus $dir2
- prev_window=$window
- window=$(hyprctl activewindow | awk -F" " 'NR==1 {print $2}')
- window_count=$(($window_count+1))
-done
-
-# get end location
-at=$(hyprctl activewindow | awk -F" " 'NR==4 {print $2}')
-size=$(hyprctl activewindow | awk -F" " 'NR==5 {print $2}')
-if [[ $dir1 == l ]]; then
- at=$(echo $at | awk -F"," '{print $1}')
- size=$(echo $size | awk -F"," '{print $1}')
-else
- at=$(echo $at | awk -F"," '{print $2}')
- size=$(echo $size | awk -F"," '{print $2}')
-fi
-end_location=$(($at+$size))
-
-# calculate full size and size per window
-full_size=$(($end_location - $start_location))
-size_per_window=$(($full_size / $window_count))
-
-# set sizes
-i=0
-while [[ $i -lt $ITERS ]]; do
- i=$(($i+1))
- window=0
- while [[ $window -lt $window_count ]]; do
- window=$(($window+1))
- size=$(hyprctl activewindow | awk -F" " 'NR==5 {print $2}')
- if [[ $dir1 == l ]]; then
- #other_side=$(echo $size | awk -F"," '{print $2}')
- #hyprctl dispatch resizeactive exact $size_per_window $other_side
- size=$(echo $size | awk -F"," '{print $1}')
- diff=$(($size_per_window - $size))
- hyprctl dispatch resizeactive $diff 0
- else
- #other_side=$(echo $size | awk -F"," '{print $1}')
- #hyprctl dispatch resizeactive exact $other_side $size_per_window
- size=$(echo $size | awk -F"," '{print $2}')
- diff=$(($size_per_window - $size))
- hyprctl dispatch resizeactive 0 $diff
- fi
- hyprctl dispatch movefocus $dir1
- done
- temp=$dir1
- dir1=$dir2
- dir2=$temp
-done
-
-# return to starting window
-hyprctl dispatch focuswindow address:0x$address
diff --git a/laptop/.config/hypr/scripts/randomize-wallpaper.sh b/laptop/.config/hypr/scripts/randomize-wallpaper.sh
deleted file mode 100755
index 116763b..0000000
--- a/laptop/.config/hypr/scripts/randomize-wallpaper.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/bash
-
-WALLPAPER_DIR="$HOME/wallpapers"
-
-# Get a random wallpaper
-WALLPAPER=$(find $WALLPAPER_DIR -type f | shuf -n 1)
-
-# Create a symlink to the new random wallpaper
-SYMLINK=$WALLPAPER_DIR/.current
-rm $SYMLINK
-ln -s $WALLPAPER $SYMLINK
diff --git a/laptop/.config/hypr/scripts/zoom.sh b/laptop/.config/hypr/scripts/zoom.sh
deleted file mode 100755
index 433f899..0000000
--- a/laptop/.config/hypr/scripts/zoom.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-ZOOM=$(hyprctl getoption cursor:zoom_factor | grep float | awk -F" " '{print $2}')
-ZOOM=$(echo "scale=0; ($ZOOM+1)/1" | bc)
-if [[ $ZOOM -gt $MAX_ZOOM ]]; then
- ZOOM=1
-fi
-
-hyprctl -q keyword cursor:zoom_factor $ZOOM