diff --git a/system/etc/pam.d/i3lock b/system/etc/pam.d/i3lock new file mode 100644 index 000000000..af4aad193 --- /dev/null +++ b/system/etc/pam.d/i3lock @@ -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 diff --git a/system/etc/pam.d/sudo b/system/etc/pam.d/sudo new file mode 100644 index 000000000..fee24b319 --- /dev/null +++ b/system/etc/pam.d/sudo @@ -0,0 +1,5 @@ +#%PAM-1.0 +auth sufficient pam_fprintd.so +auth include system-auth +account include system-auth +session include system-auth diff --git a/system/etc/pam.d/system-local-login b/system/etc/pam.d/system-local-login new file mode 100644 index 000000000..5ccafc20f --- /dev/null +++ b/system/etc/pam.d/system-local-login @@ -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 diff --git a/user/.config/suckless/dmenu/scripts/dmenu_power b/user/.config/suckless/dmenu/scripts/dmenu_power index a778053a9..06bdeeb62 100755 --- a/user/.config/suckless/dmenu/scripts/dmenu_power +++ b/user/.config/suckless/dmenu/scripts/dmenu_power @@ -2,18 +2,28 @@ # ***This script was made by Clay Gomera (Drake)*** # - Description: A simple power menu dmenu script -# - Dependencies: dmenu (Everything else can be changed) +# - Dependencies: dmenu, power-profiles-daemon ## OPTIONS ## option1=" Logout" option2="ο€ž Reboot" option3=" Power off" option4="πŸ’€ Suspend" -option5="πŸ”’lock" -option6="❌Cancel" +option5="πŸ”’ Lock" +option6="πŸ”‹ Change power profile" +option7="❌Cancel" ## 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 ## action=$(echo -e "$options" | dmenu -b -i -p " ") @@ -31,5 +41,18 @@ case "$action" in $option5*) betterlockscreen -l;; $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 esac diff --git a/user/.config/suckless/dwm/config.def.h b/user/.config/suckless/dwm/config.def.h index b3bddc506..b19ca3f2d 100644 --- a/user/.config/suckless/dwm/config.def.h +++ b/user/.config/suckless/dwm/config.def.h @@ -178,7 +178,7 @@ static Keychord keychords[] = { TAGKEYS( XK_8, 7) TAGKEYS( XK_9, 8) /* Close Window */ - {1, {{MODKEY|ShiftMask, XK_c}}, killclient, {0} }, + {1, {{MODKEY, XK_q}}, killclient, {0} }, /* Cycle between tags */ {1, {{MODKEY|ControlMask, XK_Tab}}, view, {0} }, /* Window moving */ @@ -188,8 +188,8 @@ static Keychord keychords[] = { {1, {{MODKEY, XK_j}}, focusstack, {.i = +1 } }, {1, {{MODKEY, XK_k}}, focusstack, {.i = -1 } }, /* Increase and decrease master windows count */ - {1, {{MODKEY, XK_equal}}, incnmaster, {.i = +1 } }, - {1, {{MODKEY, XK_minus}}, incnmaster, {.i = -1 } }, + {1, {{MODKEY, XK_equal}}, incnmaster, {.i = +1 } }, + {1, {{MODKEY, XK_minus}}, incnmaster, {.i = -1 } }, /* Increase and decrease master window size */ {1, {{MODKEY, XK_h}}, setmfact, {.f = -0.05} }, {1, {{MODKEY, XK_l}}, setmfact, {.f = +0.05} }, @@ -215,7 +215,7 @@ static Keychord keychords[] = { /* Switch to tilewide layout */ {1, {{MODKEY, XK_w}}, setlayout, {.v = &layouts[7]} }, /* Toggle floating mode */ - {1, {{MODKEY|ShiftMask, XK_f}}, togglefloating, {0} }, + {1, {{MODKEY|ControlMask, XK_f}}, togglefloating, {0} }, /* Toggle fullscreen mode */ {1, {{MODKEY, XK_space}}, togglefullscr, {0} }, /* 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") }, /* SCRATCHPADS */ - {2, {{MODKEY, XK_grave}, {0, XK_Return}}, togglescratch, {.ui = 0 } }, - {2, {{MODKEY, XK_grave}, {0, XK_c}}, togglescratch, {.ui = 1 } }, - {2, {{MODKEY, XK_grave}, {0, XK_b}}, togglescratch, {.ui = 2 } }, - {2, {{MODKEY, XK_grave}, {0, XK_f}}, togglescratch, {.ui = 3 } }, - {2, {{MODKEY, XK_grave}, {0, XK_a}}, togglescratch, {.ui = 4 } }, - {2, {{MODKEY, XK_grave}, {0, XK_y}}, togglescratch, {.ui = 5 } }, - {2, {{MODKEY, XK_grave}, {0, XK_m}}, togglescratch, {.ui = 6 } }, - {2, {{MODKEY, XK_grave}, {0, XK_p}}, togglescratch, {.ui = 7 } }, - {2, {{MODKEY, XK_grave}, {0, XK_g}}, togglescratch, {.ui = 8 } }, - {2, {{MODKEY, XK_grave}, {0, XK_n}}, togglescratch, {.ui = 9 } }, - {2, {{MODKEY, XK_grave}, {0, XK_x}}, togglescratch, {.ui = 10 } }, + {1, {{MODKEY|ShiftMask, XK_Return}}, togglescratch, {.ui = 0 } }, + {1, {{MODKEY|ShiftMask, XK_c}}, togglescratch, {.ui = 1 } }, + {1, {{MODKEY|ShiftMask, XK_b}}, togglescratch, {.ui = 2 } }, + {1, {{MODKEY|ShiftMask, XK_f}}, togglescratch, {.ui = 3 } }, + {1, {{MODKEY|ShiftMask, XK_a}}, togglescratch, {.ui = 4 } }, + {1, {{MODKEY|ShiftMask, XK_y}}, togglescratch, {.ui = 5 } }, + {1, {{MODKEY|ShiftMask, XK_m}}, togglescratch, {.ui = 6 } }, + {1, {{MODKEY|ShiftMask, XK_p}}, togglescratch, {.ui = 7 } }, + {1, {{MODKEY|ShiftMask, XK_g}}, togglescratch, {.ui = 8 } }, + {1, {{MODKEY|ShiftMask, XK_n}}, togglescratch, {.ui = 9 } }, + {1, {{MODKEY|ShiftMask, XK_x}}, togglescratch, {.ui = 10 } }, /* DWM BOOTSTRAP */ {1, {{MODKEY|ControlMask, XK_r}}, quit, {1} }, {1, {{MODKEY|ShiftMask, XK_q}}, quit, {0} }, diff --git a/user/.config/suckless/dwmblocks/blocks.def.h b/user/.config/suckless/dwmblocks/blocks.def.h index 7b9590b9f..65e5debd8 100644 --- a/user/.config/suckless/dwmblocks/blocks.def.h +++ b/user/.config/suckless/dwmblocks/blocks.def.h @@ -1,6 +1,8 @@ //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}, diff --git a/user/.config/suckless/dwmblocks/blocks.h b/user/.config/suckless/dwmblocks/blocks.h new file mode 100644 index 000000000..65e5debd8 --- /dev/null +++ b/user/.config/suckless/dwmblocks/blocks.h @@ -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 = '|'; diff --git a/user/.config/suckless/dwmblocks/scripts/battery b/user/.config/suckless/dwmblocks/scripts/battery index 036cd09ff..dc65a14ed 100755 --- a/user/.config/suckless/dwmblocks/scripts/battery +++ b/user/.config/suckless/dwmblocks/scripts/battery @@ -1,5 +1,4 @@ -#!/bin/sh - +#!/bin/bash # Loop through all attached batteries and format the info for battery in /sys/class/power_supply/BAT?*; do # If non-first battery, print a space separator. diff --git a/user/.config/suckless/dwmblocks/scripts/clock b/user/.config/suckless/dwmblocks/scripts/clock index 2b954aa5d..b1f6a0ff5 100755 --- a/user/.config/suckless/dwmblocks/scripts/clock +++ b/user/.config/suckless/dwmblocks/scripts/clock @@ -1,7 +1,5 @@ -#!/bin/sh - +#!/bin/bash clock=$(date '+%I') - case "$clock" in "00") icon="πŸ•›" ;; "01") icon="πŸ•" ;; @@ -17,6 +15,5 @@ case "$clock" in "11") icon="πŸ•š" ;; "12") icon="πŸ•›" ;; esac - date=$(date "+%Y %b %d (%a) | $icon %I:%M%p") echo " $date" diff --git a/user/.config/suckless/dwmblocks/scripts/cpu b/user/.config/suckless/dwmblocks/scripts/cpu new file mode 100755 index 000000000..b00c18ee4 --- /dev/null +++ b/user/.config/suckless/dwmblocks/scripts/cpu @@ -0,0 +1,3 @@ +#!/bin/bash +usage=$(top -b -n1 | grep "Cpu(s)" | awk '{print $2 + $4}') +echo -e " CPU: ${usage%.*}% " diff --git a/user/.config/suckless/dwmblocks/scripts/layout b/user/.config/suckless/dwmblocks/scripts/layout index 262c1b57c..8ca87270e 100755 --- a/user/.config/suckless/dwmblocks/scripts/layout +++ b/user/.config/suckless/dwmblocks/scripts/layout @@ -1,3 +1,3 @@ -#!/bin/sh +#!/bin/bash layout=$(setxkbmap -query | grep -oP 'layout:\s*\K\w+'); echo " ⌨ $layout "; diff --git a/user/.config/suckless/dwmblocks/scripts/memory b/user/.config/suckless/dwmblocks/scripts/memory index cb401466a..80311d66b 100755 --- a/user/.config/suckless/dwmblocks/scripts/memory +++ b/user/.config/suckless/dwmblocks/scripts/memory @@ -1,4 +1,3 @@ -#! /bin/bash - +#!/bin/bash mem="$(free -h | awk '/^Mem:/ {print $3 "/" $2}')" -echo -e "πŸ’» $mem RAM " +echo -e "  RAM: $mem " diff --git a/user/.config/suckless/dwmblocks/scripts/volume b/user/.config/suckless/dwmblocks/scripts/volume index 03221420c..e229044f0 100755 --- a/user/.config/suckless/dwmblocks/scripts/volume +++ b/user/.config/suckless/dwmblocks/scripts/volume @@ -1,11 +1,7 @@ -#!/bin/sh - +#!/bin/bash # Prints the current volume or πŸ”‡ if muted. - [ $(pamixer --get-mute) = true ] && echo " πŸ”‡ " && exit - vol="$(pamixer --get-volume)" - if [ "$vol" -gt "70" ]; then icon="πŸ”Š" elif [ "$vol" -gt "30" ]; then @@ -15,5 +11,4 @@ elif [ "$vol" -gt "0" ]; then else echo " πŸ”‡ " && exit fi - echo " $icon $vol% "