commit ed1aef98df7e4fdb132b3fd67fdaca1856a01f7a
parent b0385e63add233a8a66da556039b4a77c03807ec
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Sat, 5 Oct 2019 14:46:12 -0400
i3: config changes
Former-commit-id: 65e8f9a648d60c544fef8e786dc5a2f5a0071c93
Diffstat:
3 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/i3/config b/i3/config
@@ -5,10 +5,13 @@
exec --no-startup-id compton --config ~/.config/compton/config -b
exec --no-startup-id /usr/lib/gnome-settings-daemon/gsd-xsettings
exec --no-startup-id gnome-flashback
+exec --no-startup-id dropbox start
exec_always --no-startup-id ~/.scripts/feh-background
exec_always --no-startup-id ~/.config/polybar/polybar.sh &
exec_always --no-startup-id system76-power daemon
exec_always --no-startup-id xrandr --output LVDS-1-1 --off
+exec_always --no-startup-id /usr/bin/setxkbmap -option 'caps:ctrl_modifier'
+exec_always --no-startup-id /usr/bin/xcape -e 'Caps_Lock=Escape'
set $mod Mod4
@@ -214,7 +217,7 @@ mode "$mode_gaps_outer" {
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id /home/zeroalpha/.dotfiles/scripts/pactl-volume up
bindsym XF86AudioLowerVolume exec --no-startup-id /home/zeroalpha/.dotfiles/scripts/pactl-volume down
-bindsym XF86AudioMute exec --no-startup-id /usr/bin/pactl set-sink-mute 0 toggle
+bindsym XF86AudioMute exec --no-startup-id /home/zeroalpha/.dotfiles/scripts/pactl-volume mute
# Sreen brightness controls
bindsym XF86MonBrightnessUp exec --no-startup-id /home/zeroalpha/.dotfiles/scripts/xrandr-brightness up
diff --git a/scripts/feh-background b/scripts/feh-background
@@ -7,7 +7,7 @@ fi
theme=$(gsettings get org.gnome.Terminal.Legacy.Settings theme-variant | tr -d "'")
if [ "$theme" = "light" ]; then
- feh --bg-fill "/home/zeroalpha/Pictures/Backgrounds/light.jpg"
+ feh --bg-scale "/home/zeroalpha/Pictures/Backgrounds/light.jpg"
else
feh --bg-fill "/home/zeroalpha/Pictures/Backgrounds/dark.jpg"
fi
diff --git a/scripts/pactl-volume b/scripts/pactl-volume
@@ -1,19 +1,39 @@
-#!/bin/sh
-#/usr/bin/pactl set-sink-volume 0 +5%
-SINK=$( pactl list short sinks | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,' | head -n 1 )
-NOW=$( pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
+#!/usr/bin/env bash
+SINK=$(pactl list sinks short | tail -n 1 | grep -o '^[0-9]')
if [ "$1" = "up" ]; then
/usr/bin/pactl set-sink-mute "$SINK" 0
+ NOW=$( pactl list sinks | grep "^Sink #$SINK" -B 0 -A 999 | grep '^[[:space:]]Volume:' | tail -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
if [ $((NOW+5)) -le 100 ]; then
/usr/bin/pactl set-sink-volume "$SINK" "+5%"
else
/usr/bin/pactl set-sink-volume "$SINK" "100%"
fi
elif [ "$1" = "down" ]; then
+ NOW=$( pactl list sinks | grep "^Sink #$SINK" -B 0 -A 999 | grep '^[[:space:]]Volume:' | tail -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
if [ $((NOW-5)) -gt 0 ]; then
/usr/bin/pactl set-sink-volume "$SINK" "-5%"
else
/usr/bin/pactl set-sink-volume "$SINK" "0%"
/usr/bin/pactl set-sink-mute "$SINK" 1
fi
+elif [ "$1" = "mute" ]; then
+ /usr/bin/pactl set-sink-mute "$SINK" toggle
+elif [ "$1" = "now" ]; then
+ SINK_INFO=$(pactl list sinks | grep "^Sink #$SINK" -B 0 -A 999)
+ muted=$(echo "$SINK_INFO" | grep Mute | cut -d':' -f2 | tr -d ' ')
+ if [ -z "$(echo "$SINK_INFO" | grep RUNNING)" ]; then
+ NOW=$( echo "$SINK_INFO" | grep '^[[:space:]]Volume:' | tail -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
+ if [ "$muted" = "no" ]; then
+ echo "NO AUDIO ($NOW%)"
+ else
+ echo "NO AUDIO (MUTE)"
+ fi
+ elif [ "$muted" = "no" ]; then
+ NOW=$( echo "$SINK_INFO" | grep '^[[:space:]]Volume:' | tail -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
+ echo " $NOW"
+ else
+ echo " muted"
+ fi
+elif [ "$1" = "sink" ]; then
+ echo "$SINK"
fi