forked from Shinonome/dots-hyprland
some package cleanup; gojq -> jq (#630)
This commit is contained in:
@@ -6,9 +6,9 @@ CONFIG_DIR="$XDG_CONFIG_HOME/ags"
|
|||||||
switch() {
|
switch() {
|
||||||
imgpath=$1
|
imgpath=$1
|
||||||
read scale screenx screeny screensizey < <(hyprctl monitors -j | jq '.[] | select(.focused) | .scale, .x, .y, .height' | xargs)
|
read scale screenx screeny screensizey < <(hyprctl monitors -j | jq '.[] | select(.focused) | .scale, .x, .y, .height' | xargs)
|
||||||
cursorposx=$(hyprctl cursorpos -j | gojq '.x' 2>/dev/null) || cursorposx=960
|
cursorposx=$(hyprctl cursorpos -j | jq '.x' 2>/dev/null) || cursorposx=960
|
||||||
cursorposx=$(bc <<< "scale=0; ($cursorposx - $screenx) * $scale / 1")
|
cursorposx=$(bc <<< "scale=0; ($cursorposx - $screenx) * $scale / 1")
|
||||||
cursorposy=$(hyprctl cursorpos -j | gojq '.y' 2>/dev/null) || cursorposy=540
|
cursorposy=$(hyprctl cursorpos -j | jq '.y' 2>/dev/null) || cursorposy=540
|
||||||
cursorposy=$(bc <<< "scale=0; ($cursorposy - $screeny) * $scale / 1")
|
cursorposy=$(bc <<< "scale=0; ($cursorposy - $screeny) * $scale / 1")
|
||||||
cursorposy_inverted=$((screensizey - cursorposy))
|
cursorposy_inverted=$((screensizey - cursorposy))
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
## This tool is based on grimshot, with swaymsg commands replaced by their
|
## This tool is based on grimshot, with swaymsg commands replaced by their
|
||||||
## hyprctl equivalents.
|
## hyprctl equivalents.
|
||||||
## https://github.com/swaywm/sway/blob/master/contrib/grimshot
|
## https://github.com/swaywm/sway/blob/master/contrib/grimshot
|
||||||
jq=gojq
|
|
||||||
getTargetDirectory() {
|
getTargetDirectory() {
|
||||||
test -f "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" &&
|
test -f "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" &&
|
||||||
. "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs"
|
. "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs"
|
||||||
@@ -191,14 +190,14 @@ if [ "$ACTION" = "check" ]; then
|
|||||||
check hyprctl
|
check hyprctl
|
||||||
check hyprpicker
|
check hyprpicker
|
||||||
check wl-copy
|
check wl-copy
|
||||||
check $jq
|
check jq
|
||||||
check notify-send
|
check notify-send
|
||||||
exit
|
exit
|
||||||
elif [ "$SUBJECT" = "active" ]; then
|
elif [ "$SUBJECT" = "active" ]; then
|
||||||
wait
|
wait
|
||||||
FOCUSED=$(hyprctl activewindow -j)
|
FOCUSED=$(hyprctl activewindow -j)
|
||||||
GEOM=$(echo "$FOCUSED" | $jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')
|
GEOM=$(echo "$FOCUSED" | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')
|
||||||
APP_ID=$(echo "$FOCUSED" | $jq -r '.class')
|
APP_ID=$(echo "$FOCUSED" | jq -r '.class')
|
||||||
WHAT="$APP_ID window"
|
WHAT="$APP_ID window"
|
||||||
elif [ "$SUBJECT" = "screen" ]; then
|
elif [ "$SUBJECT" = "screen" ]; then
|
||||||
wait
|
wait
|
||||||
@@ -207,7 +206,7 @@ elif [ "$SUBJECT" = "screen" ]; then
|
|||||||
elif [ "$SUBJECT" = "output" ]; then
|
elif [ "$SUBJECT" = "output" ]; then
|
||||||
wait
|
wait
|
||||||
GEOM=""
|
GEOM=""
|
||||||
OUTPUT=$(hyprctl monitors -j | $jq -r '.[] | select(.focused == true)' | $jq -r '.name')
|
OUTPUT=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true)' | jq -r '.name')
|
||||||
WHAT="$OUTPUT"
|
WHAT="$OUTPUT"
|
||||||
elif [ "$SUBJECT" = "area" ]; then
|
elif [ "$SUBJECT" = "area" ]; then
|
||||||
if [ "$FREEZE" = "yes" ] && [ "$(command -v "hyprpicker")" ] >/dev/null 2>&1; then
|
if [ "$FREEZE" = "yes" ] && [ "$(command -v "hyprpicker")" ] >/dev/null 2>&1; then
|
||||||
@@ -218,15 +217,15 @@ elif [ "$SUBJECT" = "area" ]; then
|
|||||||
|
|
||||||
# get fade & fadeOut animation and unset it
|
# get fade & fadeOut animation and unset it
|
||||||
# this removes the black border seen around screenshots
|
# this removes the black border seen around screenshots
|
||||||
FADE="$(hyprctl -j animations | $jq -jr '.[0][] | select(.name == "fade") | .name, ",", (if .enabled == true then "1" else "0" end), ",", (.speed|floor), ",", .bezier')"
|
FADE="$(hyprctl -j animations | jq -jr '.[0][] | select(.name == "fade") | .name, ",", (if .enabled == true then "1" else "0" end), ",", (.speed|floor), ",", .bezier')"
|
||||||
FADEOUT="$(hyprctl -j animations | $jq -jr '.[0][] | select(.name == "fadeOut") | .name, ",", (if .enabled == true then "1" else "0" end), ",", (.speed|floor), ",", .bezier')"
|
FADEOUT="$(hyprctl -j animations | jq -jr '.[0][] | select(.name == "fadeOut") | .name, ",", (if .enabled == true then "1" else "0" end), ",", (.speed|floor), ",", .bezier')"
|
||||||
hyprctl keyword animation 'fade,0,1,default' >/dev/null
|
hyprctl keyword animation 'fade,0,1,default' >/dev/null
|
||||||
hyprctl keyword animation 'fadeOut,0,1,default' >/dev/null
|
hyprctl keyword animation 'fadeOut,0,1,default' >/dev/null
|
||||||
|
|
||||||
WORKSPACES="$(hyprctl monitors -j | $jq -r 'map(.activeWorkspace.id)')"
|
WORKSPACES="$(hyprctl monitors -j | jq -r 'map(.activeWorkspace.id)')"
|
||||||
WINDOWS="$(hyprctl clients -j | $jq -r --argjson workspaces "$WORKSPACES" 'map(select([.workspace.id] | inside($workspaces)))')"
|
WINDOWS="$(hyprctl clients -j | jq -r --argjson workspaces "$WORKSPACES" 'map(select([.workspace.id] | inside($workspaces)))')"
|
||||||
# shellcheck disable=2086 # if we don't split, spaces mess up slurp
|
# shellcheck disable=2086 # if we don't split, spaces mess up slurp
|
||||||
GEOM=$(echo "$WINDOWS" | $jq -r '.[] | "\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | slurp $SLURP_ARGS)
|
GEOM=$(echo "$WINDOWS" | jq -r '.[] | "\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | slurp $SLURP_ARGS)
|
||||||
|
|
||||||
# Check if user exited slurp without selecting the area
|
# Check if user exited slurp without selecting the area
|
||||||
if [ -z "$GEOM" ]; then
|
if [ -z "$GEOM" ]; then
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
hyprctl dispatch "$1" $(((($(hyprctl activeworkspace -j | gojq -r .id) - 1) / 10) * 10 + $2))
|
hyprctl dispatch "$1" $(((($(hyprctl activeworkspace -j | jq -r .id) - 1) / 10) * 10 + $2))
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ getaudiooutput() {
|
|||||||
pactl list sources | grep 'Name' | grep 'monitor' | cut -d ' ' -f2
|
pactl list sources | grep 'Name' | grep 'monitor' | cut -d ' ' -f2
|
||||||
}
|
}
|
||||||
getactivemonitor() {
|
getactivemonitor() {
|
||||||
hyprctl monitors -j | gojq -r '.[] | select(.focused == true) | .name'
|
hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name'
|
||||||
}
|
}
|
||||||
|
|
||||||
mkdir -p "$(xdg-user-dir VIDEOS)"
|
mkdir -p "$(xdg-user-dir VIDEOS)"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
# Get the current workspace number
|
# Get the current workspace number
|
||||||
current=$(swaymsg -t get_workspaces | gojq '.[] | select(.focused==true) | .num')
|
current=$(swaymsg -t get_workspaces | jq '.[] | select(.focused==true) | .num')
|
||||||
|
|
||||||
# Check if a number was passed as an argument
|
# Check if a number was passed as an argument
|
||||||
if [[ "$1" =~ ^[+-]?[0-9]+$ ]]; then
|
if [[ "$1" =~ ^[+-]?[0-9]+$ ]]; then
|
||||||
@@ -25,6 +25,6 @@ fi
|
|||||||
# Switch to the new workspace
|
# Switch to the new workspace
|
||||||
if [[ $2 == 'move' ]]; then
|
if [[ $2 == 'move' ]]; then
|
||||||
swaymsg move container to workspace $new_workspace
|
swaymsg move container to workspace $new_workspace
|
||||||
else
|
else
|
||||||
swaymsg workspace $new_workspace
|
swaymsg workspace $new_workspace
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
/*/*.tar.*
|
||||||
|
/*/pkg/
|
||||||
|
/*/src/
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
/ags/
|
||||||
|
/libgnome-volume-control/
|
||||||
@@ -15,7 +15,6 @@ depends=(
|
|||||||
rsync
|
rsync
|
||||||
wget
|
wget
|
||||||
ripgrep
|
ripgrep
|
||||||
gojq
|
|
||||||
jq
|
jq
|
||||||
npm
|
npm
|
||||||
meson
|
meson
|
||||||
@@ -23,4 +22,3 @@ depends=(
|
|||||||
gjs
|
gjs
|
||||||
xdg-user-dirs
|
xdg-user-dirs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
/MicroTeX/
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/OneUI4-Icons/
|
||||||
+6
-2
@@ -69,7 +69,7 @@ if (( ${#pkglist[@]} != 0 )); then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Convert old dependencies to non explicit dependencies so that they can be orphaned if not in meta packages
|
# Convert old dependencies to non explicit dependencies so that they can be orphaned if not in meta packages
|
||||||
set-explicit-to-implicit() {
|
set-explicit-to-implicit() {
|
||||||
remove_bashcomments_emptylines ./scriptdata/previous_dependencies.conf ./cache/old_deps_stripped.conf
|
remove_bashcomments_emptylines ./scriptdata/previous_dependencies.conf ./cache/old_deps_stripped.conf
|
||||||
readarray -t old_deps_list < ./cache/old_deps_stripped.conf
|
readarray -t old_deps_list < ./cache/old_deps_stripped.conf
|
||||||
@@ -95,7 +95,7 @@ install-local-pkgbuild() {
|
|||||||
local installflags=$2
|
local installflags=$2
|
||||||
|
|
||||||
x pushd $location
|
x pushd $location
|
||||||
|
|
||||||
source ./PKGBUILD
|
source ./PKGBUILD
|
||||||
x yay -S $installflags --asdeps "${depends[@]}"
|
x yay -S $installflags --asdeps "${depends[@]}"
|
||||||
x makepkg -si --noconfirm
|
x makepkg -si --noconfirm
|
||||||
@@ -265,9 +265,13 @@ grep -q 'source ${XDG_CONFIG_HOME:-~/.config}/zshrc.d/dots-hyprland.zsh' ~/.zshr
|
|||||||
warn_files=()
|
warn_files=()
|
||||||
warn_files_tests=()
|
warn_files_tests=()
|
||||||
warn_files_tests+=(/usr/local/bin/ags)
|
warn_files_tests+=(/usr/local/bin/ags)
|
||||||
|
warn_files_tests+=(/usr/local/etc/pam.d/ags)
|
||||||
|
warn_files_tests+=(/usr/local/lib/{GUtils-1.0.typelib,Gvc-1.0.typelib,libgutils.so,libgvc.so})
|
||||||
warn_files_tests+=(/usr/local/share/com.github.Aylur.ags)
|
warn_files_tests+=(/usr/local/share/com.github.Aylur.ags)
|
||||||
warn_files_tests+=(/usr/local/share/fonts/TTF/Rubik{,-Italic}'[wght]'.ttf)
|
warn_files_tests+=(/usr/local/share/fonts/TTF/Rubik{,-Italic}'[wght]'.ttf)
|
||||||
|
warn_files_tests+=(/usr/local/share/licenses/ttf-rubik)
|
||||||
warn_files_tests+=(/usr/local/share/fonts/TTF/Gabarito-{Black,Bold,ExtraBold,Medium,Regular,SemiBold}.ttf)
|
warn_files_tests+=(/usr/local/share/fonts/TTF/Gabarito-{Black,Bold,ExtraBold,Medium,Regular,SemiBold}.ttf)
|
||||||
|
warn_files_tests+=(/usr/local/share/licenses/ttf-gabarito)
|
||||||
warn_files_tests+=(/usr/local/share/icons/OneUI{,-dark,-light})
|
warn_files_tests+=(/usr/local/share/icons/OneUI{,-dark,-light})
|
||||||
warn_files_tests+=(/usr/local/share/icons/Bibata-Modern-Classic)
|
warn_files_tests+=(/usr/local/share/icons/Bibata-Modern-Classic)
|
||||||
warn_files_tests+=(/usr/local/bin/{LaTeX,res})
|
warn_files_tests+=(/usr/local/bin/{LaTeX,res})
|
||||||
|
|||||||
Reference in New Issue
Block a user