diff options
-rwxr-xr-x | .old/setup | 13 | ||||
-rwxr-xr-x | bar/volume | 2 | ||||
-rwxr-xr-x | flask | 8 | ||||
-rwxr-xr-x | keyboard/bl | 13 | ||||
-rwxr-xr-x | keyboard/shutdownprompt | 11 | ||||
-rwxr-xr-x | keyboard/volcon | 2 | ||||
-rwxr-xr-x | misc/listgroups | 2 |
7 files changed, 35 insertions, 16 deletions
@@ -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 @@ -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) { @@ -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 |