Added pam stuff and improved dwm and dmenu scripts

This commit is contained in:
Clay Gomera 2022-07-27 00:05:59 -04:00
parent 89932948af
commit a85feb8163
13 changed files with 96 additions and 35 deletions

11
system/etc/pam.d/i3lock Normal file
View file

@ -0,0 +1,11 @@
#
# PAM configuration file for the i3lock-color screen locker. By default, it includes
# the 'system-local-login' configuration file (see /etc/pam.d/system-local-login)
# for Arch and Gentoo and 'login' for Debian. Note that upstream uses only 'login',
# which doesn't work on Arch and Gentoo.
#
auth include system-local-login
auth required pam_env.so
auth sufficient pam_unix.so try_first_pass likeauth nullok
auth sufficient pam_fprintd.so

5
system/etc/pam.d/sudo Normal file
View file

@ -0,0 +1,5 @@
#%PAM-1.0
auth sufficient pam_fprintd.so
auth include system-auth
account include system-auth
session include system-auth

View file

@ -0,0 +1,7 @@
#%PAM-1.0
auth sufficient pam_fprintd.so
auth include system-login
account include system-login
password include system-login
session include system-login

View file

@ -2,18 +2,28 @@
# ***This script was made by Clay Gomera (Drake)*** # ***This script was made by Clay Gomera (Drake)***
# - Description: A simple power menu dmenu script # - Description: A simple power menu dmenu script
# - Dependencies: dmenu (Everything else can be changed) # - Dependencies: dmenu, power-profiles-daemon
## OPTIONS ## ## OPTIONS ##
option1=" Logout" option1=" Logout"
option2=" Reboot" option2=" Reboot"
option3=" Power off" option3=" Power off"
option4="💤 Suspend" option4="💤 Suspend"
option5="🔒lock" option5="🔒 Lock"
option6="❌Cancel" option6="🔋 Change power profile"
option7="❌Cancel"
## OPTIONS ARRAY ## ## OPTIONS ARRAY ##
options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6" options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6\n$option7"
## POWER PROFILE OPTIONS ##
pwr1="🔥 Performance"
pwr2="⚖ Balanced"
pwr3="🔋 Power Saver"
pwr4="❌Cancel"
## POWER PROFILES ARRAY ##
pwrs="$pwr1\n$pwr2\n$pwr3\n$pwr4"
## MAIN ACTION COMMAND ## ## MAIN ACTION COMMAND ##
action=$(echo -e "$options" | dmenu -b -i -p " ") action=$(echo -e "$options" | dmenu -b -i -p " ")
@ -31,5 +41,18 @@ case "$action" in
$option5*) $option5*)
betterlockscreen -l;; betterlockscreen -l;;
$option6*) $option6*)
currentpwr=$(powerprofilesctl get)
pwraction=$(echo -e "$pwrs" | dmenu -b -i -p "Current profile is: ${currentpwr} | Select profile:")
case "$pwraction" in
$pwr1*)
powerprofilesctl set performance && notify-send "Power profile switched to performance";;
$pwr2*)
powerprofilesctl set balanced && notify-send "Power profile switched to balanced";;
$pwr3*)
powerprofilesctl set power-saver && notify-send "Power profile switched to power saver";;
$pwr4*)
exit 0
esac;;
$option7*)
exit 0 exit 0
esac esac

View file

@ -178,7 +178,7 @@ static Keychord keychords[] = {
TAGKEYS( XK_8, 7) TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8) TAGKEYS( XK_9, 8)
/* Close Window */ /* Close Window */
{1, {{MODKEY|ShiftMask, XK_c}}, killclient, {0} }, {1, {{MODKEY, XK_q}}, killclient, {0} },
/* Cycle between tags */ /* Cycle between tags */
{1, {{MODKEY|ControlMask, XK_Tab}}, view, {0} }, {1, {{MODKEY|ControlMask, XK_Tab}}, view, {0} },
/* Window moving */ /* Window moving */
@ -215,7 +215,7 @@ static Keychord keychords[] = {
/* Switch to tilewide layout */ /* Switch to tilewide layout */
{1, {{MODKEY, XK_w}}, setlayout, {.v = &layouts[7]} }, {1, {{MODKEY, XK_w}}, setlayout, {.v = &layouts[7]} },
/* Toggle floating mode */ /* Toggle floating mode */
{1, {{MODKEY|ShiftMask, XK_f}}, togglefloating, {0} }, {1, {{MODKEY|ControlMask, XK_f}}, togglefloating, {0} },
/* Toggle fullscreen mode */ /* Toggle fullscreen mode */
{1, {{MODKEY, XK_space}}, togglefullscr, {0} }, {1, {{MODKEY, XK_space}}, togglefullscr, {0} },
/* View all windows of all tags in the current tag */ /* View all windows of all tags in the current tag */
@ -294,17 +294,17 @@ static Keychord keychords[] = {
{2, {{MODKEY, XK_p}, {0, XK_p}}, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_pipe") }, {2, {{MODKEY, XK_p}, {0, XK_p}}, spawn, SHCMD("$HOME/.config/suckless/dmenu/scripts/dmenu_pipe") },
/* SCRATCHPADS */ /* SCRATCHPADS */
{2, {{MODKEY, XK_grave}, {0, XK_Return}}, togglescratch, {.ui = 0 } }, {1, {{MODKEY|ShiftMask, XK_Return}}, togglescratch, {.ui = 0 } },
{2, {{MODKEY, XK_grave}, {0, XK_c}}, togglescratch, {.ui = 1 } }, {1, {{MODKEY|ShiftMask, XK_c}}, togglescratch, {.ui = 1 } },
{2, {{MODKEY, XK_grave}, {0, XK_b}}, togglescratch, {.ui = 2 } }, {1, {{MODKEY|ShiftMask, XK_b}}, togglescratch, {.ui = 2 } },
{2, {{MODKEY, XK_grave}, {0, XK_f}}, togglescratch, {.ui = 3 } }, {1, {{MODKEY|ShiftMask, XK_f}}, togglescratch, {.ui = 3 } },
{2, {{MODKEY, XK_grave}, {0, XK_a}}, togglescratch, {.ui = 4 } }, {1, {{MODKEY|ShiftMask, XK_a}}, togglescratch, {.ui = 4 } },
{2, {{MODKEY, XK_grave}, {0, XK_y}}, togglescratch, {.ui = 5 } }, {1, {{MODKEY|ShiftMask, XK_y}}, togglescratch, {.ui = 5 } },
{2, {{MODKEY, XK_grave}, {0, XK_m}}, togglescratch, {.ui = 6 } }, {1, {{MODKEY|ShiftMask, XK_m}}, togglescratch, {.ui = 6 } },
{2, {{MODKEY, XK_grave}, {0, XK_p}}, togglescratch, {.ui = 7 } }, {1, {{MODKEY|ShiftMask, XK_p}}, togglescratch, {.ui = 7 } },
{2, {{MODKEY, XK_grave}, {0, XK_g}}, togglescratch, {.ui = 8 } }, {1, {{MODKEY|ShiftMask, XK_g}}, togglescratch, {.ui = 8 } },
{2, {{MODKEY, XK_grave}, {0, XK_n}}, togglescratch, {.ui = 9 } }, {1, {{MODKEY|ShiftMask, XK_n}}, togglescratch, {.ui = 9 } },
{2, {{MODKEY, XK_grave}, {0, XK_x}}, togglescratch, {.ui = 10 } }, {1, {{MODKEY|ShiftMask, XK_x}}, togglescratch, {.ui = 10 } },
/* DWM BOOTSTRAP */ /* DWM BOOTSTRAP */
{1, {{MODKEY|ControlMask, XK_r}}, quit, {1} }, {1, {{MODKEY|ControlMask, XK_r}}, quit, {1} },
{1, {{MODKEY|ShiftMask, XK_q}}, quit, {0} }, {1, {{MODKEY|ShiftMask, XK_q}}, quit, {0} },

View file

@ -1,6 +1,8 @@
//Modify this file to change what commands output to your statusbar, and recompile using the make command. //Modify this file to change what commands output to your statusbar, and recompile using the make command.
static const Block blocks[] = { static const Block blocks[] = {
/*Command*/ /*Update Interval*/ /*Update Signal*/ /*Command*/ /*Update Interval*/ /*Update Signal*/
{"", "$HOME/.config/suckless/dwmblocks/scripts/cpu", 1, 1},
{"", "$HOME/.config/suckless/dwmblocks/scripts/memory", 1, 1}, {"", "$HOME/.config/suckless/dwmblocks/scripts/memory", 1, 1},
{"", "$HOME/.config/suckless/dwmblocks/scripts/layout", 1, 1}, {"", "$HOME/.config/suckless/dwmblocks/scripts/layout", 1, 1},

View file

@ -0,0 +1,20 @@
//Modify this file to change what commands output to your statusbar, and recompile using the make command.
static const Block blocks[] = {
/*Command*/ /*Update Interval*/ /*Update Signal*/
{"", "$HOME/.config/suckless/dwmblocks/scripts/cpu", 1, 1},
{"", "$HOME/.config/suckless/dwmblocks/scripts/memory", 1, 1},
{"", "$HOME/.config/suckless/dwmblocks/scripts/layout", 1, 1},
{"", "$HOME/.config/suckless/dwmblocks/scripts/battery", 1, 1},
{"", "$HOME/.config/suckless/dwmblocks/scripts/brightness", 1, 1},
{"", "$HOME/.config/suckless/dwmblocks/scripts/volume", 1, 1},
{"", "$HOME/.config/suckless/dwmblocks/scripts/clock", 5, 0},
};
//sets delimeter between status commands. NULL character ('\0') means no delimeter.
static char delim = '|';

View file

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/bash
# Loop through all attached batteries and format the info # Loop through all attached batteries and format the info
for battery in /sys/class/power_supply/BAT?*; do for battery in /sys/class/power_supply/BAT?*; do
# If non-first battery, print a space separator. # If non-first battery, print a space separator.

View file

@ -1,7 +1,5 @@
#!/bin/sh #!/bin/bash
clock=$(date '+%I') clock=$(date '+%I')
case "$clock" in case "$clock" in
"00") icon="🕛" ;; "00") icon="🕛" ;;
"01") icon="🕐" ;; "01") icon="🕐" ;;
@ -17,6 +15,5 @@ case "$clock" in
"11") icon="🕚" ;; "11") icon="🕚" ;;
"12") icon="🕛" ;; "12") icon="🕛" ;;
esac esac
date=$(date "+%Y %b %d (%a) | $icon %I:%M%p") date=$(date "+%Y %b %d (%a) | $icon %I:%M%p")
echo " $date" echo " $date"

View file

@ -0,0 +1,3 @@
#!/bin/bash
usage=$(top -b -n1 | grep "Cpu(s)" | awk '{print $2 + $4}')
echo -e " CPU: ${usage%.*}% "

View file

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/bash
layout=$(setxkbmap -query | grep -oP 'layout:\s*\K\w+'); layout=$(setxkbmap -query | grep -oP 'layout:\s*\K\w+');
echo " ⌨ $layout "; echo " ⌨ $layout ";

View file

@ -1,4 +1,3 @@
#!/bin/bash #!/bin/bash
mem="$(free -h | awk '/^Mem:/ {print $3 "/" $2}')" mem="$(free -h | awk '/^Mem:/ {print $3 "/" $2}')"
echo -e "💻 $mem RAM " echo -e "  RAM: $mem "

View file

@ -1,11 +1,7 @@
#!/bin/sh #!/bin/bash
# Prints the current volume or 🔇 if muted. # Prints the current volume or 🔇 if muted.
[ $(pamixer --get-mute) = true ] && echo " 🔇 " && exit [ $(pamixer --get-mute) = true ] && echo " 🔇 " && exit
vol="$(pamixer --get-volume)" vol="$(pamixer --get-volume)"
if [ "$vol" -gt "70" ]; then if [ "$vol" -gt "70" ]; then
icon="🔊" icon="🔊"
elif [ "$vol" -gt "30" ]; then elif [ "$vol" -gt "30" ]; then
@ -15,5 +11,4 @@ elif [ "$vol" -gt "0" ]; then
else else
echo " 🔇 " && exit echo " 🔇 " && exit
fi fi
echo " $icon $vol% " echo " $icon $vol% "