mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
Merge remote-tracking branch 'origin/master' into surface
This commit is contained in:
commit
d52ece0b12
@ -29,7 +29,7 @@ alpha-step = 0.06; # XRender backend: Step size for alpha pictures. Increasin
|
|||||||
#inactive-dim-fixed = true; # Do not let dimness adjust based on window opacity.
|
#inactive-dim-fixed = true; # Do not let dimness adjust based on window opacity.
|
||||||
inactive-opacity-exclude = [ "window_type = 'dock'", "window_type = 'desktop'" ];
|
inactive-opacity-exclude = [ "window_type = 'dock'", "window_type = 'desktop'" ];
|
||||||
blur-background = true; # Blur background of transparent windows.
|
blur-background = true; # Blur background of transparent windows.
|
||||||
blur-background-exclude = [ "class_g = 'Peek'", "class_g = 'Onboard'" ];
|
blur-background-exclude = [ "class_g = 'Peek'", "class_g = 'Onboard'", "class_g = 'slop'" ];
|
||||||
blur-background-frame = false; # Blur background of opaque windows with transparent
|
blur-background-frame = false; # Blur background of opaque windows with transparent
|
||||||
# frames as well.
|
# frames as well.
|
||||||
blur-background-fixed = true; # Do not let blur radius adjust based on window opacity.
|
blur-background-fixed = true; # Do not let blur radius adjust based on window opacity.
|
||||||
|
@ -1 +1,2 @@
|
|||||||
.idea/
|
.idea/
|
||||||
|
cmake-build-*/
|
||||||
|
@ -41,8 +41,7 @@ separator_block_width=12
|
|||||||
#interval=persist
|
#interval=persist
|
||||||
|
|
||||||
[volume]
|
[volume]
|
||||||
instance=Master
|
interval=persist
|
||||||
interval=10
|
|
||||||
signal=10
|
signal=10
|
||||||
|
|
||||||
[separator]
|
[separator]
|
||||||
@ -63,7 +62,7 @@ signal=5
|
|||||||
|
|
||||||
[cpu_usage]
|
[cpu_usage]
|
||||||
label=
|
label=
|
||||||
interval=5
|
interval=persist
|
||||||
|
|
||||||
[separator]
|
[separator]
|
||||||
|
|
||||||
|
@ -1,53 +1,31 @@
|
|||||||
#!/usr/bin/perl
|
#!/bin/bash
|
||||||
#
|
# by Paul Colby (http://colby.id.au), no rights reserved ;)
|
||||||
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
|
# https://github.com/Leo-G/DevopsWiki/wiki/How-Linux-CPU-Usage-Time-and-Percentage-is-calculated
|
||||||
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
|
|
||||||
# Copyright 2014 Andreas Guldstrand <andreas.guldstrand@gmail.com>
|
|
||||||
#
|
|
||||||
# Licensed under the terms of the GNU GPL v3, or any later version.
|
|
||||||
|
|
||||||
use strict;
|
PREV_TOTAL=0
|
||||||
use warnings;
|
PREV_IDLE=0
|
||||||
use utf8;
|
|
||||||
use Getopt::Long;
|
|
||||||
|
|
||||||
# default values
|
while true; do
|
||||||
my $t_warn = 50;
|
# Get the total CPU statistics, discarding the 'cpu ' prefix.
|
||||||
my $t_crit = 80;
|
CPU=(`sed -n 's/^cpu\s//p' /proc/stat`)
|
||||||
my $cpu_usage = -1;
|
IDLE=${CPU[3]} # Just the idle CPU time.
|
||||||
|
|
||||||
sub help {
|
# Calculate the total CPU time.
|
||||||
print "Usage: cpu_usage [-w <warning>] [-c <critical>]\n";
|
TOTAL=0
|
||||||
print "-w <percent>: warning threshold to become yellow\n";
|
for VALUE in "${CPU[@]}"; do
|
||||||
print "-c <percent>: critical threshold to become red\n";
|
let "TOTAL=$TOTAL+$VALUE"
|
||||||
exit 0;
|
done
|
||||||
}
|
|
||||||
|
|
||||||
GetOptions("help|h" => \&help,
|
# Calculate the CPU usage since we last checked.
|
||||||
"w=i" => \$t_warn,
|
let "DIFF_IDLE=$IDLE-$PREV_IDLE"
|
||||||
"c=i" => \$t_crit);
|
let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL"
|
||||||
|
let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10"
|
||||||
|
echo -e "$DIFF_USAGE%\n$DIFF_USAGE%"
|
||||||
|
|
||||||
# Get CPU usage
|
# Remember the total and idle CPU times for the next check.
|
||||||
$ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is
|
PREV_TOTAL="$TOTAL"
|
||||||
open (MPSTAT, 'mpstat 1 1 |') or die 'Cannot run mpstat';
|
PREV_IDLE="$IDLE"
|
||||||
while (<MPSTAT>) {
|
|
||||||
if (/^.*\s+(\d+\.\d+)\s+$/) {
|
|
||||||
$cpu_usage = 100 - $1; # 100% - %idle
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close(MPSTAT);
|
|
||||||
|
|
||||||
#$cpu_usage eq -1 and die 'Can\'t find CPU information';
|
# Wait before checking again.
|
||||||
|
sleep 1
|
||||||
# Print short_text, full_text
|
done
|
||||||
printf "%.0f%%\n"x2, $cpu_usage;
|
|
||||||
|
|
||||||
# Print color, if needed
|
|
||||||
if ($cpu_usage >= $t_crit) {
|
|
||||||
print "#FF0000\n";
|
|
||||||
} elsif ($cpu_usage >= $t_warn) {
|
|
||||||
print "#FFCB00\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
@ -1,93 +1,182 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
|
# Displays the default device, volume, and mute status for i3blocks
|
||||||
# Copyright (C) 2014 Alexander Keller <github@nycroth.com>
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
AUDIO_HIGH_SYMBOL=' '
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
AUDIO_MED_THRESH=59
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
AUDIO_MED_SYMBOL=' '
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
AUDIO_LOW_THRESH=0
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
AUDIO_LOW_SYMBOL=' '
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
AUDIO_MUTED_SYMBOL='X'
|
||||||
|
|
||||||
# The second parameter overrides the mixer selection
|
AUDIO_INTERVAL=5
|
||||||
# For PulseAudio users, use "pulse"
|
|
||||||
# For Jack/Jack2 users, use "jackplug"
|
|
||||||
# For ALSA users, you may use "default" for your primary card
|
|
||||||
# or you may use hw:# where # is the number of the card desired
|
|
||||||
MIXER="default"
|
|
||||||
[ -n "$(lsmod | grep pulse)" ] && MIXER="pulse"
|
|
||||||
[ -n "$(lsmod | grep jack)" ] && MIXER="jackplug"
|
|
||||||
MIXER="${2:-$MIXER}"
|
|
||||||
|
|
||||||
# The instance option sets the control to report and configure
|
DEFAULT_COLOR="#ffffff"
|
||||||
# This defaults to the first control of your selected mixer
|
MUTED_COLOR="#a0a0a0"
|
||||||
# For a list of the available, use `amixer -D $Your_Mixer scontrols`
|
|
||||||
SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols |
|
|
||||||
sed -n "s/Simple mixer control '\([A-Za-z ]*\)',0/\1/p" |
|
|
||||||
head -n1
|
|
||||||
)}"
|
|
||||||
|
|
||||||
# The first parameter sets the step to change the volume by (and units to display)
|
LONG_FORMAT=0
|
||||||
# This may be in in % or dB (eg. 5% or 3dB)
|
SHORT_FORMAT=3
|
||||||
STEP="${1:-2%}"
|
USE_PERCENT=0
|
||||||
|
USE_ALSA_NAME=0
|
||||||
|
USE_DESCRIPTION=0
|
||||||
|
|
||||||
|
SUBSCRIBE=1
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
while getopts F:Sf:padH:M:L:X:T:t:C:c:i:m:s:h opt; do
|
||||||
|
case "$opt" in
|
||||||
|
S) SUBSCRIBE=1 ;;
|
||||||
|
F) LONG_FORMAT="$OPTARG" ;;
|
||||||
|
f) SHORT_FORMAT="$OPTARG" ;;
|
||||||
|
p) USE_PERCENT=0 ;;
|
||||||
|
a) USE_ALSA_NAME=1 ;;
|
||||||
|
d) USE_DESCRIPTION=1 ;;
|
||||||
|
H) AUDIO_HIGH_SYMBOL="$OPTARG" ;;
|
||||||
|
M) AUDIO_MED_SYMBOL="$OPTARG" ;;
|
||||||
|
L) AUDIO_LOW_SYMBOL="$OPTARG" ;;
|
||||||
|
X) AUDIO_MUTED_SYMBOL="$OPTARG" ;;
|
||||||
|
T) AUDIO_MED_THRESH="$OPTARG" ;;
|
||||||
|
t) AUDIO_LOW_THRESH="$OPTARG" ;;
|
||||||
|
C) DEFAULT_COLOR="$OPTARG" ;;
|
||||||
|
c) MUTED_COLOR="$OPTARG" ;;
|
||||||
|
i) AUDIO_INTERVAL="$OPTARG" ;;
|
||||||
|
m) MIXER="$OPTARG" ;;
|
||||||
|
s) SCONTROL="$OPTARG" ;;
|
||||||
|
h) printf \
|
||||||
|
"Usage: volume-pulseaudio [-S] [-F format] [-f format] [-p] [-a|-d] [-H symb] [-M symb]
|
||||||
|
[-L symb] [-X symb] [-T thresh] [-t thresh] [-C color] [-c color] [-i inter]
|
||||||
|
[-m mixer] [-s scontrol] [-h]
|
||||||
|
Options:
|
||||||
|
-F, -f\tOutput format (-F long format, -f short format) to use, amongst:
|
||||||
|
\t0\t symb vol [index:name]\t (default long)
|
||||||
|
\t1\t symb vol [name]
|
||||||
|
\t2\t symb vol [index]\t (default short)
|
||||||
|
\t3\t symb vol
|
||||||
|
-S\tSubscribe to volume events (requires persistent block, always uses long format)
|
||||||
|
-p\tOmit the percent sign (%%) in volume
|
||||||
|
-a\tUse ALSA name if possible
|
||||||
|
-d\tUse device description instead of name if possible
|
||||||
|
-H\tSymbol to use when audio level is high. Default: '$AUDIO_HIGH_SYMBOL'
|
||||||
|
-M\tSymbol to use when audio level is medium. Default: '$AUDIO_MED_SYMBOL'
|
||||||
|
-L\tSymbol to use when audio level is low. Default: '$AUDIO_LOW_SYMBOL'
|
||||||
|
-X\tSymbol to use when audio is muted. Default: '$AUDIO_MUTED_SYMBOL'
|
||||||
|
-T\tThreshold for medium audio level. Default: $AUDIO_MED_THRESH
|
||||||
|
-t\tThreshold for low audio level. Default: $AUDIO_LOW_THRESH
|
||||||
|
-C\tColor for non-muted audio. Default: $DEFAULT_COLOR
|
||||||
|
-c\tColor for muted audio. Default: $MUTED_COLOR
|
||||||
|
-i\tInterval size of volume increase/decrease. Default: $AUDIO_INTERVAL
|
||||||
|
-m\tUse the given mixer.
|
||||||
|
-s\tUse the given scontrol.
|
||||||
|
-h\tShow this help text
|
||||||
|
" && exit 0;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
capability() { # Return "Capture" if the device is a capture device
|
if [[ -z "$MIXER" ]] ; then
|
||||||
amixer -D $MIXER get $SCONTROL |
|
MIXER="default"
|
||||||
sed -n "s/ Capabilities:.*cvolume.*/Capture/p"
|
if amixer -D pulse info >/dev/null 2>&1 ; then
|
||||||
}
|
MIXER="pulse"
|
||||||
|
fi
|
||||||
volume() {
|
|
||||||
amixer -D $MIXER get $SCONTROL $(capability)
|
|
||||||
}
|
|
||||||
|
|
||||||
format() {
|
|
||||||
perl_filter='if (/.*\[(\d+)%\] (\[(-?\d+.\d+)dB\] )?\[(on|off)\]/)'
|
|
||||||
perl_filter+='{CORE::say $4 eq "off" ? "-1" : "'
|
|
||||||
perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1')
|
|
||||||
perl_filter+='"; exit}'
|
|
||||||
perl -ne "$perl_filter"
|
|
||||||
}
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) pavucontrol &>/dev/null &;;
|
|
||||||
2) ~/.config/i3/cycleaudio.py;;
|
|
||||||
3) amixer -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute
|
|
||||||
4) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase
|
|
||||||
5) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease
|
|
||||||
esac
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
|
|
||||||
VOL=$(volume | format)
|
|
||||||
|
|
||||||
ACTIVE=$(pacmd list-sinks | grep '* index' | awk -F": " '{print $2}')
|
|
||||||
|
|
||||||
if pactl list short sinks | grep -q \^$ACTIVE".*Yeti"; then
|
|
||||||
printf ""
|
|
||||||
elif pactl list short sinks | grep -q \^$ACTIVE".*bluez"; then
|
|
||||||
printf " "
|
|
||||||
elif [ "$VOL" -eq -1 ]; then
|
|
||||||
printf "X"
|
|
||||||
exit 0
|
|
||||||
elif [ "$VOL" -eq 0 ]; then
|
|
||||||
printf ""
|
|
||||||
elif [ "$VOL" -gt 59 ]; then
|
|
||||||
printf ""
|
|
||||||
else
|
|
||||||
printf ""
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf " $VOL"
|
if [[ -z "$SCONTROL" ]] ; then
|
||||||
|
SCONTROL=$(amixer -D "$MIXER" scontrols | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | head -n1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
CAPABILITY=$(amixer -D $MIXER get $SCONTROL | sed -n "s/ Capabilities:.*cvolume.*/Capture/p")
|
||||||
|
|
||||||
|
|
||||||
|
function move_sinks_to_new_default {
|
||||||
|
DEFAULT_SINK=$1
|
||||||
|
pacmd list-sink-inputs | grep index: | grep -o '[0-9]\+' | while read SINK
|
||||||
|
do
|
||||||
|
pacmd move-sink-input $SINK $DEFAULT_SINK
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_default_playback_device_next {
|
||||||
|
inc=${1:-1}
|
||||||
|
num_devices=$(pacmd list-sinks | grep -c index:)
|
||||||
|
sink_arr=($(pacmd list-sinks | grep index: | grep -o '[0-9]\+'))
|
||||||
|
default_sink_index=$(( $(pacmd list-sinks | grep index: | grep -no '*' | grep -o '^[0-9]\+') - 1 ))
|
||||||
|
default_sink_index=$(( ($default_sink_index + $num_devices + $inc) % $num_devices ))
|
||||||
|
default_sink=${sink_arr[$default_sink_index]}
|
||||||
|
pacmd set-default-sink $default_sink
|
||||||
|
move_sinks_to_new_default $default_sink
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$BLOCK_BUTTON" in
|
||||||
|
1) set_default_playback_device_next ;;
|
||||||
|
2) amixer -q -D $MIXER sset $SCONTROL $CAPABILITY toggle ;;
|
||||||
|
3) set_default_playback_device_next -1 ;;
|
||||||
|
4) amixer -q -D $MIXER sset $SCONTROL $CAPABILITY $AUDIO_INTERVAL%+ ;;
|
||||||
|
5) amixer -q -D $MIXER sset $SCONTROL $CAPABILITY $AUDIO_INTERVAL%- ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
function print_format {
|
||||||
|
PERCENT="%"
|
||||||
|
[[ $USE_PERCENT == 0 ]] && PERCENT=""
|
||||||
|
case "$1" in
|
||||||
|
1) echo "$SYMBOL$VOL$PERCENT [$NAME]" ;;
|
||||||
|
2) echo "$SYMBOL$VOL$PERCENT [$INDEX]";;
|
||||||
|
3) echo "$SYMBOL$VOL$PERCENT" ;;
|
||||||
|
*) echo "$SYMBOL$VOL$PERCENT [$INDEX:$NAME]" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
function print_block {
|
||||||
|
for name in INDEX NAME VOL MUTED; do
|
||||||
|
read $name
|
||||||
|
done < <(pacmd list-sinks | grep "index:\|name:\|volume: front\|muted:" | grep -A3 '*')
|
||||||
|
INDEX=$(echo "$INDEX" | grep -o '[0-9]\+')
|
||||||
|
VOL=$(echo "$VOL" | grep -o "[0-9]*%" | head -1 )
|
||||||
|
VOL="${VOL%?}"
|
||||||
|
|
||||||
|
NAME=$(echo "$NAME" | sed \
|
||||||
|
's/.*<.*\.\(.*\)>.*/\1/; t;'\
|
||||||
|
's/.*<\(.*\)>.*/\1/; t;'\
|
||||||
|
's/.*/unknown/')
|
||||||
|
|
||||||
|
if [[ $USE_ALSA_NAME == 1 ]] ; then
|
||||||
|
ALSA_NAME=$(pacmd list-sinks |\
|
||||||
|
awk '/^\s*\*/{f=1}/^\s*index:/{f=0}f' |\
|
||||||
|
grep "alsa.name\|alsa.mixer_name" |\
|
||||||
|
head -n1 |\
|
||||||
|
sed 's/.*= "\(.*\)".*/\1/')
|
||||||
|
NAME=${ALSA_NAME:-$NAME}
|
||||||
|
elif [[ $USE_DESCRIPTION == 1 ]] ; then
|
||||||
|
DESCRIPTION=$(pacmd list-sinks |\
|
||||||
|
awk '/^\s*\*/{f=1}/^\s*index:/{f=0}f' |\
|
||||||
|
grep "device.description" |\
|
||||||
|
head -n1 |\
|
||||||
|
sed 's/.*= "\(.*\)".*/\1/')
|
||||||
|
NAME=${DESCRIPTION:-$NAME}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $MUTED =~ "no" ]] ; then
|
||||||
|
SYMBOL=$AUDIO_HIGH_SYMBOL
|
||||||
|
[[ $VOL -le $AUDIO_MED_THRESH ]] && SYMBOL=$AUDIO_MED_SYMBOL
|
||||||
|
[[ $VOL -le $AUDIO_LOW_THRESH ]] && SYMBOL=$AUDIO_LOW_SYMBOL
|
||||||
|
COLOR=$DEFAULT_COLOR
|
||||||
|
else
|
||||||
|
SYMBOL=$AUDIO_MUTED_SYMBOL
|
||||||
|
COLOR=$MUTED_COLOR
|
||||||
|
VOL=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if [[ $SUBSCRIBE == 1 ]] ; then
|
||||||
|
# print_format "$LONG_FORMAT"
|
||||||
|
# else
|
||||||
|
# print_format "$LONG_FORMAT"
|
||||||
|
print_format "$SHORT_FORMAT"
|
||||||
|
# echo "$COLOR"
|
||||||
|
# fi
|
||||||
|
}
|
||||||
|
|
||||||
|
print_block
|
||||||
|
if [[ $SUBSCRIBE == 1 ]] ; then
|
||||||
|
while read -r EVENT; do
|
||||||
|
print_block
|
||||||
|
done < <(pactl subscribe | stdbuf -oL grep change)
|
||||||
|
fi
|
||||||
|
@ -151,7 +151,7 @@ bindsym $mod+space exec "pkill rofi; rofi -show run -sidebar-mode -terminal i3
|
|||||||
bindsym --release Print exec imgur-screenshot
|
bindsym --release Print exec imgur-screenshot
|
||||||
bindsym --release $mod+Print exec imgur-screenshot -f
|
bindsym --release $mod+Print exec imgur-screenshot -f
|
||||||
bindsym $mod+Mod1+space exec --no-startup-id ~/.config/i3/cycleaudio.py && pkill -RTMIN+10 i3blocks
|
bindsym $mod+Mod1+space exec --no-startup-id ~/.config/i3/cycleaudio.py && pkill -RTMIN+10 i3blocks
|
||||||
bindsym $mod+numbersign exec notify-send "$(xclip -o | gpg --decrypt 2>&1)"
|
bindsym $mod+numbersign exec "termite -e 'sh -c xclip\ -o\ |\ gpg\ --decrypt\ 2>&1\ &&\ read'"
|
||||||
bindsym $mod+g exec "LINK=$(gist -PRpc); notify-send -c transfer \\"<a href=\\\\"$LINK\\\\">$LINK</a>\\""
|
bindsym $mod+g exec "LINK=$(gist -PRpc); notify-send -c transfer \\"<a href=\\\\"$LINK\\\\">$LINK</a>\\""
|
||||||
|
|
||||||
# Media player controls
|
# Media player controls
|
||||||
@ -160,12 +160,12 @@ bindsym XF86AudioPause exec --no-startup-id mpc pause
|
|||||||
bindsym XF86AudioStop exec --no-startup-id mpc stop
|
bindsym XF86AudioStop exec --no-startup-id mpc stop
|
||||||
bindsym XF86AudioNext exec --no-startup-id mpc next
|
bindsym XF86AudioNext exec --no-startup-id mpc next
|
||||||
bindsym XF86AudioPrev exec --no-startup-id mpc previous
|
bindsym XF86AudioPrev exec --no-startup-id mpc previous
|
||||||
|
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +1000
|
||||||
|
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -1000
|
||||||
|
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||||
bindsym XF86MonBrightnessUp exec xbacklight -inc 5 && pkill -RTMIN+12 i3blocks
|
bindsym XF86MonBrightnessUp exec xbacklight -inc 5 && pkill -RTMIN+12 i3blocks
|
||||||
bindsym XF86MonBrightnessDown exec xbacklight -dec 5 && pkill -RTMIN+12 i3blocks
|
bindsym XF86MonBrightnessDown exec xbacklight -dec 5 && pkill -RTMIN+12 i3blocks
|
||||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +2% && pkill -RTMIN+10 i3blocks
|
exec --no-startup-id "ip monitor | while read; do pkill -RTMIN+15 i3blocks; done"
|
||||||
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -2% && pkill -RTMIN+10 i3blocks
|
|
||||||
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && pkill -RTMIN+10 i3blocks
|
|
||||||
exec --no-startup-id "ip monitor | while read line; do pkill -RTMIN+15 i3blocks; done"
|
|
||||||
|
|
||||||
# app launch shortcuts
|
# app launch shortcuts
|
||||||
exec --no-startup-id ~/.fehbg
|
exec --no-startup-id ~/.fehbg
|
||||||
|
@ -5,9 +5,6 @@ tmpbg='/tmp/screen.png'
|
|||||||
|
|
||||||
(( $# )) && { icon=$1; }
|
(( $# )) && { icon=$1; }
|
||||||
|
|
||||||
# screenshot
|
|
||||||
scrot "$tmpbg"
|
|
||||||
|
|
||||||
PX=0
|
PX=0
|
||||||
PY=0
|
PY=0
|
||||||
# lockscreen image info
|
# lockscreen image info
|
||||||
@ -25,17 +22,19 @@ SROY=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 3) # y offset
|
|||||||
PX=$(($SROX + $SRX/2 - $RX/2))
|
PX=$(($SROX + $SRX/2 - $RX/2))
|
||||||
PY=$(($SROY + $SRY/2 - $RY/2))
|
PY=$(($SROY + $SRY/2 - $RY/2))
|
||||||
|
|
||||||
|
# screenshot, pixelise and overlay
|
||||||
|
maim | convert - -scale 5% -scale 2000% $icon -geometry +$PX+$PY -composite -matte $tmpbg
|
||||||
|
|
||||||
# pixelize and add lock icon
|
if command mpc 2>&1 1>/dev/null; then
|
||||||
convert $tmpbg -scale 5% -scale 2000% $tmpbg
|
playing=$(mpc status | grep playing | wc -l)
|
||||||
convert $tmpbg $icon -geometry +$PX+$PY -composite -matte $tmpbg
|
[[ $playing == 1 ]] && mpc pause
|
||||||
|
fi
|
||||||
playing=$(mpc status | grep playing | wc -l)
|
|
||||||
[[ $playing == 1 ]] && mpc pause
|
|
||||||
|
|
||||||
i3lock -i "$tmpbg" -n -e
|
i3lock -i "$tmpbg" -n -e
|
||||||
|
|
||||||
[[ $playing == 1 ]] && mpc play
|
if command mpc 2>&1 1>/dev/null; then
|
||||||
|
[[ $playing == 1 ]] && mpc play
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
rm "$tmpbg"
|
rm "$tmpbg"
|
||||||
|
@ -4,10 +4,10 @@ imgur_secret=""
|
|||||||
login="false"
|
login="false"
|
||||||
log_file="$HOME/.config/imgur-screenshot/imgur-screenshot.log"
|
log_file="$HOME/.config/imgur-screenshot/imgur-screenshot.log"
|
||||||
credentials_file="$HOME/.config/imgur-screenshot/credentials.conf"
|
credentials_file="$HOME/.config/imgur-screenshot/credentials.conf"
|
||||||
file_name_format="scrot-%Y-%m-%d--%H:%M:%S.png" # when using scrot, must end with .png!
|
file_name_format="screenshot-%Y-%m-%d-%H%M%S.png" # when using scrot, must end with .png!
|
||||||
file_dir="$HOME/pictures/screenshots"
|
file_dir="$HOME/pictures/screenshots"
|
||||||
screenshot_select_command="scrot -q 0 -s %img"
|
screenshot_select_command="maim -m 10 -us %img"
|
||||||
screenshot_window_command="scrot -q 0 -b %img"
|
screenshot_window_command="maim -m 10 -uw %img"
|
||||||
edit_command="gimp %img"
|
edit_command="gimp %img"
|
||||||
edit="false"
|
edit="false"
|
||||||
exit_on_selection_fail="true"
|
exit_on_selection_fail="true"
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# thumb wheel up => increase volume and unmute
|
# thumb wheel up => increase volume and unmute
|
||||||
"amixer -D pulse set Master 1000+ unmute ; pkill -RTMIN+10 i3blocks"
|
"xdotool key --clearmodifiers XF86AudioRaiseVolume"
|
||||||
b:6
|
b:6
|
||||||
|
|
||||||
# thumb wheel down => lower volume
|
# thumb wheel down => lower volume
|
||||||
"amixer -D pulse set Master 1000- ; pkill -RTMIN+10 i3blocks"
|
"xdotool key --clearmodifiers XF86AudioLowerVolume"
|
||||||
b:7
|
b:7
|
||||||
|
|
||||||
# backward button => previous song
|
# backward button => previous song
|
||||||
|
15
aliases
15
aliases
@ -11,16 +11,15 @@ alias ..ll="cd..;ll"
|
|||||||
alias ..l="..ll"
|
alias ..l="..ll"
|
||||||
|
|
||||||
alias l=ll
|
alias l=ll
|
||||||
alias ll="ls -lFh"
|
alias ll="ls -lFh --group-directories-first"
|
||||||
alias la="ls -lAFh"
|
alias la="ls -lAFh --group-directories-first"
|
||||||
alias lat='la -t'
|
alias lt='ls -lAFh --sort=time'
|
||||||
alias al=la # No, I don't need the Mono Assembly Linker
|
alias al=la # No, I don't need the Mono Assembly Linker
|
||||||
|
|
||||||
alias md="mkdir -p"
|
alias md="mkdir -p"
|
||||||
alias rd="rmdir -p"
|
alias rd="rmdir -p"
|
||||||
mcd(){
|
mcd(){ mkdir -p $@ && cd $@; }
|
||||||
mkdir -p $1 && cd $1
|
alias -- -='cd -'
|
||||||
}
|
|
||||||
alias cdt='cd `mktemp -d`'
|
alias cdt='cd `mktemp -d`'
|
||||||
alias grep='grep --color'
|
alias grep='grep --color'
|
||||||
alias -g H='| head'
|
alias -g H='| head'
|
||||||
@ -53,6 +52,7 @@ alias cp='cp -ir'
|
|||||||
alias pacman='pacman --color=always'
|
alias pacman='pacman --color=always'
|
||||||
alias pacaur='pacaur --color=always'
|
alias pacaur='pacaur --color=always'
|
||||||
alias tree='tree --dirsfirst -C -F'
|
alias tree='tree --dirsfirst -C -F'
|
||||||
|
alias make="make -j$(nproc)"
|
||||||
alias dd='dd status=progress'
|
alias dd='dd status=progress'
|
||||||
alias env='env | sort'
|
alias env='env | sort'
|
||||||
alias ssh="ssh -tt"
|
alias ssh="ssh -tt"
|
||||||
@ -132,6 +132,7 @@ gd() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
alias gds="git diff --staged --color-words"
|
alias gds="git diff --staged --color-words"
|
||||||
|
alias gsh="git show --color-words"
|
||||||
alias glg="git log --stat --color"
|
alias glg="git log --stat --color"
|
||||||
alias glog="git log --oneline --decorate --color --graph"
|
alias glog="git log --oneline --decorate --color --graph"
|
||||||
|
|
||||||
@ -148,7 +149,7 @@ alias grro="grr origin"
|
|||||||
|
|
||||||
alias gsta='git stash'
|
alias gsta='git stash'
|
||||||
alias gstd='gsta drop'
|
alias gstd='gsta drop'
|
||||||
alias gstl='gsta list'
|
alias gstl='gsta list --stat --color'
|
||||||
alias gstp='gsta pop'
|
alias gstp='gsta pop'
|
||||||
alias gstv="gsta show -p stash@{0}"
|
alias gstv="gsta show -p stash@{0}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user