Add .config/sway/bin/brightness.sh

Add .config/sway/bin/i3blocks-battery
Add .config/sway/bin/toggletouchpad.sh
Add .config/sway/blocks.conf
Add .config/sway/config
Add .config/sway/wallpaper.jpg
This commit is contained in:
Felix Delattre 2023-11-02 18:52:44 +00:00
parent bad55fc285
commit ef9efc1fd2
6 changed files with 496 additions and 0 deletions

View file

@ -0,0 +1,15 @@
#!/bin/bash
case "$1" in
increase)
CURRENT=`cat /sys/class/backlight/intel_backlight/brightness`
((FOO=CURRENT+500))
exec echo $FOO | tee /sys/class/backlight/intel_backlight/brightness
;;
decrease)
CURRENT=`cat /sys/class/backlight/intel_backlight/brightness`
((FOO=CURRENT-500))
exec echo $FOO | tee /sys/class/backlight/intel_backlight/brightness
;;
esac
exit 0

View file

@ -0,0 +1,61 @@
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
my $acpi;
my $status;
my $percent;
my $full_text;
my $short_text;
my $bat_number = $ENV{BLOCK_INSTANCE} || 0;
# read the first line of the "acpi" command output
open (ACPI, "acpi -b | grep 'Battery $bat_number' |") or die;
$acpi = <ACPI>;
close(ACPI);
# fail on unexpected output
if ($acpi !~ /: (\w+), (\d+)%/) {
die "$acpi\n";
}
$status = $1;
$percent = $2;
$full_text = "";
if ($status eq 'Discharging') {
$full_text .= "⚡ $percent%";
if ($acpi =~ /(\d\d:\d\d):/) {
$full_text .= " ($1)";
}
} elsif ($status eq 'Charging') {
$full_text .= " $percent%";
}
elsif ($status eq 'Unknown' || $status eq 'Full') {
$full_text .= "⚡ $percent%";
}
# print text
print "$full_text\n";
print "$short_text\n";
# consider color and urgent flag only on discharge
if ($status eq 'Discharging') {
if ($percent < 20) {
print "#FF0000\n";
} elsif ($percent < 40) {
print "#FFAE00\n";
} elsif ($percent < 60) {
print "#FFF600\n";
} elsif ($percent < 85) {
print "#A8FF00\n";
}
if ($percent < 5) {
exit(33);
}
}
exit(0);

View file

@ -0,0 +1,5 @@
if synclient -l | grep "TouchpadOff .*=.*0" ; then
synclient TouchpadOff=1 ;
else
synclient TouchpadOff=0 ;
fi