mirror of
https://github.com/Rushilwiz/rice.git
synced 2025-04-09 14:50:17 -04:00
Compare commits
4 Commits
35f17f7b60
...
7ed93c1f84
Author | SHA1 | Date | |
---|---|---|---|
7ed93c1f84 | |||
7e759a36a8 | |||
10ee0e8892 | |||
32bff66354 |
|
@ -372,7 +372,7 @@ for_window [class=Spotify] focus
|
|||
# For modifications, it can be copied to ~/.config/picom/picom.conf or ~/.config/picom.conf
|
||||
# install picom package (yay -S picom)
|
||||
# start using default config
|
||||
exec_always --no-startup-id picom -b -f --inactive-opacity=0.75
|
||||
exec_always --no-startup-id picom --config ~/.config/picom.conf
|
||||
|
||||
set $i3l autosplit to workspace $ws1
|
||||
set $i3l autosplit to workspace $ws2
|
||||
|
@ -423,7 +423,7 @@ exec --no-startup-id ~/.screenlayout/monitor.sh
|
|||
|
||||
# set wallpaper
|
||||
#exec --no-startup-id sleep 2 && nitrogen --restore
|
||||
exec --no-startup-id ~/.config/i3/scripts/background-randomize ~/.config/i3/background/india 600
|
||||
exec_always --no-startup-id ~/.config/i3/scripts/run-background-randomize
|
||||
|
||||
# set powersavings for display:
|
||||
exec --no-startup-id xset s 480 dpms 600 600 600
|
||||
|
|
17
i3/scripts/background-randomize
Executable file
17
i3/scripts/background-randomize
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Unique identifier for this script
|
||||
script_name=$(basename "$0")
|
||||
|
||||
# Check if the script is already running, excluding the current instance and any text editor sessions
|
||||
if pgrep -f "$script_name" | grep -qv "$$"; then
|
||||
echo "An instance of $script_name is already running."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Continuously set a random background image
|
||||
while true; do
|
||||
feh --randomize --bg-fill "$1"/*
|
||||
sleep "$2"
|
||||
done
|
||||
|
113
i3/scripts/bandwidth
Normal file
113
i3/scripts/bandwidth
Normal file
|
@ -0,0 +1,113 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright (C) 2012 Stefan Breunig <stefan+measure-net-speed@mathphys.fsk.uni-heidelberg.de>
|
||||
# Copyright (C) 2014 kaueraal
|
||||
# Copyright (C) 2015 Thiago Perrotta <perrotta dot thiago at poli dot ufrj dot br>
|
||||
|
||||
# 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/>.
|
||||
|
||||
# Get custom IN and OUT labels if provided by command line arguments
|
||||
while [[ $# -gt 1 ]]; do
|
||||
key="$1"
|
||||
case "$key" in
|
||||
-i|--inlabel)
|
||||
INLABEL="$2"
|
||||
shift;;
|
||||
-o|--outlabel)
|
||||
OUTLABEL="$2"
|
||||
shift;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
[[ -z "$INLABEL" ]] && INLABEL="IN "
|
||||
[[ -z "$OUTLABEL" ]] && OUTLABEL="OUT "
|
||||
|
||||
# Use the provided interface, otherwise the device used for the default route.
|
||||
if [[ -z $INTERFACE ]] && [[ -n $BLOCK_INSTANCE ]]; then
|
||||
INTERFACE=$BLOCK_INSTANCE
|
||||
elif [[ -z $INTERFACE ]]; then
|
||||
INTERFACE=$(ip route | awk '/^default/ { print $5 ; exit }')
|
||||
fi
|
||||
|
||||
# Exit if there is no default route
|
||||
[[ -z "$INTERFACE" ]] && exit
|
||||
|
||||
# Issue #36 compliant.
|
||||
if ! [ -e "/sys/class/net/${INTERFACE}/operstate" ] || \
|
||||
(! [ "$TREAT_UNKNOWN_AS_UP" = "1" ] &&
|
||||
! [ "`cat /sys/class/net/${INTERFACE}/operstate`" = "up" ])
|
||||
then
|
||||
echo "$INTERFACE down"
|
||||
echo "$INTERFACE down"
|
||||
echo "#FF0000"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# path to store the old results in
|
||||
path="/tmp/$(basename $0)-${INTERFACE}"
|
||||
|
||||
# grabbing data for each adapter.
|
||||
read rx < "/sys/class/net/${INTERFACE}/statistics/rx_bytes"
|
||||
read tx < "/sys/class/net/${INTERFACE}/statistics/tx_bytes"
|
||||
|
||||
# get time
|
||||
time="$(date +%s)"
|
||||
|
||||
# write current data if file does not exist. Do not exit, this will cause
|
||||
# problems if this file is sourced instead of executed as another process.
|
||||
if ! [[ -f "${path}" ]]; then
|
||||
echo "${time} ${rx} ${tx}" > "${path}"
|
||||
chmod 0666 "${path}"
|
||||
fi
|
||||
|
||||
|
||||
# read previous state and update data storage
|
||||
read old < "${path}"
|
||||
echo "${time} ${rx} ${tx}" > "${path}"
|
||||
|
||||
# parse old data and calc time passed
|
||||
old=(${old//;/ })
|
||||
time_diff=$(( $time - ${old[0]} ))
|
||||
|
||||
# sanity check: has a positive amount of time passed
|
||||
[[ "${time_diff}" -gt 0 ]] || exit
|
||||
|
||||
# calc bytes transferred, and their rate in byte/s
|
||||
rx_diff=$(( $rx - ${old[1]} ))
|
||||
tx_diff=$(( $tx - ${old[2]} ))
|
||||
rx_rate=$(( $rx_diff / $time_diff ))
|
||||
tx_rate=$(( $tx_diff / $time_diff ))
|
||||
|
||||
# shift by 10 bytes to get KiB/s. If the value is larger than
|
||||
# 1024^2 = 1048576, then display MiB/s instead
|
||||
|
||||
# incoming
|
||||
echo -n "$INLABEL"
|
||||
rx_kib=$(( $rx_rate >> 10 ))
|
||||
if hash bc 2>/dev/null && [[ "$rx_rate" -gt 1048576 ]]; then
|
||||
printf '%sM' "`echo "scale=1; $rx_kib / 1024" | bc`"
|
||||
else
|
||||
echo -n "${rx_kib}K"
|
||||
fi
|
||||
|
||||
echo -n " "
|
||||
|
||||
# outgoing
|
||||
echo -n "$OUTLABEL"
|
||||
tx_kib=$(( $tx_rate >> 10 ))
|
||||
if hash bc 2>/dev/null && [[ "$tx_rate" -gt 1048576 ]]; then
|
||||
printf '%sM\n' "`echo "scale=1; $tx_kib / 1024" | bc`"
|
||||
else
|
||||
echo "${tx_kib}K"
|
||||
fi
|
104
i3/scripts/bandwidth2
Executable file
104
i3/scripts/bandwidth2
Executable file
|
@ -0,0 +1,104 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (C) 2015 James Murphy
|
||||
# Licensed under the terms of the GNU GPL v2 only.
|
||||
#
|
||||
# i3blocks blocklet script to monitor bandwidth usage
|
||||
|
||||
iface="${BLOCK_INSTANCE}"
|
||||
iface="${IFACE:-$iface}"
|
||||
dt="${DT:-3}"
|
||||
unit="${UNIT:-MB}"
|
||||
LABEL="${LABEL:-<span font='FontAwesome'> </span>}" # down arrow up arrow
|
||||
printf_command="${PRINTF_COMMAND:-"printf \"${LABEL}%1.0f/%1.0f %s/s\\n\", rx, wx, unit;"}"
|
||||
|
||||
function default_interface {
|
||||
ip route | awk '/^default via/ {print $5; exit}'
|
||||
}
|
||||
|
||||
function check_proc_net_dev {
|
||||
if [ ! -f "/proc/net/dev" ]; then
|
||||
echo "/proc/net/dev not found"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function list_interfaces {
|
||||
check_proc_net_dev
|
||||
echo "Interfaces in /proc/net/dev:"
|
||||
grep -o "^[^:]\\+:" /proc/net/dev | tr -d " :"
|
||||
}
|
||||
|
||||
while getopts i:t:u:p:lh opt; do
|
||||
case "$opt" in
|
||||
i) iface="$OPTARG" ;;
|
||||
t) dt="$OPTARG" ;;
|
||||
u) unit="$OPTARG" ;;
|
||||
p) printf_command="$OPTARG" ;;
|
||||
l) list_interfaces && exit 0 ;;
|
||||
h) printf \
|
||||
"Usage: bandwidth3 [-i interface] [-t time] [-u unit] [-p printf_command] [-l] [-h]
|
||||
Options:
|
||||
-i\tNetwork interface to measure. Default determined using \`ip route\`.
|
||||
-t\tTime interval in seconds between measurements. Default: 3
|
||||
-u\tUnits to measure bytes in. Default: Mb
|
||||
\tAllowed units: Kb, KB, Mb, MB, Gb, GB, Tb, TB
|
||||
\tUnits may have optional it/its/yte/ytes on the end, e.g. Mbits, KByte
|
||||
-p\tAwk command to be called after a measurement is made.
|
||||
\tDefault: printf \"<span font='FontAwesome'> </span>%%-5.1f/%%5.1f %%s/s\\\\n\", rx, wx, unit;
|
||||
\tExposed variables: rx, wx, tx, unit, iface
|
||||
-l\tList available interfaces in /proc/net/dev
|
||||
-h\tShow this help text
|
||||
" && exit 0;;
|
||||
esac
|
||||
done
|
||||
|
||||
check_proc_net_dev
|
||||
|
||||
iface="${iface:-$(default_interface)}"
|
||||
while [ -z "$iface" ]; do
|
||||
echo No default interface
|
||||
sleep "$dt"
|
||||
iface=$(default_interface)
|
||||
done
|
||||
|
||||
case "$unit" in
|
||||
Kb|Kbit|Kbits) bytes_per_unit=$((1024 / 8));;
|
||||
KB|KByte|KBytes) bytes_per_unit=$((1024));;
|
||||
Mb|Mbit|Mbits) bytes_per_unit=$((1024 * 1024 / 8));;
|
||||
MB|MByte|MBytes) bytes_per_unit=$((1024 * 1024));;
|
||||
Gb|Gbit|Gbits) bytes_per_unit=$((1024 * 1024 * 1024 / 8));;
|
||||
GB|GByte|GBytes) bytes_per_unit=$((1024 * 1024 * 1024));;
|
||||
Tb|Tbit|Tbits) bytes_per_unit=$((1024 * 1024 * 1024 * 1024 / 8));;
|
||||
TB|TByte|TBytes) bytes_per_unit=$((1024 * 1024 * 1024 * 1024));;
|
||||
*) echo Bad unit "$unit" && exit 1;;
|
||||
esac
|
||||
|
||||
scalar=$((bytes_per_unit * dt))
|
||||
init_line=$(cat /proc/net/dev | grep "^[ ]*$iface:")
|
||||
if [ -z "$init_line" ]; then
|
||||
echo Interface not found in /proc/net/dev: "$iface"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
init_received=$(awk '{print $2}' <<< $init_line)
|
||||
init_sent=$(awk '{print $10}' <<< $init_line)
|
||||
|
||||
(while true; do cat /proc/net/dev; sleep "$dt"; done) |\
|
||||
stdbuf -oL grep "^[ ]*$iface:" |\
|
||||
awk -v scalar="$scalar" -v unit="$unit" -v iface="$iface" '
|
||||
BEGIN{old_received='"$init_received"';old_sent='"$init_sent"'}
|
||||
{
|
||||
received=$2
|
||||
sent=$10
|
||||
rx=(received-old_received)/scalar;
|
||||
wx=(sent-old_sent)/scalar;
|
||||
tx=rx+wr;
|
||||
old_received=received;
|
||||
old_sent=sent;
|
||||
if(rx >= 0 && wx >= 0){
|
||||
'"$printf_command"';
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
'
|
18
i3/scripts/battery-pinebook-pro
Executable file
18
i3/scripts/battery-pinebook-pro
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
#simple Shellscript for i3blocks on Pinebook pro
|
||||
#05012020 geri123@gmx.net Gerhard S.
|
||||
#battery-symbols: on Manjaro you need the awesome-terminal-fonts package installed!
|
||||
PERCENT=$(cat /sys/class/power_supply/cw2015-battery/capacity)
|
||||
STATUS=$(cat /sys/class/power_supply/cw2015-battery/status)
|
||||
case $((
|
||||
$PERCENT >= 0 && $PERCENT <= 20 ? 1 :
|
||||
$PERCENT > 20 && $PERCENT <= 40 ? 2 :
|
||||
$PERCENT > 40 && $PERCENT <= 60 ? 3 :
|
||||
$PERCENT > 60 && $PERCENT <= 80 ? 4 : 5)) in
|
||||
#
|
||||
(1) echo $STATUS:"" :$PERCENT%;;
|
||||
(2) echo $STATUS:"" :$PERCENT%;;
|
||||
(3) echo $STATUS:"" :$PERCENT%;;
|
||||
(4) echo $STATUS:"" :$PERCENT%;;
|
||||
(5) echo $STATUS:"" :$PERCENT%;;
|
||||
esac
|
114
i3/scripts/battery1
Executable file
114
i3/scripts/battery1
Executable file
|
@ -0,0 +1,114 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
|
||||
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
|
||||
#
|
||||
# Licensed under the terms of the GNU GPL v3, or any later version.
|
||||
#
|
||||
# This script is meant to use with i3blocks. It parses the output of the "acpi"
|
||||
# command (often provided by a package of the same name) to read the status of
|
||||
# the battery, and eventually its remaining time (to full charge or discharge).
|
||||
#
|
||||
# The color will gradually change for a percentage below 85%, and the urgency
|
||||
# (exit code 33) is set if there is less that 5% remaining.
|
||||
|
||||
# Edited by Andreas Lindlbauer <endeavouros.mousily@aleeas.com>
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
|
||||
# otherwise we get in console "Wide character in print at"
|
||||
binmode(STDOUT, ':utf8');
|
||||
|
||||
# my $acpi;
|
||||
my $upower;
|
||||
my $percent;
|
||||
my $bat_state;
|
||||
my $status;
|
||||
my $ac_adapt;
|
||||
my $full_text;
|
||||
my $short_text;
|
||||
my $label = '😅';
|
||||
my $bat_number = $ENV{BLOCK_INSTANCE} || 0;
|
||||
|
||||
open (UPOWER, "upower -i /org/freedesktop/UPower/devices/battery_BAT$bat_number | grep 'percentage' |") or die;
|
||||
$upower = <UPOWER>;
|
||||
close(UPOWER);
|
||||
|
||||
# fail on unexpected output
|
||||
if ($upower !~ /: (\d+)%/) {
|
||||
die "$upower\n";
|
||||
}
|
||||
|
||||
$percent = $1;
|
||||
$full_text = "$percent%";
|
||||
|
||||
open (BAT_STATE, "upower -i /org/freedesktop/UPower/devices/battery_BAT$bat_number | grep 'state' |") or die;
|
||||
$bat_state = <BAT_STATE>;
|
||||
close(BAT_STATE);
|
||||
|
||||
if ($bat_state !~ /: (\w+)/) {
|
||||
die "$bat_state\n";
|
||||
}
|
||||
$status = $1;
|
||||
|
||||
if ($status eq 'discharging') {
|
||||
$full_text .= ' ';
|
||||
} elsif ($status eq 'charging') {
|
||||
$full_text .= ' ';
|
||||
} elsif ($status eq 'Unknown') {
|
||||
open (AC_ADAPTER, "acpi -a |") or die;
|
||||
$ac_adapt = <AC_ADAPTER>;
|
||||
close(AC_ADAPTER);
|
||||
|
||||
if ($ac_adapt =~ /: ([\w-]+)/) {
|
||||
$ac_adapt = $1;
|
||||
|
||||
if ($ac_adapt eq 'on-line') {
|
||||
$full_text .= ' CHR';
|
||||
} elsif ($ac_adapt eq 'off-line') {
|
||||
$full_text .= ' DIS';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$short_text = $full_text;
|
||||
|
||||
if ($percent < 20) {
|
||||
$label = '';
|
||||
} elsif ($percent < 45) {
|
||||
$label = '';
|
||||
} elsif ($percent < 70) {
|
||||
$label = '';
|
||||
} elsif ($percent < 95) {
|
||||
$label = '';
|
||||
} else {
|
||||
$label = '';
|
||||
}
|
||||
|
||||
# print text
|
||||
print " ${label}";
|
||||
print " $full_text\n";
|
||||
print " ${label}";
|
||||
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);
|
106
i3/scripts/battery2
Executable file
106
i3/scripts/battery2
Executable file
|
@ -0,0 +1,106 @@
|
|||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright (C) 2016 James Murphy
|
||||
# Licensed under the GPL version 2 only
|
||||
#
|
||||
# A battery indicator blocklet script for i3blocks
|
||||
|
||||
from subprocess import check_output
|
||||
import os
|
||||
import re
|
||||
|
||||
config = dict(os.environ)
|
||||
status = check_output(['acpi'], universal_newlines=True)
|
||||
|
||||
if not status:
|
||||
# stands for no battery found
|
||||
color = config.get("color_10", "red")
|
||||
fulltext = "<span color='{}'><span font='FontAwesome'>\uf00d \uf240</span></span>".format(color)
|
||||
percentleft = 100
|
||||
else:
|
||||
# if there is more than one battery in one laptop, the percentage left is
|
||||
# available for each battery separately, although state and remaining
|
||||
# time for overall block is shown in the status of the first battery
|
||||
batteries = status.split("\n")
|
||||
state_batteries=[]
|
||||
commasplitstatus_batteries=[]
|
||||
percentleft_batteries=[]
|
||||
time = ""
|
||||
for battery in batteries:
|
||||
if battery!='':
|
||||
state_batteries.append(battery.split(": ")[1].split(", ")[0])
|
||||
commasplitstatus = battery.split(", ")
|
||||
if not time:
|
||||
time = commasplitstatus[-1].strip()
|
||||
# check if it matches a time
|
||||
time = re.match(r"(\d+):(\d+)", time)
|
||||
if time:
|
||||
time = ":".join(time.groups())
|
||||
timeleft = " ({})".format(time)
|
||||
else:
|
||||
timeleft = ""
|
||||
|
||||
p = int(commasplitstatus[1].rstrip("%\n"))
|
||||
if p>0:
|
||||
percentleft_batteries.append(p)
|
||||
commasplitstatus_batteries.append(commasplitstatus)
|
||||
state = state_batteries[0]
|
||||
commasplitstatus = commasplitstatus_batteries[0]
|
||||
if percentleft_batteries:
|
||||
percentleft = int(sum(percentleft_batteries)/len(percentleft_batteries))
|
||||
else:
|
||||
percentleft = 0
|
||||
|
||||
# stands for charging
|
||||
color = config.get("color_charging", "yellow")
|
||||
FA_LIGHTNING = "<span color='{}'><span font='FontAwesome'>\uf0e7</span></span>".format(color)
|
||||
|
||||
# stands for plugged in
|
||||
FA_PLUG = "<span font='FontAwesome'>\uf1e6</span>"
|
||||
|
||||
# stands for using battery
|
||||
FA_BATTERY = "<span font='FontAwesome'>\uf240</span>"
|
||||
|
||||
# stands for unknown status of battery
|
||||
FA_QUESTION = "<span font='FontAwesome'>\uf128</span>"
|
||||
|
||||
|
||||
if state == "Discharging":
|
||||
fulltext = FA_BATTERY + " "
|
||||
elif state == "Full":
|
||||
fulltext = FA_PLUG + " "
|
||||
timeleft = ""
|
||||
elif state == "Unknown":
|
||||
fulltext = FA_QUESTION + " " + FA_BATTERY + " "
|
||||
timeleft = ""
|
||||
else:
|
||||
fulltext = FA_LIGHTNING + " " + FA_PLUG + " "
|
||||
|
||||
def color(percent):
|
||||
if percent < 10:
|
||||
# exit code 33 will turn background red
|
||||
return config.get("color_10", "#FFFFFF")
|
||||
if percent < 20:
|
||||
return config.get("color_20", "#FF3300")
|
||||
if percent < 30:
|
||||
return config.get("color_30", "#FF6600")
|
||||
if percent < 40:
|
||||
return config.get("color_40", "#FF9900")
|
||||
if percent < 50:
|
||||
return config.get("color_50", "#FFCC00")
|
||||
if percent < 60:
|
||||
return config.get("color_60", "#FFFF00")
|
||||
if percent < 70:
|
||||
return config.get("color_70", "#FFFF33")
|
||||
if percent < 80:
|
||||
return config.get("color_80", "#FFFF66")
|
||||
return config.get("color_full", "#FFFFFF")
|
||||
|
||||
form = '<span color="{}">{}%</span>'
|
||||
fulltext += form.format(color(percentleft), percentleft)
|
||||
#fulltext += timeleft
|
||||
|
||||
print(fulltext)
|
||||
print(fulltext)
|
||||
if percentleft < 10:
|
||||
exit(33)
|
11
i3/scripts/blur-lock
Executable file
11
i3/scripts/blur-lock
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
PICTURE=/tmp/i3lock.png
|
||||
SCREENSHOT="scrot -z $PICTURE"
|
||||
|
||||
BLUR="5x4"
|
||||
|
||||
$SCREENSHOT
|
||||
convert $PICTURE -blur $BLUR $PICTURE
|
||||
i3lock -i $PICTURE
|
||||
rm $PICTURE
|
62
i3/scripts/cpu_usage
Executable file
62
i3/scripts/cpu_usage
Executable file
|
@ -0,0 +1,62 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
|
||||
# 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;
|
||||
use warnings;
|
||||
use utf8;
|
||||
use Getopt::Long;
|
||||
|
||||
# default values
|
||||
my $t_warn = $ENV{T_WARN} // 50;
|
||||
my $t_crit = $ENV{T_CRIT} // 80;
|
||||
my $cpu_usage = -1;
|
||||
my $decimals = $ENV{DECIMALS} // 0;
|
||||
my $label = $ENV{LABEL} // "";
|
||||
|
||||
sub help {
|
||||
print "Usage: cpu_usage [-w <warning>] [-c <critical>] [-d <decimals>]\n";
|
||||
print "-w <percent>: warning threshold to become yellow\n";
|
||||
print "-c <percent>: critical threshold to become red\n";
|
||||
print "-d <decimals>: Use <decimals> decimals for percentage (default is $decimals) \n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
GetOptions("help|h" => \&help,
|
||||
"w=i" => \$t_warn,
|
||||
"c=i" => \$t_crit,
|
||||
"d=i" => \$decimals,
|
||||
);
|
||||
|
||||
# Get CPU usage
|
||||
$ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is
|
||||
open (MPSTAT, 'mpstat 1 1 |') or die;
|
||||
while (<MPSTAT>) {
|
||||
if (/^.*\s+(\d+\.\d+)[\s\x00]?$/) {
|
||||
$cpu_usage = 100 - $1; # 100% - %idle
|
||||
last;
|
||||
}
|
||||
}
|
||||
close(MPSTAT);
|
||||
|
||||
$cpu_usage eq -1 and die 'Can\'t find CPU information';
|
||||
|
||||
# Print short_text, full_text
|
||||
print "${label}";
|
||||
printf "%02.${decimals}f%%\n", $cpu_usage;
|
||||
print "${label}";
|
||||
printf "%02.${decimals}f%%\n", $cpu_usage;
|
||||
|
||||
# Print color, if needed
|
||||
if ($cpu_usage >= $t_crit) {
|
||||
print "#FF0000\n";
|
||||
exit 33;
|
||||
} elsif ($cpu_usage >= $t_warn) {
|
||||
print "#FFFC00\n";
|
||||
}
|
||||
|
||||
exit 0;
|
48
i3/scripts/disk
Executable file
48
i3/scripts/disk
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env bash
|
||||
# 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="${DIR:-$BLOCK_INSTANCE}"
|
||||
DIR="${DIR:-$HOME}"
|
||||
ALERT_LOW="${ALERT_LOW:-$1}"
|
||||
ALERT_LOW="${ALERT_LOW:-10}" # color will turn red under this value (default: 10%)
|
||||
|
||||
LOCAL_FLAG="-l"
|
||||
if [ "$1" = "-n" ] || [ "$2" = "-n" ]; then
|
||||
LOCAL_FLAG=""
|
||||
fi
|
||||
|
||||
df -h -P $LOCAL_FLAG "$DIR" | awk -v label="$LABEL" -v alert_low=$ALERT_LOW '
|
||||
/\/.*/ {
|
||||
# full text
|
||||
print label $4
|
||||
|
||||
# short text
|
||||
print label $4
|
||||
|
||||
use=$5
|
||||
|
||||
# no need to continue parsing
|
||||
exit 0
|
||||
}
|
||||
|
||||
END {
|
||||
gsub(/%$/,"",use)
|
||||
if (100 - use < alert_low) {
|
||||
# color
|
||||
print "#FF0000"
|
||||
}
|
||||
}
|
||||
'
|
10
i3/scripts/empty_workspace
Executable file
10
i3/scripts/empty_workspace
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
MAX_DESKTOPS=20
|
||||
|
||||
WORKSPACES=$(seq -s '\n' 1 1 ${MAX_DESKTOPS})
|
||||
|
||||
EMPTY_WORKSPACE=$( (i3-msg -t get_workspaces | tr ',' '\n' | grep num | awk -F: '{print int($2)}' ; \
|
||||
echo -e ${WORKSPACES} ) | sort -n | uniq -u | head -n 1)
|
||||
|
||||
i3-msg workspace ${EMPTY_WORKSPACE}
|
5
i3/scripts/keyboard-layout
Executable file
5
i3/scripts/keyboard-layout
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
KBD=$(/usr/bin/xkblayout-state print '%s')
|
||||
echo $KBD
|
||||
|
25
i3/scripts/keyhint
Executable file
25
i3/scripts/keyhint
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
Main() {
|
||||
source /usr/share/endeavouros/scripts/eos-script-lib-yad || return 1
|
||||
|
||||
local command=(
|
||||
eos_yad --title="EndeavourOS i3-wm keybindings:" --no-buttons --geometry=400x345-15-400 --list
|
||||
--column=key: --column=description: --column=command:
|
||||
"ESC" "close this app" ""
|
||||
"=" "modkey" "(set mod Mod4)"
|
||||
"+enter" "open a terminal" ""
|
||||
"+Shift+n" "new empty workspace" ""
|
||||
"+w" "open Browser" ""
|
||||
"+n" "open Filebrowser" ""
|
||||
"+d" "app menu" ""
|
||||
"+q" "close focused app" ""
|
||||
"Print-key" "screenshot" ""
|
||||
"+Shift+e" "logout menu" ""
|
||||
"F1" "open keybinding helper" ""
|
||||
)
|
||||
|
||||
"${command[@]}"
|
||||
}
|
||||
|
||||
Main "$@"
|
6
i3/scripts/keyhint-2
Executable file
6
i3/scripts/keyhint-2
Executable file
|
@ -0,0 +1,6 @@
|
|||
I3_CONFIG=$HOME/.config/i3/config
|
||||
mod_key=$(sed -nre 's/^set \$mod (.*)/\1/p' ${I3_CONFIG})
|
||||
grep "^bindsym" ${I3_CONFIG} \
|
||||
| sed "s/-\(-\w\+\)\+//g;s/\$mod/${mod_key}/g;s/Mod1/Alt/g;s/exec //;s/bindsym //;s/^\s\+//;s/^\([^ ]\+\) \(.\+\)$/\2: \1/;s/^\s\+//" \
|
||||
| tr -s ' ' \
|
||||
| rofi -dmenu -theme ~/.config/rofi/rofikeyhint.rasi
|
69
i3/scripts/memory
Executable file
69
i3/scripts/memory
Executable file
|
@ -0,0 +1,69 @@
|
|||
#!/usr/bin/env bash
|
||||
# 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/>.
|
||||
|
||||
TYPE="${BLOCK_INSTANCE:-mem}"
|
||||
|
||||
awk -v type=$TYPE '
|
||||
/^MemTotal:/ {
|
||||
mem_total=$2
|
||||
}
|
||||
/^MemFree:/ {
|
||||
mem_free=$2
|
||||
}
|
||||
/^Buffers:/ {
|
||||
mem_free+=$2
|
||||
}
|
||||
/^Cached:/ {
|
||||
mem_free+=$2
|
||||
}
|
||||
/^SwapTotal:/ {
|
||||
swap_total=$2
|
||||
}
|
||||
/^SwapFree:/ {
|
||||
swap_free=$2
|
||||
}
|
||||
END {
|
||||
if (type == "swap") {
|
||||
free=swap_free/1024/1024
|
||||
used=(swap_total-swap_free)/1024/1024
|
||||
total=swap_total/1024/1024
|
||||
} else {
|
||||
free=mem_free/1024/1024
|
||||
used=(mem_total-mem_free)/1024/1024
|
||||
total=mem_total/1024/1024
|
||||
}
|
||||
|
||||
pct=0
|
||||
if (total > 0) {
|
||||
pct=used/total*100
|
||||
}
|
||||
|
||||
# full text
|
||||
# printf("%.1fG/%.1fG (%.f%%)\n", used, total, pct)
|
||||
|
||||
# short text
|
||||
printf("%.f%%\n", pct)
|
||||
|
||||
# color
|
||||
if (pct > 90) {
|
||||
print("#FF0000")
|
||||
} else if (pct > 80) {
|
||||
print("#FFAE00")
|
||||
} else if (pct > 70) {
|
||||
print("#FFF600")
|
||||
}
|
||||
}
|
||||
' /proc/meminfo
|
93
i3/scripts/openweather
Executable file
93
i3/scripts/openweather
Executable file
|
@ -0,0 +1,93 @@
|
|||
#!/usr/bin/env bash
|
||||
# Edited by Andreas Lindlbauer <endeavouros.mousily@aleeas.com>
|
||||
|
||||
temps=("#0600FF" "#0500FF" "#0400FF" "#0300FF" "#0200FF" "#0100FF" "#0000FF" "#0002FF" "#0012FF" "#0022FF" "#0032FF" "#0044FF" "#0054FF" "#0064FF" "#0074FF" "#0084FF" "#0094FF" "#00A4FF" "#00B4FF" "#00C4FF" "#00D4FF" "#00E4FF" "#00FFF4" "#00FFD0" "#00FFA8" "#00FF83" "#00FF5C" "#00FF36" "#00FF10" "#17FF00" "#3EFF00" "#65FF00" "#B0FF00" "#FDFF00" "#FFF000" "#FFDC00" "#FFC800" "#FFB400" "#FFA000" "#FF8C00" "#FF7800" "#FF6400" "#FF5000" "#FF3C00" "#FF2800" "#FF1400" "#FF0000")
|
||||
|
||||
command -v jq >/dev/null 2>&1 || { echo >&2 "Program 'jq' required but it is not installed.
|
||||
Aborting."; exit 1; }
|
||||
command -v wget >/dev/null 2>&1 || { echo >&2 "Program 'wget' required but is not installed.
|
||||
Aborting."; exit 1; }
|
||||
|
||||
# To use this script you need to create an API key here https://home.openweathermap.org
|
||||
# You need to put your Open Weather APIKEY here:
|
||||
APIKEY="keykeykey"
|
||||
# And get your Latitute and Longitudes to put in here:
|
||||
LAT="XX.XXXX"
|
||||
LON="XX.XXXX"
|
||||
URL="http://api.openweathermap.org/data/2.5/onecall?lat=${LAT}&lon=${LON}&units=metric&exclude=minutely,hourly,daily&APPID=${APIKEY}"
|
||||
WEATHER_RESPONSE=$(wget -qO- "${URL}")
|
||||
|
||||
WEATHER_CONDITION=$(echo "$WEATHER_RESPONSE" | jq '.current.weather[0].main' | sed 's/"//g')
|
||||
WEATHER_TEMP=$(echo "$WEATHER_RESPONSE" | jq '.current.feels_like')
|
||||
WEATHER_INT=${WEATHER_TEMP%.*}
|
||||
|
||||
TIME_NOW=$( echo "$WEATHER_RESPONSE" | jq '.current.dt')
|
||||
SUNRISE=$( echo "$WEATHER_RESPONSE" | jq '.current.sunrise')
|
||||
SUNSET=$( echo "$WEATHER_RESPONSE" | jq '.current.sunset')
|
||||
DESCRIPTION=$( echo "$WEATHER_RESPONSE" | jq '.current.weather[0].description' | sed 's/"//g')
|
||||
WEATHER_ALERT=$( echo "$WEATHER_RESPONSE" | jq '.alerts[0].event' | sed 's/"//g')
|
||||
DAYTIME="n"
|
||||
|
||||
if [[ "$TIME_NOW" > "$SUNRISE" ]] && [[ "$TIME_NOW" < "$SUNSET" ]]; then
|
||||
DAYTIME="d"
|
||||
fi
|
||||
|
||||
case $WEATHER_CONDITION in
|
||||
'Clouds')
|
||||
if [ "$DAYTIME" == "d" ]; then
|
||||
WEATHER_ICON=""
|
||||
else
|
||||
WEATHER_ICON=""
|
||||
fi
|
||||
;;
|
||||
'Rain')
|
||||
WEATHER_ICON=""
|
||||
;;
|
||||
'Drizzle')
|
||||
if [ "$DAYTIME" == "d" ]; then
|
||||
WEATHER_ICON=""
|
||||
else
|
||||
WEATHER_ICON=""
|
||||
fi
|
||||
;;
|
||||
'Thunderstorm')
|
||||
WEATHER_ICON=""
|
||||
;;
|
||||
'Snow')
|
||||
WEATHER_ICON=""
|
||||
;;
|
||||
'Clear')
|
||||
if [ "$DAYTIME" == "d" ]; then
|
||||
WEATHER_ICON=""
|
||||
else
|
||||
WEATHER_ICON=""
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
WEATHER_ICON="🌫"
|
||||
;;
|
||||
esac
|
||||
|
||||
WEATHER_COLOR="#FFFFFF"
|
||||
if [ "$WEATHER_INT" -lt "-11" ]; then
|
||||
WEATHER_COLOR="#0000FF"
|
||||
elif [ "$WEATHER_INT" -gt 35 ]; then
|
||||
WEATHER_COLOR="#FF0000"
|
||||
else
|
||||
WEATHER_INT=$(( WEATHER_INT + 11 ))
|
||||
WEATHER_COLOR="${temps[$WEATHER_INT]}"
|
||||
fi
|
||||
|
||||
full_text="${WEATHER_ICON} ${WEATHER_TEMP}°C: ${DESCRIPTION} "
|
||||
if [ "$WEATHER_ALERT" != "null" ]; then
|
||||
WARN_START=$(echo "$WEATHER_RESPONSE" | jq '.alerts[0].start')
|
||||
WARN_END=$(echo "$WEATHER_RESPONSE" | jq '.alerts[0].end')
|
||||
WARN_START=$(date -d @"$WARN_START" +%a_%k:%M)
|
||||
WARN_END=$(date -d @"$WARN_END" +%a_%k:%M)
|
||||
full_text="${WEATHER_ICON} ${WEATHER_TEMP}°C: ${DESCRIPTION} ${WEATHER_ALERT} from ${WARN_START} to ${WARN_END} "
|
||||
fi
|
||||
|
||||
|
||||
echo "${full_text}"
|
||||
echo "${WEATHER_TEMP}°C "
|
||||
echo "${WEATHER_COLOR}"
|
43
i3/scripts/openweather-city
Executable file
43
i3/scripts/openweather-city
Executable file
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
command -v jq >/dev/null 2>&1 || { echo >&2 "Program 'jq' required but it is not installed.
|
||||
Aborting."; exit 1; }
|
||||
command -v wget >/dev/null 2>&1 || { echo >&2 "Program 'wget' required but is not installed.
|
||||
Aborting."; exit 1; }
|
||||
|
||||
# To use this script you need to create an API key here https://home.openweathermap.org
|
||||
# You need to put your Open Weather APIKEY here:
|
||||
APIKEY="keykey"
|
||||
# find your City ID here: https://openweathermap.org/
|
||||
# search for your city and copy the ID from the URL inside the browser.
|
||||
CITY_ID="idid"
|
||||
URL="http://api.openweathermap.org/data/2.5/weather?id=${CITY_ID}&units=metric&APPID=${APIKEY}"
|
||||
|
||||
WEATHER_RESPONSE=$(wget -qO- "${URL}")
|
||||
|
||||
WEATHER_CONDITION=$(echo $WEATHER_RESPONSE | jq '.weather[0].main' | sed 's/"//g')
|
||||
WEATHER_TEMP=$(echo $WEATHER_RESPONSE | jq '.main.temp')
|
||||
WIND_DIR=$( echo "$WEATHER_RESPONSE" | jq '.wind.deg')
|
||||
WIND_SPEED=$( echo "$WEATHER_RESPONSE" | jq '.wind.speed')
|
||||
|
||||
WIND_SPEED=$(awk "BEGIN {print 60*60*$WIND_SPEED/1000}")
|
||||
WIND_DIR=$(awk "BEGIN {print int(($WIND_DIR % 360)/22.5)}")
|
||||
DIR_ARRAY=( N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW N )
|
||||
WIND_DIR=${DIR_ARRAY[WIND_DIR]}
|
||||
|
||||
case $WEATHER_CONDITION in
|
||||
'Clouds')
|
||||
WEATHER_ICON=""
|
||||
;;
|
||||
'Rain')
|
||||
WEATHER_ICON=""
|
||||
;;
|
||||
'Snow')
|
||||
WEATHER_ICON=""
|
||||
;;
|
||||
*)
|
||||
WEATHER_ICON=""
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "${WEATHER_ICON} ${WEATHER_TEMP}°C: ${WIND_SPEED} km/h ${WIND_DIR}"
|
5
i3/scripts/openweather.conf
Executable file
5
i3/scripts/openweather.conf
Executable file
|
@ -0,0 +1,5 @@
|
|||
# Weather
|
||||
[Weather]
|
||||
command=~/.config/i3/scripts/openweather
|
||||
interval=1800
|
||||
color=#7275b3
|
190
i3/scripts/power-profiles
Executable file
190
i3/scripts/power-profiles
Executable file
|
@ -0,0 +1,190 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Use rofi/zenity to change system runstate thanks to systemd.
|
||||
#
|
||||
# Note: this currently relies on associative array support in the shell.
|
||||
#
|
||||
# Inspired from i3pystatus wiki:
|
||||
# https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu
|
||||
#
|
||||
# Copyright 2015 Benjamin Chrétien <chretien at lirmm dot fr>
|
||||
#
|
||||
# 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/>.
|
||||
|
||||
# power-profiles-daemon implementation:
|
||||
# needs package power-profiles-daemon installed and the service running see here:
|
||||
# https://wiki.archlinux.org/title/CPU_frequency_scaling#power-profiles-daemon
|
||||
# used in i3-blocks: ~/.config/i3/i3blocks.conf together with: ~/.config/i3/scripts/ppd-status
|
||||
|
||||
|
||||
#######################################################################
|
||||
# BEGIN CONFIG #
|
||||
#######################################################################
|
||||
|
||||
# Use a custom lock script
|
||||
#LOCKSCRIPT="i3lock-extra -m pixelize"
|
||||
|
||||
# Colors: FG (foreground), BG (background), HL (highlighted)
|
||||
FG_COLOR="#bbbbbb"
|
||||
BG_COLOR="#111111"
|
||||
HLFG_COLOR="#111111"
|
||||
HLBG_COLOR="#bbbbbb"
|
||||
BORDER_COLOR="#222222"
|
||||
|
||||
# Options not related to colors
|
||||
#ROFI_TEXT=":"
|
||||
#ROFI_OPTIONS=(-width -11 -location 0 -hide-scrollbar -bw 30 -color-window "#dd310027,#dd0310027,#dd310027" -padding 5)
|
||||
#ROFI_OPTIONS=(-width -18 -location 4 -hide-scrollbar -color-window "#cc310027,#00a0009a,#cc310027" -padding 5 -font "Sourcecode Pro Regular 10, FontAwesome 9")
|
||||
ROFI_OPTIONS=(-theme ~/.config/rofi/power-profiles.rasi)
|
||||
# Zenity options
|
||||
ZENITY_TITLE="Power Profiles"
|
||||
ZENITY_TEXT="Set Profiles:"
|
||||
ZENITY_OPTIONS=(--column= --hide-header)
|
||||
|
||||
#######################################################################
|
||||
# END CONFIG #
|
||||
#######################################################################
|
||||
|
||||
# Whether to ask for user's confirmation
|
||||
enable_confirmation=false
|
||||
|
||||
# Preferred launcher if both are available
|
||||
preferred_launcher="rofi"
|
||||
|
||||
usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc.
|
||||
|
||||
where:
|
||||
-h show this help text
|
||||
-c ask for user confirmation
|
||||
-p preferred launcher (rofi or zenity)
|
||||
|
||||
This script depends on:
|
||||
- systemd,
|
||||
- i3,
|
||||
- rofi or zenity."
|
||||
|
||||
# Check whether the user-defined launcher is valid
|
||||
launcher_list=(rofi zenity)
|
||||
function check_launcher() {
|
||||
if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then
|
||||
echo "Supported launchers: ${launcher_list[*]}"
|
||||
exit 1
|
||||
else
|
||||
# Get array with unique elements and preferred launcher first
|
||||
# Note: uniq expects a sorted list, so we cannot use it
|
||||
i=1
|
||||
launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \
|
||||
| sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' '))
|
||||
fi
|
||||
}
|
||||
|
||||
# Parse CLI arguments
|
||||
while getopts "hcp:" option; do
|
||||
case "${option}" in
|
||||
h) echo "${usage}"
|
||||
exit 0
|
||||
;;
|
||||
c) enable_confirmation=true
|
||||
;;
|
||||
p) preferred_launcher="${OPTARG}"
|
||||
check_launcher "${preferred_launcher}"
|
||||
;;
|
||||
*) exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Check whether a command exists
|
||||
function command_exists() {
|
||||
command -v "$1" &> /dev/null 2>&1
|
||||
}
|
||||
|
||||
# systemctl required
|
||||
if ! command_exists systemctl ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# menu defined as an associative array
|
||||
typeset -A menu
|
||||
|
||||
# Menu with keys/commands
|
||||
|
||||
menu=(
|
||||
[ Performance]="powerprofilesctl set performance"
|
||||
[ Balanced]="powerprofilesctl set balanced"
|
||||
[ Power Saver]="powerprofilesctl set power-saver"
|
||||
[ Cancel]=""
|
||||
)
|
||||
|
||||
menu_nrows=${#menu[@]}
|
||||
|
||||
# Menu entries that may trigger a confirmation message
|
||||
menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout"
|
||||
|
||||
launcher_exe=""
|
||||
launcher_options=""
|
||||
rofi_colors=""
|
||||
|
||||
function prepare_launcher() {
|
||||
if [[ "$1" == "rofi" ]]; then
|
||||
rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \
|
||||
-hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}")
|
||||
launcher_exe="rofi"
|
||||
launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \
|
||||
"${rofi_colors}" "${ROFI_OPTIONS[@]}")
|
||||
elif [[ "$1" == "zenity" ]]; then
|
||||
launcher_exe="zenity"
|
||||
launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \
|
||||
"${ZENITY_OPTIONS[@]}")
|
||||
fi
|
||||
}
|
||||
|
||||
for l in "${launcher_list[@]}"; do
|
||||
if command_exists "${l}" ; then
|
||||
prepare_launcher "${l}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# No launcher available
|
||||
if [[ -z "${launcher_exe}" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
launcher=(${launcher_exe} "${launcher_options[@]}")
|
||||
selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")"
|
||||
|
||||
function ask_confirmation() {
|
||||
if [ "${launcher_exe}" == "rofi" ]; then
|
||||
confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \
|
||||
"${rofi_colors}" "${ROFI_OPTIONS[@]}")
|
||||
[ "${confirmed}" == "Yes" ] && confirmed=0
|
||||
elif [ "${launcher_exe}" == "zenity" ]; then
|
||||
zenity --question --text "Are you sure you want to ${selection,,}?"
|
||||
confirmed=$?
|
||||
fi
|
||||
|
||||
if [ "${confirmed}" == 0 ]; then
|
||||
i3-msg -q "exec --no-startup-id ${menu[${selection}]}"
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ $? -eq 0 && ! -z ${selection} ]]; then
|
||||
if [[ "${enable_confirmation}" = true && \
|
||||
${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then
|
||||
ask_confirmation
|
||||
else
|
||||
i3-msg -q "exec --no-startup-id ${menu[${selection}]}"
|
||||
fi
|
||||
fi
|
186
i3/scripts/powermenu
Executable file
186
i3/scripts/powermenu
Executable file
|
@ -0,0 +1,186 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Use rofi/zenity to change system runstate thanks to systemd.
|
||||
#
|
||||
# Note: this currently relies on associative array support in the shell.
|
||||
#
|
||||
# Inspired from i3pystatus wiki:
|
||||
# https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu
|
||||
#
|
||||
# Copyright 2015 Benjamin Chrétien <chretien at lirmm dot fr>
|
||||
#
|
||||
# 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/>.
|
||||
|
||||
# modified to work with latest rofi update by joekamprad <joekamprad@endeavouros.com>
|
||||
|
||||
#######################################################################
|
||||
# BEGIN CONFIG #
|
||||
#######################################################################
|
||||
|
||||
# Use a custom lock script
|
||||
#LOCKSCRIPT="i3lock-extra -m pixelize"
|
||||
|
||||
# Colors: FG (foreground), BG (background), HL (highlighted)
|
||||
FG_COLOR="#bbbbbb"
|
||||
BG_COLOR="#111111"
|
||||
HLFG_COLOR="#111111"
|
||||
HLBG_COLOR="#bbbbbb"
|
||||
BORDER_COLOR="#222222"
|
||||
|
||||
# Options not related to colors (most rofi options do not work anymore)
|
||||
ROFI_OPTIONS=(-theme ~/.config/rofi/powermenu.rasi)
|
||||
# Zenity options
|
||||
ZENITY_TITLE="Power Menu"
|
||||
ZENITY_TEXT="Action:"
|
||||
ZENITY_OPTIONS=(--column= --hide-header)
|
||||
|
||||
#######################################################################
|
||||
# END CONFIG #
|
||||
#######################################################################
|
||||
|
||||
# Whether to ask for user's confirmation
|
||||
enable_confirmation=false
|
||||
|
||||
# Preferred launcher if both are available
|
||||
preferred_launcher="rofi"
|
||||
|
||||
usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc.
|
||||
|
||||
where:
|
||||
-h show this help text
|
||||
-c ask for user confirmation
|
||||
-p preferred launcher (rofi or zenity)
|
||||
|
||||
This script depends on:
|
||||
- systemd,
|
||||
- i3,
|
||||
- rofi or zenity."
|
||||
|
||||
# Check whether the user-defined launcher is valid
|
||||
launcher_list=(rofi zenity)
|
||||
function check_launcher() {
|
||||
if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then
|
||||
echo "Supported launchers: ${launcher_list[*]}"
|
||||
exit 1
|
||||
else
|
||||
# Get array with unique elements and preferred launcher first
|
||||
# Note: uniq expects a sorted list, so we cannot use it
|
||||
i=1
|
||||
launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \
|
||||
| sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' '))
|
||||
fi
|
||||
}
|
||||
|
||||
# Parse CLI arguments
|
||||
while getopts "hcp:" option; do
|
||||
case "${option}" in
|
||||
h) echo "${usage}"
|
||||
exit 0
|
||||
;;
|
||||
c) enable_confirmation=true
|
||||
;;
|
||||
p) preferred_launcher="${OPTARG}"
|
||||
check_launcher "${preferred_launcher}"
|
||||
;;
|
||||
*) exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Check whether a command exists
|
||||
function command_exists() {
|
||||
command -v "$1" &> /dev/null 2>&1
|
||||
}
|
||||
|
||||
# systemctl required
|
||||
if ! command_exists systemctl ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# menu defined as an associative array
|
||||
typeset -A menu
|
||||
|
||||
# Menu with keys/commands
|
||||
|
||||
menu=(
|
||||
[ Shutdown]="systemctl poweroff"
|
||||
[ Reboot]="systemctl reboot"
|
||||
[ Suspend]="systemctl suspend"
|
||||
[ Hibernate]="systemctl hibernate"
|
||||
[ Lock]="~/.config/i3/scripts/blur-lock"
|
||||
[ Logout]="i3-msg exit"
|
||||
[ Cancel]=""
|
||||
)
|
||||
|
||||
menu_nrows=${#menu[@]}
|
||||
|
||||
# Menu entries that may trigger a confirmation message
|
||||
menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout"
|
||||
|
||||
launcher_exe=""
|
||||
launcher_options=""
|
||||
rofi_colors=""
|
||||
|
||||
function prepare_launcher() {
|
||||
if [[ "$1" == "rofi" ]]; then
|
||||
rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \
|
||||
-hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}")
|
||||
launcher_exe="rofi"
|
||||
launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \
|
||||
"${rofi_colors}" "${ROFI_OPTIONS[@]}")
|
||||
elif [[ "$1" == "zenity" ]]; then
|
||||
launcher_exe="zenity"
|
||||
launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \
|
||||
"${ZENITY_OPTIONS[@]}")
|
||||
fi
|
||||
}
|
||||
|
||||
for l in "${launcher_list[@]}"; do
|
||||
if command_exists "${l}" ; then
|
||||
prepare_launcher "${l}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# No launcher available
|
||||
if [[ -z "${launcher_exe}" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
launcher=(${launcher_exe} "${launcher_options[@]}")
|
||||
selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")"
|
||||
|
||||
function ask_confirmation() {
|
||||
if [ "${launcher_exe}" == "rofi" ]; then
|
||||
confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \
|
||||
"${rofi_colors}" "${ROFI_OPTIONS[@]}")
|
||||
[ "${confirmed}" == "Yes" ] && confirmed=0
|
||||
elif [ "${launcher_exe}" == "zenity" ]; then
|
||||
zenity --question --text "Are you sure you want to ${selection,,}?"
|
||||
confirmed=$?
|
||||
fi
|
||||
|
||||
if [ "${confirmed}" == 0 ]; then
|
||||
i3-msg -q "exec --no-startup-id ${menu[${selection}]}"
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ $? -eq 0 && ! -z ${selection} ]]; then
|
||||
if [[ "${enable_confirmation}" = true && \
|
||||
${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then
|
||||
ask_confirmation
|
||||
else
|
||||
i3-msg -q "exec --no-startup-id ${menu[${selection}]}"
|
||||
fi
|
||||
fi
|
11
i3/scripts/ppd-status
Executable file
11
i3/scripts/ppd-status
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# power-profiles-daemon implementation:
|
||||
# needs package power-profiles-daemon installed and the service running see here:
|
||||
# https://wiki.archlinux.org/title/CPU_frequency_scaling#power-profiles-daemon
|
||||
# used in i3-blocks: ~/.config/i3/i3blocks.conf together with: ~/.config/i3/scripts/power-profiles
|
||||
|
||||
# script to show current power profile
|
||||
|
||||
current_profile=$(/usr/bin/powerprofilesctl get)
|
||||
echo ""
|
2
i3/scripts/run-background-randomize
Executable file
2
i3/scripts/run-background-randomize
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
~/.config/i3/scripts/background-randomize ~/.config/i3/background/india 600 &
|
86
i3/scripts/temperature
Executable file
86
i3/scripts/temperature
Executable file
|
@ -0,0 +1,86 @@
|
|||
#!/usr/bin/env perl
|
||||
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
|
||||
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
|
||||
# Copyright 2014 Andreas Guldstrand <andreas.guldstrand@gmail.com>
|
||||
# Copyright 2014 Benjamin Chretien <chretien at lirmm dot fr>
|
||||
|
||||
# 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/>.
|
||||
#
|
||||
# Edited by Andreas Lindlbauer <endeavouros.mousily@aleeas.com>
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
use Getopt::Long;
|
||||
|
||||
binmode(STDOUT, ":utf8");
|
||||
|
||||
# default values
|
||||
my $t_warn = $ENV{T_WARN} || 70;
|
||||
my $t_crit = $ENV{T_CRIT} || 90;
|
||||
my $chip = $ENV{SENSOR_CHIP} || "";
|
||||
my $temperature = -9999;
|
||||
my $label = "😀 ";
|
||||
|
||||
sub help {
|
||||
print "Usage: temperature [-w <warning>] [-c <critical>] [--chip <chip>]\n";
|
||||
print "-w <percent>: warning threshold to become yellow\n";
|
||||
print "-c <percent>: critical threshold to become red\n";
|
||||
print "--chip <chip>: sensor chip\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
GetOptions("help|h" => \&help,
|
||||
"w=i" => \$t_warn,
|
||||
"c=i" => \$t_crit,
|
||||
"chip=s" => \$chip);
|
||||
|
||||
# Get chip temperature
|
||||
open (SENSORS, "sensors -u $chip |") or die;
|
||||
while (<SENSORS>) {
|
||||
if (/^\s+temp1_input:\s+[\+]*([\-]*\d+\.\d)/) {
|
||||
$temperature = $1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
close(SENSORS);
|
||||
|
||||
$temperature eq -9999 and die 'Cannot find temperature';
|
||||
|
||||
if ($temperature < 45) {
|
||||
$label = '';
|
||||
} elsif ($temperature < 55) {
|
||||
$label = '';
|
||||
} elsif ($temperature < 65) {
|
||||
$label = '';
|
||||
} elsif ($temperature < 75) {
|
||||
$label = '';
|
||||
} else {
|
||||
$label = '';
|
||||
}
|
||||
# Print short_text, full_text
|
||||
print "${label}";
|
||||
print " $temperature°C\n";
|
||||
print "${label}";
|
||||
print " $temperature°C\n";
|
||||
|
||||
# Print color, if needed
|
||||
if ($temperature >= $t_crit) {
|
||||
print "#FF0000\n";
|
||||
exit 33;
|
||||
} elsif ($temperature >= $t_warn) {
|
||||
print "#FFFC00\n";
|
||||
}
|
||||
|
||||
exit 0;
|
93
i3/scripts/volume
Executable file
93
i3/scripts/volume
Executable file
|
@ -0,0 +1,93 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
|
||||
# Copyright (C) 2014 Alexander Keller <github@nycroth.com>
|
||||
|
||||
# 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/>.
|
||||
|
||||
# original source: https://github.com/vivien/i3blocks-contrib/tree/master/volume
|
||||
# check the readme: https://github.com/vivien/i3blocks-contrib/blob/master/volume/README.md
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
# The second parameter overrides the mixer selection
|
||||
# For PulseAudio users, eventually 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
|
||||
if [[ -z "$MIXER" ]] ; then
|
||||
MIXER="default"
|
||||
if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then
|
||||
# pulseaudio is running, but not all installations use "pulse"
|
||||
if amixer -D pulse info >/dev/null 2>&1 ; then
|
||||
MIXER="pulse"
|
||||
fi
|
||||
fi
|
||||
[ -n "$(lsmod | grep jack)" ] && MIXER="jackplug"
|
||||
MIXER="${2:-$MIXER}"
|
||||
fi
|
||||
|
||||
# The instance option sets the control to report and configure
|
||||
# This defaults to the first control of your selected mixer
|
||||
# For a list of the available, use `amixer -D $Your_Mixer scontrols`
|
||||
if [[ -z "$SCONTROL" ]] ; then
|
||||
SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols |
|
||||
sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" |
|
||||
head -n1
|
||||
)}"
|
||||
fi
|
||||
|
||||
# The first parameter sets the step to change the volume by (and units to display)
|
||||
# This may be in in % or dB (eg. 5% or 3dB)
|
||||
if [[ -z "$STEP" ]] ; then
|
||||
STEP="${1:-5%}"
|
||||
fi
|
||||
|
||||
# AMIXER(1):
|
||||
# "Use the mapped volume for evaluating the percentage representation like alsamixer, to be
|
||||
# more natural for human ear."
|
||||
NATURAL_MAPPING=${NATURAL_MAPPING:-0}
|
||||
if [[ "$NATURAL_MAPPING" != "0" ]] ; then
|
||||
AMIXER_PARAMS="-M"
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
capability() { # Return "Capture" if the device is a capture device
|
||||
amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL |
|
||||
sed -n "s/ Capabilities:.*cvolume.*/Capture/p"
|
||||
}
|
||||
|
||||
volume() {
|
||||
amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL $(capability)
|
||||
}
|
||||
|
||||
format() {
|
||||
|
||||
perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)'
|
||||
perl_filter+='{CORE::say $4 eq "off" ? "MUTE" : "'
|
||||
# If dB was selected, print that instead
|
||||
perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1')
|
||||
perl_filter+='"; exit}'
|
||||
output=$(perl -ne "$perl_filter")
|
||||
echo "$LABEL$output"
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
3) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute
|
||||
4) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase
|
||||
5) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease
|
||||
esac
|
||||
|
||||
volume | format
|
96
i3/scripts/volume_brightness.sh
Executable file
96
i3/scripts/volume_brightness.sh
Executable file
|
@ -0,0 +1,96 @@
|
|||
#!/bin/bash
|
||||
# original source: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator
|
||||
|
||||
# taken from here: https://gitlab.com/Nmoleo/i3-volume-brightness-indicator
|
||||
|
||||
# See README.md for usage instructions
|
||||
bar_color="#7f7fff"
|
||||
volume_step=1
|
||||
brightness_step=5
|
||||
max_volume=100
|
||||
|
||||
# Uses regex to get volume from pactl
|
||||
function get_volume {
|
||||
pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '[0-9]{1,3}(?=%)' | head -1
|
||||
}
|
||||
|
||||
# Uses regex to get mute status from pactl
|
||||
function get_mute {
|
||||
pactl get-sink-mute @DEFAULT_SINK@ | grep -Po '(?<=Mute: )(yes|no)'
|
||||
}
|
||||
|
||||
# Uses regex to get brightness from xbacklight
|
||||
function get_brightness {
|
||||
brightnessctl | grep -Po '[0-9]{1,3}%' | head -n 1
|
||||
}
|
||||
|
||||
# Returns a mute icon, a volume-low icon, or a volume-high icon, depending on the volume
|
||||
function get_volume_icon {
|
||||
volume=$(get_volume)
|
||||
mute=$(get_mute)
|
||||
if [ "$volume" -eq 0 ] || [ "$mute" == "yes" ] ; then
|
||||
volume_icon=""
|
||||
elif [ "$volume" -lt 50 ]; then
|
||||
volume_icon=""
|
||||
else
|
||||
volume_icon=""
|
||||
fi
|
||||
}
|
||||
|
||||
# Always returns the same icon - I couldn't get the brightness-low icon to work with fontawesome
|
||||
function get_brightness_icon {
|
||||
brightness_icon=""
|
||||
}
|
||||
|
||||
# Displays a volume notification using dunstify
|
||||
function show_volume_notif {
|
||||
volume=$(get_mute)
|
||||
get_volume_icon
|
||||
dunstify -i audio-volume-muted-blocking -t 1000 -r 2593 -u normal "$volume_icon $volume%" -h int:value:$volume -h string:hlcolor:$bar_color
|
||||
}
|
||||
|
||||
# Displays a brightness notification using dunstify
|
||||
function show_brightness_notif {
|
||||
brightness=$(get_brightness)
|
||||
get_brightness_icon
|
||||
dunstify -t 1000 -r 2593 -u normal "$brightness_icon $brightness" -h int:value:$brightness -h string:hlcolor:$bar_color
|
||||
}
|
||||
|
||||
# Main function - Takes user input, "volume_up", "volume_down", "brightness_up", or "brightness_down"
|
||||
case $1 in
|
||||
volume_up)
|
||||
# Unmutes and increases volume, then displays the notification
|
||||
pactl set-sink-mute @DEFAULT_SINK@ 0
|
||||
volume=$(get_volume)
|
||||
if [ $(( "$volume" + "$volume_step" )) -gt $max_volume ]; then
|
||||
pactl set-sink-volume @DEFAULT_SINK@ $max_volume%
|
||||
else
|
||||
pactl set-sink-volume @DEFAULT_SINK@ +$volume_step%
|
||||
fi
|
||||
show_volume_notif
|
||||
;;
|
||||
|
||||
volume_down)
|
||||
# Raises volume and displays the notification
|
||||
pactl set-sink-volume @DEFAULT_SINK@ -$volume_step%
|
||||
show_volume_notif
|
||||
;;
|
||||
|
||||
volume_mute)
|
||||
# Toggles mute and displays the notification
|
||||
pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||
show_volume_notif
|
||||
;;
|
||||
|
||||
brightness_up)
|
||||
# Increases brightness and displays the notification
|
||||
brightnessctl set +$brightness_step%
|
||||
show_brightness_notif
|
||||
;;
|
||||
|
||||
brightness_down)
|
||||
# Decreases brightness and displays the notification
|
||||
brightnessctl set $brightness_step%-
|
||||
show_brightness_notif
|
||||
;;
|
||||
esac
|
25
i3/scripts/vpn
Executable file
25
i3/scripts/vpn
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (C) 2021 Andreas Lindlbauer
|
||||
# Licensed under the terms of EUPLv1.2.
|
||||
#
|
||||
# i3blocks blocklet script to monitor the (nord)vpn connection
|
||||
|
||||
vpnstatus="📢"
|
||||
nordvpn_output=$(nordvpn status | cat -v | head -1 | sed -e 's/\^M-^M ^M//g' )
|
||||
if [ "${nordvpn_output}" = "Status: Connected" ]; then
|
||||
vpnstatus="🥸"
|
||||
elif [ "${nordvpn_output}" = "A new version of NordVPN is available! Please update the application." ]; then
|
||||
nordvpn_output=$(nordvpn status | cat -v | head -2 | tail -1 | sed -e 's/\^M-^M ^M//g' )
|
||||
if [ "${nordvpn_output}" = "Status: Connected" ]; then
|
||||
vpnstatus="🥴"
|
||||
elif [ "${nordvpn_output}" = "Status: Disconnected" ]; then
|
||||
vpnstatus="📢"
|
||||
fi
|
||||
elif [ "${nordvpn_output}" = "Status: Disconnected" ]; then
|
||||
vpnstatus="📢"
|
||||
elif [[ "$nordvpn_output" == *\/* ]] || [[ "$nordvpn_output" == *\\* ]]; then
|
||||
vpnstatus="Something's very wrong"
|
||||
fi
|
||||
|
||||
echo "$vpnstatus"
|
417
picom/picom.conf
Normal file
417
picom/picom.conf
Normal file
|
@ -0,0 +1,417 @@
|
|||
#################################
|
||||
# Shadows #
|
||||
#################################
|
||||
|
||||
|
||||
# Enabled client-side shadows on windows. Note desktop windows
|
||||
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
|
||||
# unless explicitly requested using the wintypes option.
|
||||
#
|
||||
# shadow = false
|
||||
shadow = true;
|
||||
|
||||
# The blur radius for shadows, in pixels. (defaults to 12)
|
||||
# shadow-radius = 12
|
||||
shadow-radius = 7;
|
||||
|
||||
# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
|
||||
# shadow-opacity = .75
|
||||
|
||||
# The left offset for shadows, in pixels. (defaults to -15)
|
||||
# shadow-offset-x = -15
|
||||
shadow-offset-x = -7;
|
||||
|
||||
# The top offset for shadows, in pixels. (defaults to -15)
|
||||
# shadow-offset-y = -15
|
||||
shadow-offset-y = -7;
|
||||
|
||||
# Red color value of shadow (0.0 - 1.0, defaults to 0).
|
||||
# shadow-red = 0
|
||||
|
||||
# Green color value of shadow (0.0 - 1.0, defaults to 0).
|
||||
# shadow-green = 0
|
||||
|
||||
# Blue color value of shadow (0.0 - 1.0, defaults to 0).
|
||||
# shadow-blue = 0
|
||||
|
||||
# Hex string color value of shadow (#000000 - #FFFFFF, defaults to #000000). This option will override options set shadow-(red/green/blue)
|
||||
# shadow-color = "#000000"
|
||||
|
||||
# Specify a list of conditions of windows that should have no shadow.
|
||||
# shadow-exclude = []
|
||||
shadow-exclude = [
|
||||
"name = 'Notification'",
|
||||
"class_g = 'Conky'",
|
||||
"class_g ?= 'Notify-osd'",
|
||||
"class_g = 'Cairo-clock'"
|
||||
];
|
||||
|
||||
# Specify a list of conditions of windows that should have no shadow painted over, such as a dock window.
|
||||
# clip-shadow-above = []
|
||||
|
||||
# Crop shadow of a window fully on a particular monitor to that monitor. This is
|
||||
# currently implemented using the X RandR extension.
|
||||
# crop-shadow-to-monitor = false
|
||||
|
||||
|
||||
#################################
|
||||
# Fading #
|
||||
#################################
|
||||
|
||||
|
||||
# Fade windows in/out when opening/closing and when opacity changes,
|
||||
# unless no-fading-openclose is used.
|
||||
# fading = false
|
||||
fading = true;
|
||||
|
||||
# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
|
||||
# fade-in-step = 0.028
|
||||
fade-in-step = 0.03;
|
||||
|
||||
# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
|
||||
# fade-out-step = 0.03
|
||||
fade-out-step = 0.03;
|
||||
|
||||
# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
|
||||
fade-delta = 10
|
||||
|
||||
# Specify a list of conditions of windows that should not be faded.
|
||||
# fade-exclude = []
|
||||
|
||||
# Do not fade on window open/close.
|
||||
# no-fading-openclose = false
|
||||
|
||||
# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
|
||||
# no-fading-destroyed-argb = false
|
||||
|
||||
|
||||
#################################
|
||||
# Transparency / Opacity #
|
||||
#################################
|
||||
|
||||
|
||||
# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
|
||||
# inactive-opacity = 1
|
||||
inactive-opacity = 0.95;
|
||||
|
||||
# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
|
||||
# frame-opacity = 1.0
|
||||
|
||||
# Let inactive opacity set by -i override the '_NET_WM_WINDOW_OPACITY' values of windows.
|
||||
# inactive-opacity-override = true
|
||||
inactive-opacity-override = false;
|
||||
|
||||
# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
|
||||
# active-opacity = 1.0
|
||||
|
||||
# Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
|
||||
# inactive-dim = 0.1
|
||||
|
||||
# Specify a list of conditions of windows that should never be considered focused.
|
||||
# focus-exclude = []
|
||||
focus-exclude = [ "class_g = 'Cairo-clock'" ];
|
||||
|
||||
# Use fixed inactive dim value, instead of adjusting according to window opacity.
|
||||
# inactive-dim-fixed = 1.0
|
||||
|
||||
# Specify a list of opacity rules, in the format `PERCENT:PATTERN`,
|
||||
# like `50:name *= "Firefox"`. picom-trans is recommended over this.
|
||||
# Note we don't make any guarantee about possible conflicts with other
|
||||
# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
|
||||
# example:
|
||||
# opacity-rule = [ "80:class_g = 'URxvt'" ];
|
||||
#
|
||||
# opacity-rule = []
|
||||
|
||||
|
||||
#################################
|
||||
# Corners #
|
||||
#################################
|
||||
|
||||
# Sets the radius of rounded window corners. When > 0, the compositor will
|
||||
# round the corners of windows. Does not interact well with
|
||||
# `transparent-clipping`.
|
||||
# corner-radius = 15
|
||||
|
||||
# Exclude conditions for rounded corners.
|
||||
rounded-corners-exclude = [
|
||||
"window_type = 'dock'",
|
||||
"window_type = 'desktop'"
|
||||
];
|
||||
|
||||
|
||||
#################################
|
||||
# Background-Blurring #
|
||||
#################################
|
||||
|
||||
|
||||
# Parameters for background blurring, see the *BLUR* section for more information.
|
||||
# blur-method =
|
||||
# blur-size = 12
|
||||
#
|
||||
# blur-deviation = false
|
||||
#
|
||||
# blur-strength = 5
|
||||
|
||||
# Blur background of semi-transparent / ARGB windows.
|
||||
# Bad in performance, with driver-dependent behavior.
|
||||
# The name of the switch may change without prior notifications.
|
||||
#
|
||||
# blur-background = true
|
||||
|
||||
# Blur background of windows when the window frame is not opaque.
|
||||
# Implies:
|
||||
# blur-background
|
||||
# Bad in performance, with driver-dependent behavior. The name may change.
|
||||
#
|
||||
# blur-background-frame = false
|
||||
|
||||
|
||||
# Use fixed blur strength rather than adjusting according to window opacity.
|
||||
# blur-background-fixed = false
|
||||
|
||||
|
||||
# Specify the blur convolution kernel, with the following format:
|
||||
# example:
|
||||
# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
|
||||
#
|
||||
# blur-kern = ""
|
||||
blur-kern = "3x3box";
|
||||
|
||||
|
||||
# Exclude conditions for background blur.
|
||||
# blur-background-exclude = []
|
||||
blur-background-exclude = [
|
||||
"window_type = 'dock'",
|
||||
"window_type = 'desktop'"
|
||||
];
|
||||
|
||||
#################################
|
||||
# General Settings #
|
||||
#################################
|
||||
|
||||
# Enable remote control via D-Bus. See the man page for more details.
|
||||
# dbus = true
|
||||
|
||||
# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
|
||||
# daemon = false
|
||||
|
||||
# Specify the backend to use: `xrender`, `glx`, `egl` or `xr_glx_hybrid`.
|
||||
# `xrender` is the default one.
|
||||
#
|
||||
# backend = "glx"
|
||||
backend = "xr_glx_hybrid";
|
||||
|
||||
# Use higher precision during rendering, and apply dither when presenting the
|
||||
# rendered screen. Reduces banding artifacts, but might cause performance
|
||||
# degradation. Only works with OpenGL.
|
||||
dithered-present = false;
|
||||
|
||||
# Enable/disable VSync.
|
||||
# vsync = false
|
||||
vsync = true;
|
||||
|
||||
# Try to detect WM windows (a non-override-redirect window with no
|
||||
# child that has 'WM_STATE') and mark them as active.
|
||||
#
|
||||
# mark-wmwin-focused = false
|
||||
mark-wmwin-focused = true;
|
||||
|
||||
# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused.
|
||||
# mark-ovredir-focused = false
|
||||
mark-ovredir-focused = true;
|
||||
|
||||
# Try to detect windows with rounded corners and don't consider them
|
||||
# shaped windows. The accuracy is not very high, unfortunately.
|
||||
#
|
||||
# detect-rounded-corners = false
|
||||
detect-rounded-corners = true;
|
||||
|
||||
# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers
|
||||
# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows.
|
||||
#
|
||||
# detect-client-opacity = false
|
||||
detect-client-opacity = true;
|
||||
|
||||
# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
|
||||
# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
|
||||
# provided that the WM supports it.
|
||||
#
|
||||
# use-ewmh-active-win = false
|
||||
|
||||
# Unredirect all windows if a full-screen opaque window is detected,
|
||||
# to maximize performance for full-screen windows. Known to cause flickering
|
||||
# when redirecting/unredirecting windows.
|
||||
#
|
||||
# unredir-if-possible = false
|
||||
|
||||
# Delay before unredirecting the window, in milliseconds. Defaults to 0.
|
||||
# unredir-if-possible-delay = 0
|
||||
|
||||
# Conditions of windows that shouldn't be considered full-screen for unredirecting screen.
|
||||
# unredir-if-possible-exclude = []
|
||||
|
||||
# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
|
||||
# in the same group focused at the same time.
|
||||
#
|
||||
# detect-transient = false
|
||||
detect-transient = true;
|
||||
|
||||
# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
|
||||
# group focused at the same time. This usually means windows from the same application
|
||||
# will be considered focused or unfocused at the same time.
|
||||
# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too.
|
||||
#
|
||||
# detect-client-leader = false
|
||||
|
||||
# Resize damaged region by a specific number of pixels.
|
||||
# A positive value enlarges it while a negative one shrinks it.
|
||||
# If the value is positive, those additional pixels will not be actually painted
|
||||
# to screen, only used in blur calculation, and such. (Due to technical limitations,
|
||||
# with use-damage, those pixels will still be incorrectly painted to screen.)
|
||||
# Primarily used to fix the line corruption issues of blur,
|
||||
# in which case you should use the blur radius value here
|
||||
# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`,
|
||||
# with a 5x5 one you use `--resize-damage 2`, and so on).
|
||||
# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly.
|
||||
#
|
||||
# resize-damage = 1
|
||||
|
||||
# Specify a list of conditions of windows that should be painted with inverted color.
|
||||
# Resource-hogging, and is not well tested.
|
||||
#
|
||||
# invert-color-include = []
|
||||
|
||||
# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer.
|
||||
# Might cause incorrect opacity when rendering transparent content (but never
|
||||
# practically happened) and may not work with blur-background.
|
||||
# My tests show a 15% performance boost. Recommended.
|
||||
#
|
||||
# glx-no-stencil = false
|
||||
|
||||
# GLX backend: Avoid rebinding pixmap on window damage.
|
||||
# Probably could improve performance on rapid window content changes,
|
||||
# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.).
|
||||
# Recommended if it works.
|
||||
#
|
||||
# glx-no-rebind-pixmap = false
|
||||
|
||||
# Disable the use of damage information.
|
||||
# This cause the whole screen to be redrawn every time, instead of the part of the screen
|
||||
# has actually changed. Potentially degrades the performance, but might fix some artifacts.
|
||||
# The opposing option is use-damage
|
||||
#
|
||||
# no-use-damage = false
|
||||
use-damage = true;
|
||||
|
||||
# Use X Sync fence to sync clients' draw calls, to make sure all draw
|
||||
# calls are finished before picom starts drawing. Needed on nvidia-drivers
|
||||
# with GLX backend for some users.
|
||||
#
|
||||
# xrender-sync-fence = false
|
||||
|
||||
# GLX backend: Use specified GLSL fragment shader for rendering window
|
||||
# contents. Read the man page for a detailed explanation of the interface.
|
||||
#
|
||||
# window-shader-fg = "default"
|
||||
|
||||
# Use rules to set per-window shaders. Syntax is SHADER_PATH:PATTERN, similar
|
||||
# to opacity-rule. SHADER_PATH can be "default". This overrides window-shader-fg.
|
||||
#
|
||||
# window-shader-fg-rule = [
|
||||
# "my_shader.frag:window_type != 'dock'"
|
||||
# ]
|
||||
|
||||
# Force all windows to be painted with blending. Useful if you
|
||||
# have a glx-fshader-win that could turn opaque pixels transparent.
|
||||
#
|
||||
# force-win-blend = false
|
||||
|
||||
# Do not use EWMH to detect fullscreen windows.
|
||||
# Reverts to checking if a window is fullscreen based only on its size and coordinates.
|
||||
#
|
||||
# no-ewmh-fullscreen = false
|
||||
|
||||
# Dimming bright windows so their brightness doesn't exceed this set value.
|
||||
# Brightness of a window is estimated by averaging all pixels in the window,
|
||||
# so this could comes with a performance hit.
|
||||
# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0)
|
||||
#
|
||||
# max-brightness = 1.0
|
||||
|
||||
# Make transparent windows clip other windows like non-transparent windows do,
|
||||
# instead of blending on top of them.
|
||||
#
|
||||
# transparent-clipping = false
|
||||
|
||||
# Specify a list of conditions of windows that should never have transparent
|
||||
# clipping applied. Useful for screenshot tools, where you need to be able to
|
||||
# see through transparent parts of the window.
|
||||
#
|
||||
# transparent-clipping-exclude = []
|
||||
|
||||
# Set the log level. Possible values are:
|
||||
# "trace", "debug", "info", "warn", "error"
|
||||
# in increasing level of importance. Case doesn't matter.
|
||||
# If using the "TRACE" log level, it's better to log into a file
|
||||
# using *--log-file*, since it can generate a huge stream of logs.
|
||||
#
|
||||
# log-level = "debug"
|
||||
log-level = "warn";
|
||||
|
||||
# Set the log file.
|
||||
# If *--log-file* is never specified, logs will be written to stderr.
|
||||
# Otherwise, logs will to written to the given file, though some of the early
|
||||
# logs might still be written to the stderr.
|
||||
# When setting this option from the config file, it is recommended to use an absolute path.
|
||||
#
|
||||
# log-file = "/path/to/your/log/file"
|
||||
|
||||
# Show all X errors (for debugging)
|
||||
# show-all-xerrors = false
|
||||
|
||||
# Write process ID to a file.
|
||||
# write-pid-path = "/path/to/your/log/file"
|
||||
|
||||
# Window type settings
|
||||
#
|
||||
# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard:
|
||||
# "unknown", "desktop", "dock", "toolbar", "menu", "utility",
|
||||
# "splash", "dialog", "normal", "dropdown_menu", "popup_menu",
|
||||
# "tooltip", "notification", "combo", and "dnd".
|
||||
#
|
||||
# Following per window-type options are available: ::
|
||||
#
|
||||
# fade, shadow:::
|
||||
# Controls window-type-specific shadow and fade settings.
|
||||
#
|
||||
# opacity:::
|
||||
# Controls default opacity of the window type.
|
||||
#
|
||||
# focus:::
|
||||
# Controls whether the window of this type is to be always considered focused.
|
||||
# (By default, all window types except "normal" and "dialog" has this on.)
|
||||
#
|
||||
# full-shadow:::
|
||||
# Controls whether shadow is drawn under the parts of the window that you
|
||||
# normally won't be able to see. Useful when the window has parts of it
|
||||
# transparent, and you want shadows in those areas.
|
||||
#
|
||||
# clip-shadow-above:::
|
||||
# Controls whether shadows that would have been drawn above the window should
|
||||
# be clipped. Useful for dock windows that should have no shadow painted on top.
|
||||
#
|
||||
# redir-ignore:::
|
||||
# Controls whether this type of windows should cause screen to become
|
||||
# redirected again after been unredirected. If you have unredir-if-possible
|
||||
# set, and doesn't want certain window to cause unnecessary screen redirection,
|
||||
# you can set this to `true`.
|
||||
#
|
||||
wintypes:
|
||||
{
|
||||
tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
|
||||
dock = { shadow = false; clip-shadow-above = true; }
|
||||
dnd = { shadow = false; }
|
||||
popup_menu = { opacity = 0.8; }
|
||||
dropdown_menu = { opacity = 0.8; }
|
||||
};
|
34
rofi/arc_dark_colors.rasi
Normal file
34
rofi/arc_dark_colors.rasi
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*******************************************************
|
||||
* ROFI Arc Dark colors for EndeavourOS
|
||||
* Maintainer: joekamprad [joekamprad //a_t// endeavouros.com]
|
||||
*******************************************************/
|
||||
* {
|
||||
selected-normal-foreground: rgba ( 249, 249, 249, 100 % );
|
||||
foreground: rgba ( 196, 203, 212, 100 % );
|
||||
normal-foreground: @foreground;
|
||||
alternate-normal-background: rgba ( 64, 69, 82, 59 % );
|
||||
red: rgba ( 220, 50, 47, 100 % );
|
||||
selected-urgent-foreground: rgba ( 249, 249, 249, 100 % );
|
||||
blue: rgba ( 38, 139, 210, 100 % );
|
||||
urgent-foreground: rgba ( 204, 102, 102, 100 % );
|
||||
alternate-urgent-background: rgba ( 75, 81, 96, 90 % );
|
||||
active-foreground: rgba ( 101, 172, 255, 100 % );
|
||||
lightbg: rgba ( 238, 232, 213, 100 % );
|
||||
selected-active-foreground: rgba ( 249, 249, 249, 100 % );
|
||||
alternate-active-background: rgba ( 75, 81, 96, 89 % );
|
||||
background: rgba ( 45, 48, 59, 95 % );
|
||||
alternate-normal-foreground: @foreground;
|
||||
normal-background: @background;
|
||||
lightfg: rgba ( 88, 104, 117, 100 % );
|
||||
selected-normal-background: rgba ( 64, 132, 214, 100 % );
|
||||
border-color: rgba ( 124, 131, 137, 100 % );
|
||||
spacing: 2;
|
||||
separatorcolor: rgba ( 29, 31, 33, 100 % );
|
||||
urgent-background: rgba ( 29, 31, 33, 17 % );
|
||||
selected-urgent-background: rgba ( 165, 66, 66, 100 % );
|
||||
alternate-urgent-foreground: @urgent-foreground;
|
||||
background-color: rgba ( 0, 0, 0, 0 % );
|
||||
alternate-active-foreground: @active-foreground;
|
||||
active-background: rgba ( 29, 31, 33, 17 % );
|
||||
selected-active-background: rgba ( 68, 145, 237, 100 % );
|
||||
}
|
34
rofi/arc_dark_transparent_colors.rasi
Normal file
34
rofi/arc_dark_transparent_colors.rasi
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*******************************************************
|
||||
* ROFI Arch Dark Transparent colors for EndeavourOS
|
||||
* Maintainer: joekamprad [joekamprad //a_t// endeavouros.com]
|
||||
*******************************************************/
|
||||
* {
|
||||
selected-normal-foreground: rgba ( 255, 147, 5, 100 % );
|
||||
foreground: rgba ( 196, 203, 212, 100 % );
|
||||
normal-foreground: @foreground;
|
||||
alternate-normal-background: rgba ( 45, 48, 59, 1 % );
|
||||
red: rgba ( 220, 50, 47, 100 % );
|
||||
selected-urgent-foreground: rgba ( 249, 249, 249, 100 % );
|
||||
blue: rgba ( 38, 139, 210, 100 % );
|
||||
urgent-foreground: rgba ( 204, 102, 102, 100 % );
|
||||
alternate-urgent-background: rgba ( 75, 81, 96, 90 % );
|
||||
active-foreground: rgba ( 101, 172, 255, 100 % );
|
||||
lightbg: rgba ( 238, 232, 213, 100 % );
|
||||
selected-active-foreground: rgba ( 249, 249, 249, 100 % );
|
||||
alternate-active-background: rgba ( 45, 48, 59, 88 % );
|
||||
background: rgba ( 45, 48, 59, 88 % );
|
||||
alternate-normal-foreground: @foreground;
|
||||
normal-background: rgba ( 45, 48, 59, 1 % );
|
||||
lightfg: rgba ( 88, 104, 117, 100 % );
|
||||
selected-normal-background: rgba ( 24, 26, 32, 100 % );
|
||||
border-color: rgba ( 124, 131, 137, 100 % );
|
||||
spacing: 2;
|
||||
separatorcolor: rgba ( 45, 48, 59, 1 % );
|
||||
urgent-background: rgba ( 45, 48, 59, 15 % );
|
||||
selected-urgent-background: rgba ( 165, 66, 66, 100 % );
|
||||
alternate-urgent-foreground: @urgent-foreground;
|
||||
background-color: rgba ( 0, 0, 0, 0 % );
|
||||
alternate-active-foreground: @active-foreground;
|
||||
active-background: rgba ( 29, 31, 33, 17 % );
|
||||
selected-active-background: rgba ( 26, 28, 35, 100 % );
|
||||
}
|
121
rofi/power-profiles.rasi
Normal file
121
rofi/power-profiles.rasi
Normal file
|
@ -0,0 +1,121 @@
|
|||
/*******************************************************
|
||||
* ROFI configs i3 powermenu for EndeavourOS
|
||||
* Maintainer: joekamprad [joekamprad //a_t// endeavouros.com]
|
||||
*******************************************************/
|
||||
configuration {
|
||||
font: "Noto Sans Regular 10";
|
||||
show-icons: false;
|
||||
icon-theme: "Qogir";
|
||||
scroll-method: 0;
|
||||
disable-history: false;
|
||||
fullscreen: false;
|
||||
hide-scrollbar: true;
|
||||
sidebar-mode: false;
|
||||
}
|
||||
|
||||
@import "~/.config/rofi/arc_dark_colors.rasi"
|
||||
|
||||
|
||||
window {
|
||||
background-color: @background;
|
||||
border: 0;
|
||||
padding: 10;
|
||||
transparency: "real";
|
||||
width: 170px;
|
||||
location: east;
|
||||
/*y-offset: 18;*/
|
||||
/*x-offset: 850;*/
|
||||
}
|
||||
listview {
|
||||
lines: 4;
|
||||
columns: 1;
|
||||
}
|
||||
element {
|
||||
border: 0;
|
||||
padding: 1px;
|
||||
}
|
||||
element-text {
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
element.normal.normal {
|
||||
background-color: @normal-background;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
element.normal.urgent {
|
||||
background-color: @urgent-background;
|
||||
text-color: @urgent-foreground;
|
||||
}
|
||||
element.normal.active {
|
||||
background-color: @active-background;
|
||||
text-color: @active-foreground;
|
||||
}
|
||||
element.selected.normal {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
element.selected.urgent {
|
||||
background-color: @selected-urgent-background;
|
||||
text-color: @selected-urgent-foreground;
|
||||
}
|
||||
element.selected.active {
|
||||
background-color: @selected-active-background;
|
||||
text-color: @selected-active-foreground;
|
||||
}
|
||||
element.alternate.normal {
|
||||
background-color: @alternate-normal-background;
|
||||
text-color: @alternate-normal-foreground;
|
||||
}
|
||||
element.alternate.urgent {
|
||||
background-color: @alternate-urgent-background;
|
||||
text-color: @alternate-urgent-foreground;
|
||||
}
|
||||
element.alternate.active {
|
||||
background-color: @alternate-active-background;
|
||||
text-color: @alternate-active-foreground;
|
||||
}
|
||||
scrollbar {
|
||||
width: 4px;
|
||||
border: 0;
|
||||
handle-color: @normal-foreground;
|
||||
handle-width: 8px;
|
||||
padding: 0;
|
||||
}
|
||||
mode-switcher {
|
||||
border: 2px 0px 0px;
|
||||
border-color: @separatorcolor;
|
||||
}
|
||||
button {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
button.selected {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
inputbar {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
padding: 1px;
|
||||
}
|
||||
case-indicator {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
entry {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
prompt {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
inputbar {
|
||||
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
|
||||
}
|
||||
textbox-prompt-colon {
|
||||
expand: false;
|
||||
str: "Set Power Profile:";
|
||||
margin: 0px 0.3em 0em 0em;
|
||||
text-color: @normal-foreground;
|
||||
}
|
124
rofi/powermenu.rasi
Normal file
124
rofi/powermenu.rasi
Normal file
|
@ -0,0 +1,124 @@
|
|||
/*******************************************************
|
||||
* ROFI configs i3 powermenu for EndeavourOS
|
||||
* Maintainer: joekamprad [joekamprad //a_t// endeavouros.com]
|
||||
*******************************************************/
|
||||
configuration {
|
||||
font: "Noto Sans Regular 10";
|
||||
show-icons: false;
|
||||
icon-theme: "Qogir";
|
||||
scroll-method: 0;
|
||||
disable-history: false;
|
||||
sidebar-mode: false;
|
||||
}
|
||||
|
||||
@import "~/.config/rofi/arc_dark_transparent_colors.rasi"
|
||||
|
||||
window {
|
||||
background-color: @background;
|
||||
border: 0;
|
||||
padding: 10;
|
||||
transparency: "real";
|
||||
width: 120px;
|
||||
location: east;
|
||||
/*y-offset: 18;*/
|
||||
/*x-offset: 850;*/
|
||||
}
|
||||
listview {
|
||||
lines: 7;
|
||||
columns: 1;
|
||||
scrollbar: false;
|
||||
}
|
||||
element {
|
||||
border: 0;
|
||||
padding: 1px;
|
||||
}
|
||||
element-text {
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
element.normal.normal {
|
||||
background-color: @normal-background;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
element.normal.urgent {
|
||||
background-color: @urgent-background;
|
||||
text-color: @urgent-foreground;
|
||||
}
|
||||
element.normal.active {
|
||||
background-color: @active-background;
|
||||
text-color: @active-foreground;
|
||||
}
|
||||
element.selected.normal {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
element.selected.urgent {
|
||||
background-color: @selected-urgent-background;
|
||||
text-color: @selected-urgent-foreground;
|
||||
}
|
||||
element.selected.active {
|
||||
background-color: @selected-active-background;
|
||||
text-color: @selected-active-foreground;
|
||||
}
|
||||
element.alternate.normal {
|
||||
background-color: @alternate-normal-background;
|
||||
text-color: @alternate-normal-foreground;
|
||||
}
|
||||
element.alternate.urgent {
|
||||
background-color: @alternate-urgent-background;
|
||||
text-color: @alternate-urgent-foreground;
|
||||
}
|
||||
element.alternate.active {
|
||||
background-color: @alternate-active-background;
|
||||
text-color: @alternate-active-foreground;
|
||||
}
|
||||
scrollbar {
|
||||
width: 4px;
|
||||
border: 0;
|
||||
handle-color: @normal-foreground;
|
||||
handle-width: 8px;
|
||||
padding: 0;
|
||||
}
|
||||
mode-switcher {
|
||||
border: 2px 0px 0px;
|
||||
border-color: @separatorcolor;
|
||||
}
|
||||
button {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
button.selected {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
inputbar {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
padding: 1px;
|
||||
}
|
||||
case-indicator {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
entry {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
prompt {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
inputbar {
|
||||
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
|
||||
}
|
||||
textbox-prompt-colon {
|
||||
expand: false;
|
||||
str: ":";
|
||||
margin: 0px 0.3em 0em 0em;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
|
||||
/*removes the text input line*/
|
||||
mainbox {
|
||||
children: [listview];
|
||||
}
|
135
rofi/rofidmenu.rasi
Normal file
135
rofi/rofidmenu.rasi
Normal file
|
@ -0,0 +1,135 @@
|
|||
/*******************************************************
|
||||
* ROFI configs i3 Apps menu for EndeavourOS
|
||||
* Maintainer: joekamprad [joekamprad //a_t// endeavouros.com]
|
||||
*******************************************************/
|
||||
configuration {
|
||||
font: "Noto Sans Regular 10";
|
||||
show-icons: true;
|
||||
icon-theme: "Qogir";
|
||||
display-drun: "Apps";
|
||||
drun-display-format: "{name}";
|
||||
scroll-method: 0;
|
||||
disable-history: false;
|
||||
sidebar-mode: false;
|
||||
}
|
||||
|
||||
@import "~/.config/rofi/arc_dark_transparent_colors.rasi"
|
||||
|
||||
window {
|
||||
background-color: @background;
|
||||
border: 0;
|
||||
padding: 30;
|
||||
}
|
||||
listview {
|
||||
lines: 10;
|
||||
columns: 3;
|
||||
}
|
||||
mainbox {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
message {
|
||||
border: 2px 0px 0px;
|
||||
border-color: @separatorcolor;
|
||||
padding: 1px;
|
||||
}
|
||||
textbox {
|
||||
text-color: @foreground;
|
||||
}
|
||||
listview {
|
||||
fixed-height: 0;
|
||||
border: 8px 0px 0px;
|
||||
border-color: @separatorcolor;
|
||||
spacing: 8px;
|
||||
scrollbar: false;
|
||||
padding: 2px 0px 0px;
|
||||
}
|
||||
element {
|
||||
border: 0;
|
||||
padding: 1px;
|
||||
}
|
||||
element-text {
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
element.normal.normal {
|
||||
background-color: @normal-background;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
element.normal.urgent {
|
||||
background-color: @urgent-background;
|
||||
text-color: @urgent-foreground;
|
||||
}
|
||||
element.normal.active {
|
||||
background-color: @active-background;
|
||||
text-color: @active-foreground;
|
||||
}
|
||||
element.selected.normal {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
element.selected.urgent {
|
||||
background-color: @selected-urgent-background;
|
||||
text-color: @selected-urgent-foreground;
|
||||
}
|
||||
element.selected.active {
|
||||
background-color: @selected-active-background;
|
||||
text-color: @selected-active-foreground;
|
||||
}
|
||||
element.alternate.normal {
|
||||
background-color: @alternate-normal-background;
|
||||
text-color: @alternate-normal-foreground;
|
||||
}
|
||||
element.alternate.urgent {
|
||||
background-color: @alternate-urgent-background;
|
||||
text-color: @alternate-urgent-foreground;
|
||||
}
|
||||
element.alternate.active {
|
||||
background-color: @alternate-active-background;
|
||||
text-color: @alternate-active-foreground;
|
||||
}
|
||||
scrollbar {
|
||||
width: 4px;
|
||||
border: 0;
|
||||
handle-color: @normal-foreground;
|
||||
handle-width: 8px;
|
||||
padding: 0;
|
||||
}
|
||||
mode-switcher {
|
||||
border: 2px 0px 0px;
|
||||
border-color: @separatorcolor;
|
||||
}
|
||||
button {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
button.selected {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
inputbar {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
padding: 1px;
|
||||
}
|
||||
case-indicator {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
entry {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
prompt {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
inputbar {
|
||||
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
|
||||
}
|
||||
textbox-prompt-colon {
|
||||
expand: false;
|
||||
str: ":";
|
||||
margin: 0px 0.3em 0em 0em;
|
||||
text-color: @normal-foreground;
|
||||
}
|
137
rofi/rofikeyhint.rasi
Normal file
137
rofi/rofikeyhint.rasi
Normal file
|
@ -0,0 +1,137 @@
|
|||
/*******************************************************
|
||||
* ROFI configs i3 keyhint-menu for EndeavourOS
|
||||
* Maintainer: joekamprad [joekamprad //a_t// endeavouros.com]
|
||||
*******************************************************/
|
||||
configuration {
|
||||
font: "Noto Sans Regular 10";
|
||||
show-icons: false;
|
||||
icon-theme: "Qogir";
|
||||
display-drun: "KeyHint";
|
||||
drun-display-format: "{name}";
|
||||
scroll-method: 0;
|
||||
disable-history: false;
|
||||
fullscreen: false;
|
||||
hide-scrollbar: true;
|
||||
sidebar-mode: false;
|
||||
}
|
||||
|
||||
@import "~/.config/rofi/arc_dark_transparent_colors.rasi"
|
||||
|
||||
window {
|
||||
background-color: @background;
|
||||
border: 0;
|
||||
padding: 30;
|
||||
}
|
||||
listview {
|
||||
lines: 10;
|
||||
columns: 1;
|
||||
}
|
||||
mainbox {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
message {
|
||||
border: 2px 0px 0px;
|
||||
border-color: @separatorcolor;
|
||||
padding: 1px;
|
||||
}
|
||||
textbox {
|
||||
text-color: @foreground;
|
||||
}
|
||||
listview {
|
||||
fixed-height: 0;
|
||||
border: 8px 0px 0px;
|
||||
border-color: @separatorcolor;
|
||||
spacing: 8px;
|
||||
scrollbar: false;
|
||||
padding: 2px 0px 0px;
|
||||
}
|
||||
element {
|
||||
border: 0;
|
||||
padding: 1px;
|
||||
}
|
||||
element-text {
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
element.normal.normal {
|
||||
background-color: @normal-background;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
element.normal.urgent {
|
||||
background-color: @urgent-background;
|
||||
text-color: @urgent-foreground;
|
||||
}
|
||||
element.normal.active {
|
||||
background-color: @active-background;
|
||||
text-color: @active-foreground;
|
||||
}
|
||||
element.selected.normal {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
element.selected.urgent {
|
||||
background-color: @selected-urgent-background;
|
||||
text-color: @selected-urgent-foreground;
|
||||
}
|
||||
element.selected.active {
|
||||
background-color: @selected-active-background;
|
||||
text-color: @selected-active-foreground;
|
||||
}
|
||||
element.alternate.normal {
|
||||
background-color: @alternate-normal-background;
|
||||
text-color: @alternate-normal-foreground;
|
||||
}
|
||||
element.alternate.urgent {
|
||||
background-color: @alternate-urgent-background;
|
||||
text-color: @alternate-urgent-foreground;
|
||||
}
|
||||
element.alternate.active {
|
||||
background-color: @alternate-active-background;
|
||||
text-color: @alternate-active-foreground;
|
||||
}
|
||||
scrollbar {
|
||||
width: 4px;
|
||||
border: 0;
|
||||
handle-color: @normal-foreground;
|
||||
handle-width: 8px;
|
||||
padding: 0;
|
||||
}
|
||||
mode-switcher {
|
||||
border: 2px 0px 0px;
|
||||
border-color: @separatorcolor;
|
||||
}
|
||||
button {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
button.selected {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
inputbar {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
padding: 1px;
|
||||
}
|
||||
case-indicator {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
entry {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
prompt {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
inputbar {
|
||||
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
|
||||
}
|
||||
textbox-prompt-colon {
|
||||
expand: false;
|
||||
str: ":";
|
||||
margin: 0px 0.3em 0em 0em;
|
||||
text-color: @normal-foreground;
|
||||
}
|
Loading…
Reference in New Issue
Block a user