summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2022-11-28 07:45:30 -0600
committerTimmy Keller <tjk@tjkeller.xyz>2022-11-28 07:45:30 -0600
commit4a38bb5e2b157dce33dd6a5058dece371a9e7161 (patch)
tree95097dd80b2e48afcbeeac494f1e97e1d4a578af
parent521bc70d8a81334945a498c1ff09de45554c0fe9 (diff)
downloadscripts-4a38bb5e2b157dce33dd6a5058dece371a9e7161.tar.xz
scripts-4a38bb5e2b157dce33dd6a5058dece371a9e7161.zip
asdf
-rwxr-xr-x.old/setup13
-rwxr-xr-xbar/volume2
-rwxr-xr-xflask8
-rwxr-xr-xkeyboard/bl13
-rwxr-xr-xkeyboard/shutdownprompt11
-rwxr-xr-xkeyboard/volcon2
-rwxr-xr-xmisc/listgroups2
7 files changed, 35 insertions, 16 deletions
diff --git a/.old/setup b/.old/setup
index eaeec39..bcb0843 100755
--- a/.old/setup
+++ b/.old/setup
@@ -33,9 +33,11 @@ Name=Default profile" > $pcmanfmroot/root.desktop
}
minticons() {
- gitdir="/tmp/mint-y-icons"
+ gitdir="/tmp/mint-y-icons-master"
iconsdir="$gitdir/usr/share/icons"
- git clone https://github.com/linuxmint/mint-y-icons.git "$gitdir"
+ #git clone https://github.com/linuxmint/mint-y-icons.git "$gitdir"
+ wget https://github.com/linuxmint/mint-y-icons/archive/refs/heads/master.zip -O "$gitdir.zip"
+ bsdtar xvf "$gitdir.zip"
#iconsets="$(interactiveopt "$(ls "$iconsdir")" "Choose icon sets (if using dark theme, COPY THE NON-DARK THEME TOO): ")"
#iconsets="$iconset Mint-Y"
#for iconset in $iconsets; do
@@ -46,10 +48,11 @@ minticons() {
}
mintthemes() {
- gitdir="/tmp/mint-themes"
+ gitdir="/tmp/mint-themes-master"
themesdir="$gitdir/usr/share/themes"
#iconsdir="$gitdir/usr/share/icons"
- git clone https://github.com/linuxmint/mint-themes.git "$gitdir"
+ wget https://github.com/linuxmint/mint-themes/archive/refs/heads/master.zip -O "$gitdir.zip"
+ bsdtar xvf "$gitdir.zip"
curdir="$(pwd)"
cd $gitdir
make
@@ -71,6 +74,6 @@ iconsdestdir=/usr/share/icons
themesdestdir=/usr/share/themes
mkdir -p $iconsdestdir $themesdestdir
-pcmanfmconf
+#pcmanfmconf
minticons
mintthemes
diff --git a/bar/volume b/bar/volume
index 2eb9250..3e86809 100755
--- a/bar/volume
+++ b/bar/volume
@@ -1,7 +1,7 @@
#!/usr/bin/awk -f
BEGIN {
-cmd="amixer -M sget Master"
+cmd="amixer -D pipewire sget Master"
FS="[][]"
while (cmd | getline) {
if (NF > 1) {
diff --git a/flask b/flask
deleted file mode 100755
index 5a53cdb..0000000
--- a/flask
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/python3.10
-# -*- coding: utf-8 -*-
-import re
-import sys
-from flask.cli import main
-if __name__ == '__main__':
- sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
- sys.exit(main())
diff --git a/keyboard/bl b/keyboard/bl
index 34ea0b0..75a0b4b 100755
--- a/keyboard/bl
+++ b/keyboard/bl
@@ -6,7 +6,8 @@ bl_min=0
bl_max=100
# DDC/CI stuff
-ddcutil="ddcutil --sleep-less --noverify --enable-capabilities-cache --sleep-multiplier $sleep_multiplier" # Make sure user is in group i2c
+ddcutil="ddcutil --sleep-less --noverify --sleep-multiplier $sleep_multiplier" # Make sure user is in group i2c
+#ddcutil="ddcutil --sleep-less --noverify --enable-capabilities-cache --sleep-multiplier $sleep_multiplier" # Make sure user is in group i2c
max() { [ $1 -gt $2 ] && echo $1 || echo $2; }
min() { [ $1 -lt $2 ] && echo $1 || echo $2; }
@@ -17,9 +18,19 @@ ddc_dec() { ddc_set $(max $(( `ddc_get` - $1 )) $bl_min) $2; }
forall() { for d in $(seq `xrandr | grep ' connected' | wc -l`); do ($1 $2 $d); done; }
+i2c_group() {
+ sudo=${SUDO:-sudo}
+ ! $sudo -n true && echo "Please try again with root permissions!" && exit
+ grep '^i2c' /etc/groups && echo "i2c group already exists!" && exit
+ $sudo groupadd --system i2c && \
+ $sudo cp /usr/share/ddcutil/data/45-ddcutil-i2c.rules /etc/udev/rules.d && \
+ echo "i2c group successfully added! Now add your user to it"
+}
+
case $1 in
set) forall ddc_set $2 ;;
get) forall ddc_get && echo '%' ;;
inc) forall ddc_inc $2 ;;
dec) forall ddc_dec $2 ;;
+ i2c-groupadd) i2c_group ;;
esac
diff --git a/keyboard/shutdownprompt b/keyboard/shutdownprompt
index b56268d..7654f2f 100755
--- a/keyboard/shutdownprompt
+++ b/keyboard/shutdownprompt
@@ -1,6 +1,17 @@
#!/bin/sh
dmenucolors='-nb #AA0000 -nf #FFF -sb #FF0000 -sf #FFF'
[ -n "$1" ] && option="$1" || option=$(echo "Cancel\nSuspend\nShutdown\nRestart" | dmenu -p "Power Menu " $dmenucolors || exit)
+
+warn_process_names="ffmpeg obs dnf xbps-install xbps-remove emerge apt pacman"
+
+for process_name in $warn_process_names; do
+ if pgrep $process_name >/dev/null; then
+ cancel=$(echo "Cancel\nProceed" | dmenu -p "Are you sure you want to shut down while $process_name is still running?" $dmenucolors)
+ [ "$cancel" = "Proceed" ] && continue
+ exit
+ fi
+done
+
case $option in
Suspend) launch zzz ;;
Shutdown) launch off ;;
diff --git a/keyboard/volcon b/keyboard/volcon
index 1891929..9940c67 100755
--- a/keyboard/volcon
+++ b/keyboard/volcon
@@ -1,3 +1,3 @@
#!/bin/sh
-amixer -M sset Master $1 > /dev/null
+amixer -D pipewire sset Master $1 > /dev/null
dwmsbup 10
diff --git a/misc/listgroups b/misc/listgroups
new file mode 100755
index 0000000..a140253
--- /dev/null
+++ b/misc/listgroups
@@ -0,0 +1,2 @@
+#!/bin/sh
+cut -d ":" -f1 /etc/group | sort | column