better scripts
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/env bash
|
||||
|
||||
## Collect data
|
||||
cache_dir="$HOME/.cache/eww/weather"
|
||||
|
||||
@@ -12,6 +12,10 @@ if [ "$LOGNAME" != "$USER" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(ps -o comm= -p $(ps -o ppid= -p $$) 2>/dev/null)" = "su" ]; then
|
||||
exit 1
|
||||
ppid=$(ps -o ppid= -p $$ 2>/dev/null)
|
||||
if [ -n "$ppid" ]; then
|
||||
parent_comm=$(ps -o comm= -p "$ppid" 2>/dev/null)
|
||||
if [ "$parent_comm" = "su" ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
export __NV_PRIME_RENDER_OFFLOAD=1
|
||||
export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
||||
export __VK_LAYER_NV_optimus=NVIDIA_only
|
||||
16
.scripts/truecolor-test.sh
Executable file
16
.scripts/truecolor-test.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
# Based on: https://gist.github.com/XVilka/8346728
|
||||
|
||||
awk -v term_cols="${width:-$(tput cols || echo 80)}" 'BEGIN{
|
||||
s="/\\";
|
||||
for (colnum = 0; colnum<term_cols; colnum++) {
|
||||
r = 255-(colnum*255/term_cols);
|
||||
g = (colnum*510/term_cols);
|
||||
b = (colnum*255/term_cols);
|
||||
if (g>255) g = 510-g;
|
||||
printf "\033[48;2;%d;%d;%dm", r,g,b;
|
||||
printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
|
||||
printf "%s\033[0m", substr(s,colnum%2+1,1);
|
||||
}
|
||||
printf "\n";
|
||||
}'
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only
|
||||
unset __NV_PRIME_RENDER_OFFLOAD
|
||||
unset __GLX_VENDOR_LIBRARY_NAME
|
||||
unset __VK_LAYER_NV_optimus
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/env bash
|
||||
|
||||
# get highest workspace ID
|
||||
max_id=$(hyprctl workspaces | grep '^workspace ID ' | awk '{print $3}' | sort -n | tail -1)
|
||||
|
||||
Reference in New Issue
Block a user