commit
36a6cd0fbb
8 changed files with 329 additions and 0 deletions
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh |
||||
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info> |
||||
|
||||
# This program is free software: you can redistribute it and/or modify |
||||
# 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, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# 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 |
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
DIR="${BLOCK_INSTANCE:-$HOME}" |
||||
ALERT_LOW="${1:-10}" # color will turn red under this value (default: 10%) |
||||
|
||||
df -h -P -l "$DIR" | awk -v alert_low=$ALERT_LOW ' |
||||
/\/.*/ { |
||||
# full text |
||||
print $4 |
||||
# short text |
||||
print $4 |
||||
use=$5 |
||||
# no need to continue parsing |
||||
exit 0 |
||||
} |
||||
END { |
||||
gsub(/%$/,"",use) |
||||
if (100 - use < alert_low) { |
||||
# color |
||||
print "#FF0000" |
||||
} |
||||
} |
||||
' |
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash |
||||
while [ "$select" != "NO" -a "$select" != "YES" ]; do |
||||
select=$(echo -e 'NO\nYES' | dmenu -nb '#2f343f' -nf '#f3f4f5' -sb '#9575cd' -sf '#f3f4f5' -fn '-*-*-medium-r-normal-*-*-*-*-*-*-100-*-*' -i -p "Are you sure you want to logout?") |
||||
[ -z "$select" ] && exit 0 |
||||
done |
||||
[ "$select" = "NO" ] && exit 0 |
||||
i3-msg exit |
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh |
||||
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info> |
||||
|
||||
# This program is free software: you can redistribute it and/or modify |
||||
# 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, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# 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 |
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
load="$(cut -d ' ' -f1 /proc/loadavg)" |
||||
cpus="$(nproc)" |
||||
|
||||
# full text |
||||
echo "$load" |
||||
|
||||
# short text |
||||
echo "$load" |
||||
|
||||
# color if load is too high |
||||
awk -v cpus=$cpus -v cpuload=$load ' |
||||
BEGIN { |
||||
if (cpus <= cpuload) { |
||||
print "#FF0000"; |
||||
exit 33; |
||||
} |
||||
} |
||||
' |
@ -0,0 +1,46 @@
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env perl |
||||
|
||||
## The sink we are interested in should be given as the |
||||
## 1st argument to the script. |
||||
my $sink=$ARGV[0] || die("Need a sink number as the first argument\n"); |
||||
|
||||
## If the script has been run with a second argument, |
||||
## that argument will be the volume threshold we are checking |
||||
my $volume_limit=$ARGV[1]||undef; |
||||
|
||||
## Run the pactl command and save the output in |
||||
## ther filehandle $fh |
||||
open(my $fh, '-|', 'pactl list sinks'); |
||||
|
||||
## Set the record separator to consecutive newlines (same as -000) |
||||
## this means we read the info for each sink as a single "line". |
||||
$/="\n\n"; |
||||
|
||||
## Go through the pactl output |
||||
while (<$fh>) { |
||||
## If this is the sink we are interested in |
||||
if (/#$sink/) { |
||||
## Extract the current colume of this sink |
||||
/Volume:.*?(\d+)%/; |
||||
my $volume=$1; |
||||
## If the script has been run with a second argument, |
||||
## check whether the volume is above or below that |
||||
if ($volume_limit) { |
||||
## If the volume os greater than or equal to the |
||||
## value passed, print "y" |
||||
if ($volume >= $volume_limit) { |
||||
print "y\n"; |
||||
exit 0; |
||||
} |
||||
else { |
||||
print "n\n"; |
||||
exit 1; |
||||
} |
||||
} |
||||
## Else, if the script has been run with just one argument, |
||||
## print the current volume. |
||||
else { |
||||
print "$volume%\n"; |
||||
} |
||||
}# |
||||
} |
@ -0,0 +1,56 @@
@@ -0,0 +1,56 @@
|
||||
! c o l o r s |
||||
URxvt*color0: #101218 |
||||
URxvt*color1: #ee829f |
||||
URxvt*color2: #a5ffe1 |
||||
URxvt*color3: #ffefcc |
||||
URxvt*color4: #97bbf7 |
||||
URxvt*color5: #c0b7f9 |
||||
URxvt*color6: #97e0ff |
||||
URxvt*color7: #d1d4e0 |
||||
URxvt*color8: #7780a1 |
||||
URxvt*color9: #ee829f |
||||
URxvt*color10: #a5ffe1 |
||||
URxvt*color11: #ffefcc |
||||
URxvt*color12: #97bbf7 |
||||
URxvt*color13: #c0b7f9 |
||||
URxvt*color14: #97e0ff |
||||
URxvt*color15: #ffffff |
||||
URxvt*color16: #f99170 |
||||
URxvt*color17: #fcc09e |
||||
URxvt*color18: #1f222d |
||||
URxvt*color19: #252936 |
||||
URxvt*color20: #C0C5CE |
||||
URxvt*color21: #C9CCDB |
||||
URxvt*background: #101218 |
||||
URxvt*foreground: #E6EFF7 |
||||
URxvt*cursorColor: #E6EFF7 |
||||
|
||||
|
||||
! bg fg (b) bgalt hlbg hlfg |
||||
rofi.color-normal: #2f343f, #f3f4f5, #2f343f, #757575, #f3f4f5 |
||||
rofi.color-window: #2f343f, #2f343f |
||||
|
||||
! f o n t s |
||||
|
||||
URxvt.font: xft:Tamsyn:pixelsize=14 |
||||
URxvt.boldFont: xft:Tamsyn:pixelsize=14:bold |
||||
URxvt.italicFont: xft:Tamsyn:pixelsize=14:italic |
||||
URxvt.boldItalicFont: xft:Tamsyn:pixelsize=14:bold:italic |
||||
URxvt.letterSpace: -1.5 |
||||
|
||||
! i n t e r f a c e |
||||
URxvt.internalBorder: 5 |
||||
URxvt.externalBorder: 0 |
||||
|
||||
URxvt.scrollBar: false |
||||
|
||||
URxvt*fading: 30 |
||||
|
||||
|
||||
|
||||
! e x t e n s i o n s |
||||
URxvt.perl-ext-common: matcher |
||||
|
||||
URxvt.url-launcher: /usr/bin/qutebrowser |
||||
URxvt.keysym.M-Delete: perl:matcher:list |
||||
URxvt.colorUL: #7780a1 |
Loading…
Reference in new issue