Compare commits

...
10 Commits
5 changed files with 58 additions and 41 deletions

No files matched your search

+5
View File
@@ -158,6 +158,11 @@
pacman) pacman)
echo "*** Pacman ***" echo "*** Pacman ***"
auto_accept=""
if [[ -n "$accept" ]]; then
auto_accept="{{ update_accept_var }}"
fi
sudo pacman -Syu {{ update_accept_var }} || sudo pacman -Syu {{ update_accept_var }} ||
return 1 return 1
echo -e "\n" echo -e "\n"
+6 -4
View File
@@ -6,10 +6,9 @@
echo "`date` - Checking Active Programs" echo "`date` - Checking Active Programs"
PID="$$" ps -ef | grep battery_nag.sh | grep -v grep | grep -v "sh -c" | grep -v kill | grep -v $$
ps -ef | grep battery_nag.sh | grep -v $$ | grep -v grep
active=`ps -ef | grep battery_nag.sh | grep -v $$ | grep -vc grep` active=`ps -ef | grep battery_nag.sh | grep -v grep | grep -v "sh -c" | grep -v kill | grep -vc $$`
if (( "$active" >= 1 )); then if (( "$active" >= 1 )); then
echo "Program already running, exiting. Number of processes: $active" echo "Program already running, exiting. Number of processes: $active"
exit 1 exit 1
@@ -81,6 +80,7 @@ while true; do
echo "If not using a DE, also ensure 'dunst' or similar is running." echo "If not using a DE, also ensure 'dunst' or similar is running."
exit 3 exit 3
fi fi
echo "`date` - Attempting to report battery level at ${batt}."
$cmd "$title" "$message" $cmd "$title" "$message"
status="$?" status="$?"
@@ -96,7 +96,9 @@ while true; do
fi fi
time=$sleep time=$sleep
if [[ "$accelerate" == "Y" ]]; then if [[ "$accelerate" == "Y" && $batt -lt $alert ]]; then
# Bash only returns whole numbers, so things like 20/11 only provide 1.
# Likewise, if the battery is full, 20/100 returns 0, which is bad. :)
if (( batt > 0 )); then if (( batt > 0 )); then
time=$(( time / (alert / batt) )) time=$(( time / (alert / batt) ))
else else
+36 -37
View File
@@ -143,56 +143,60 @@ bindsym $mod+c exec codium-flatpak
## Brightness ## ## Brightness ##
# light requires sudo privileges unless video group and udev are configured. # light requires sudo privileges unless video group and udev are configured.
set $time 1500 set $b_time 3000
set $small 5 set $b_small 10
set $large 20 set $b_large 20
# Use the bracket keys to change the brightness. # Use the bracket keys to change the brightness.
bindsym $mod+bracketleft exec --no-startup-id "light -U $small && notify-send -t $time 'Brightness - ' $(light -G)" bindsym $mod+bracketleft exec --no-startup-id "light -U $b_small && notify-send -t $b_time 'Brightness - ' $(light -G)"
bindsym $mod+bracketright exec --no-startup-id "light -A $small && notify-send -t $time 'Brightness + ' $(light -G)" bindsym $mod+bracketright exec --no-startup-id "light -A $b_small && notify-send -t $b_time 'Brightness + ' $(light -G)"
bindsym $shift+$mod+bracketleft exec --no-startup-id "light -U $large && notify-send -t $time 'Brightness ---' $(light -G)" bindsym $shift+$mod+bracketleft exec --no-startup-id "light -U $b_large && notify-send -t $b_time 'Brightness ---' $(light -G)"
bindsym $shift+$mod+bracketright exec --no-startup-id "light -A $large && notify-send -t $time 'Brightness +++' $(light -G)" bindsym $shift+$mod+bracketright exec --no-startup-id "light -A $b_large && notify-send -t $b_time 'Brightness +++' $(light -G)"
# Also get the actual brightness keys to work!! # Also get the actual brightness keys to work!!
bindsym XF86MonBrightnessUp exec --no-startup-id "light -A $small && notify-send -t $time 'Brightness + ' $(light -G)" bindsym XF86MonBrightnessUp exec --no-startup-id "light -A $b_small && notify-send -t $b_time 'Brightness + ' $(light -G)"
bindsym XF86MonBrightnessDown exec --no-startup-id "light -U $small && notify-send -t $time 'Brightness - ' $(light -G)" bindsym XF86MonBrightnessDown exec --no-startup-id "light -U $b_small && notify-send -t $b_time 'Brightness - ' $(light -G)"
bindsym $shift+XF86MonBrightnessUp exec --no-startup-id "light -A $large && notify-send -t $time 'Brightness +++' $(light -G)" bindsym $shift+XF86MonBrightnessUp exec --no-startup-id "light -A $b_large && notify-send -t $b_time 'Brightness +++' $(light -G)"
bindsym $shift+XF86MonBrightnessDown exec --no-startup-id "light -U $large && notify-send -t $time 'Brightness ---' $(light -G)" bindsym $shift+XF86MonBrightnessDown exec --no-startup-id "light -U $b_large && notify-send -t $b_time 'Brightness ---' $(light -G)"
## Keyboard Brightness ## ## Keyboard Brightness ##
# Use same timing and step size settings as above.
# Macbooks tend to use 'sysfs/leds/smc::kbd_backlight' # Macbooks tend to use 'sysfs/leds/smc::kbd_backlight'
# NovaCustom laptop is 'sysfs/leds/system76_acpi::kbd_backlight' # NovaCustom laptop is 'sysfs/leds/system76_acpi::kbd_backlight'
# Some other laptops may be 'sysfs/class/leds/...', use ìght -L`to find out. # Some other laptops may be 'sysfs/class/leds/...', use ìght -L`to find out.
bindsym XF86KbdBrightnessUp exec "light -s sysfs/leds/smc::kbd_backlight -A 05 && notify-send -t 1500 'Keyboard Brightness + ' $(light -s sysfs/leds/smc::kbd_backlight -G)" bindsym XF86KbdBrightnessUp exec "light -s sysfs/leds/smc::kbd_backlight -A $b_small && notify-send -t $b_time 'Keyboard Brightness + ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym XF86KbdBrightnessDown exec "light -s sysfs/leds/smc::kbd_backlight -U 05 && notify-send -t 1500 'Keyboard Brightness - ' $(light -s sysfs/leds/smc::kbd_backlight -G)" bindsym XF86KbdBrightnessDown exec "light -s sysfs/leds/smc::kbd_backlight -U $b_small && notify-send -t $b_time 'Keyboard Brightness - ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $shift+XF86KbdBrightnessUp exec "light -s sysfs/leds/smc::kbd_backlight -A 20 && notify-send -t 1500 'Keyboard Brightness +++' $(light -s sysfs/leds/smc::kbd_backlight -G)" bindsym $shift+XF86KbdBrightnessUp exec "light -s sysfs/leds/smc::kbd_backlight -A $b_large && notify-send -t $b_time 'Keyboard Brightness +++' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $shift+XF86KbdBrightnessDown exec "light -s sysfs/leds/smc::kbd_backlight -U 20 && notify-send -t 1500 'Keyboard Brightness ---' $(light -s sysfs/leds/smc::kbd_backlight -G)" bindsym $shift+XF86KbdBrightnessDown exec "light -s sysfs/leds/smc::kbd_backlight -U $b_large && notify-send -t $b_time 'Keyboard Brightness ---' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $mod+apostrophe exec "light -s sysfs/leds/smc::kbd_backlight -A 05 && notify-send -t 1500 'Keyboard Brightness + ' $(light -s sysfs/leds/smc::kbd_backlight -G)" bindsym $mod+apostrophe exec "light -s sysfs/leds/smc::kbd_backlight -A $b_small && notify-send -t $b_time 'Keyboard Brightness + ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $mod+semicolon exec "light -s sysfs/leds/smc::kbd_backlight -U 05 && notify-send -t 1500 'Keyboard Brightness - ' $(light -s sysfs/leds/smc::kbd_backlight -G)" bindsym $mod+semicolon exec "light -s sysfs/leds/smc::kbd_backlight -U $b_small && notify-send -t $b_time 'Keyboard Brightness - ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $shift+$mod+apostrophe exec "light -s sysfs/leds/smc::kbd_backlight -A 20 && notify-send -t 1500 'Keyboard Brightness +++' $(light -s sysfs/leds/smc::kbd_backlight -G)" bindsym $shift+$mod+apostrophe exec "light -s sysfs/leds/smc::kbd_backlight -A $b_large && notify-send -t $b_time 'Keyboard Brightness +++' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $shift+$mod+semicolon exec "light -s sysfs/leds/smc::kbd_backlight -U 20 && notify-send -t 1500 'Keyboard Brightness ---' $(light -s sysfs/leds/smc::kbd_backlight -G)" bindsym $shift+$mod+semicolon exec "light -s sysfs/leds/smc::kbd_backlight -U $b_large && notify-send -t $b_time 'Keyboard Brightness ---' $(light -s sysfs/leds/smc::kbd_backlight -G)"
## Volume ## ## Volume ##
# The volume function is from https://git.hyperling.com/me/env-ansible # The volume function is from https://git.hyperling.com/me/env-ansible
set $large 25 set $v_time 1500
set $v_small 5
set $v_large 25
# Use the comma and period keys to change volume. # Use the comma and period keys to change volume.
bindsym $mod+comma exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$small && notify-send -t $time "Volume - " $(volume)' bindsym $mod+comma exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_small && notify-send -t $v_time "Volume - " $(volume)'
bindsym $mod+period exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$small && notify-send -t $time "Volume + " $(volume)' bindsym $mod+period exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_small && notify-send -t $v_time "Volume + " $(volume)'
bindsym $shift+$mod+comma exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$large && notify-send -t $time "Volume ---" $(volume)' bindsym $shift+$mod+comma exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_large && notify-send -t $v_time "Volume ---" $(volume)'
bindsym $shift+$mod+period exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$large && notify-send -t $time "Volume +++" $(volume)' bindsym $shift+$mod+period exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_large && notify-send -t $v_time "Volume +++" $(volume)'
# Actual volume keys. # Actual volume keys.
bindsym XF86AudioMute exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume mute && notify-send -t $time "Volume Muted" $(volume)' bindsym XF86AudioMute exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume mute && notify-send -t $v_time "Volume Muted" $(volume)'
bindsym XF86AudioRaiseVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$small && notify-send -t $time "Volume + " $(volume)' bindsym XF86AudioRaiseVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_small && notify-send -t $v_time "Volume + " $(volume)'
bindsym XF86AudioLowerVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$small && notify-send -t $time "Volume - " $(volume)' bindsym XF86AudioLowerVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_small && notify-send -t $v_time "Volume - " $(volume)'
bindsym $shift+XF86AudioRaiseVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$large && notify-send -t $time "Volume +++ " $(volume)' bindsym $shift+XF86AudioRaiseVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_large && notify-send -t $v_time "Volume +++ " $(volume)'
bindsym $shift+XF86AudioLowerVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$large && notify-send -t $time "Volume --- " $(volume)' bindsym $shift+XF86AudioLowerVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_large && notify-send -t $v_time "Volume --- " $(volume)'
bindsym $mod+slash exec pavucontrol bindsym $mod+slash exec pavucontrol
@@ -358,10 +362,10 @@ exec --no-startup-id light -O
exec --no-startup-id light -N 0 exec --no-startup-id light -N 0
# Set the correct keymap. # Set the correct keymap.
exec --no-startup-id setxkbmap -layout us -variant altgr-intl exec_always --no-startup-id setxkbmap -layout us -variant altgr-intl
# Notifications (allows fyi and notify-send to work) # Notifications (allows fyi and notify-send to work)
exec --no-startup-id dunst exec_always --no-startup-id "killall dunst; dunst"
# Audio # Audio
exec --no-startup-id "sleep 00; dbus-launch --exit-with-session i3" exec --no-startup-id "sleep 00; dbus-launch --exit-with-session i3"
@@ -376,9 +380,4 @@ exec_always --no-startup-id feh --recursive --randomize --bg-fill ~/Pictures/Wal
exec_always --no-startup-id "killall picom; picom -f" exec_always --no-startup-id "killall picom; picom -f"
# Battery # Battery
exec_always --no-startup-id "killall battery_nag.sh; battery_nag.sh" exec_always --no-startup-id bash -c 'pkill -ef "bash `which battery_nag.sh`" >~/Reports/battery_nag.log 2>&1; battery_nag.sh >>~/Reports/battery_nag.log 2>&1'
# TBD:
# - Figure out how to make this killall work! Process runs as:
# - 'bash /usr/local/bin/battery_nag.sh'
# - 'bash ~/battery_nag.sh'
# - 'bash ./battery_nag.sh'
+6
View File
@@ -141,6 +141,11 @@
if [[ -n "$XDG_SESSION_ID" ]]; then if [[ -n "$XDG_SESSION_ID" ]]; then
setxkbmap -layout us -variant altgr-intl setxkbmap -layout us -variant altgr-intl
fi fi
export_notify: |
export NOTIFY="`which fyi 2>/dev/null || which notify-send 2>/dev/null`"
function notify() {
$NOTIFY $@
}
- name: General | Account Management | Users | Files | RC Variables - name: General | Account Management | Users | Files | RC Variables
set_fact: set_fact:
@@ -1200,6 +1205,7 @@
{{ export_terminal }} {{ export_terminal }}
{{ export_browser }} {{ export_browser }}
{{ keyboard_settings }} {{ keyboard_settings }}
{{ export_notify }}
rc_common: | rc_common: |
# Fixes "command not found" when using aliases within functions. # Fixes "command not found" when using aliases within functions.
shopt -s expand_aliases shopt -s expand_aliases
+5
View File
@@ -81,6 +81,11 @@
set_fact: set_fact:
mullvad_exe_new: "{{ global_bin }}/{{ mullvad_exe }}" mullvad_exe_new: "{{ global_bin }}/{{ mullvad_exe }}"
- name: Workstation | Software | VPN | Mullvad | PATH | Facts (pacman)
set_fact:
mullvad_exe_dir: '/usr/bin'
when: ansible_pkg_mgr == "pacman"
- name: Workstation | Software | VPN | Mullvad | PATH | Install - name: Workstation | Software | VPN | Mullvad | PATH | Install
shell: "{{ item }}" shell: "{{ item }}"
loop: loop: