Add files via upload
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
#!/bin/bash
|
||||
# Source: http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html
|
||||
|
||||
INSTANCE="${BLOCK_INSTANCE}"
|
||||
# If you don't like you can use any other IP
|
||||
INTERFACE="$(ip route get 8.8.8.8 | grep -Po '(?<=(dev )).*(?= src)')"
|
||||
|
||||
if [[ "${INSTANCE}" = "" ]]; then
|
||||
INSTANCE="${INTERFACE};both"
|
||||
fi
|
||||
|
||||
DISPLAY=$(echo "${INSTANCE}" | awk -F ';' '{print $2}')
|
||||
INSTANCE=$(echo "${INSTANCE}" | awk -F ';' '{print $1}')
|
||||
|
||||
if [[ "${DISPLAY}" = "" ]]; then
|
||||
DISPLAY="both"
|
||||
fi
|
||||
|
||||
ONE_KB=1024
|
||||
ONE_MB=$(echo "${ONE_KB}*1024" | bc -l)
|
||||
TEN_MB=$(echo "${ONE_MB}*10" | bc -l)
|
||||
OHD_MB=$(echo "${TEN_MB}*10" | bc -l)
|
||||
|
||||
URGENT_VALUE="${ONE_MB}"
|
||||
|
||||
PREV_IN=0
|
||||
PREV_OUT=0
|
||||
|
||||
PREV_FILE="/tmp/.bandwidth"
|
||||
|
||||
if [[ -f "${PREV_FILE}" ]]; then
|
||||
PREV_CONT=$(cat "${PREV_FILE}")
|
||||
PREV_IN=$(echo "${PREV_CONT}" | head -n 1)
|
||||
PREV_OUT=$(echo "${PREV_CONT}" | tail -n 1)
|
||||
fi
|
||||
|
||||
BANDWIDTH=$(grep "${INSTANCE}" /proc/net/dev | awk -F: '{print $2}' | awk '{print $1" "$9}')
|
||||
|
||||
if [[ "${BANDWIDTH}" = "" ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
BYTES_IN=$(echo "${BANDWIDTH}" | awk -F ' ' '{print $1}')
|
||||
BYTES_OUT=$(echo "${BANDWIDTH}" | awk -F ' ' '{print $2}')
|
||||
|
||||
function FormatNumber() {
|
||||
if [[ "${1}" -ge "${OHD_MB}" ]]; then
|
||||
printf "%03d" $(echo "scale=0;${1}/${ONE_MB}" | bc -l)
|
||||
echo "m"
|
||||
elif [[ "${1}" -ge "${TEN_MB}" ]]; then
|
||||
printf "%03d" $(echo "scale=1;${1}/${ONE_MB}" | bc -l)
|
||||
echo "m"
|
||||
elif [[ "${1}" -ge "${ONE_MB}" ]]; then
|
||||
printf "%03d" $(echo "scale=2;${1}/${ONE_MB}" | bc -l)
|
||||
echo "m"
|
||||
elif [[ "${1}" -ge "${ONE_KB}" ]]; then
|
||||
printf "%03d" $(echo "scale=0;${1}/${ONE_KB}" | bc -l)
|
||||
echo "k"
|
||||
else
|
||||
printf "%03d" "$1"
|
||||
echo "b"
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ "${PREV_IN}" != "" ]] && [[ "${PREV_OUT}" != "" ]]; then
|
||||
# Calculate the CPU usage since we last checked.
|
||||
DIFF_IN=$(echo "scale=0;${BYTES_IN} - ${PREV_IN}" | bc -l)
|
||||
DIFF_OUT=$(echo "scale=0;${BYTES_OUT} - ${PREV_OUT}" | bc -l)
|
||||
DIFF_TOTAL=0
|
||||
|
||||
USAGE_IN=$(FormatNumber "${DIFF_IN}")
|
||||
USAGE_OUT=$(FormatNumber "${DIFF_OUT}")
|
||||
|
||||
if [[ "${DISPLAY}" = "both" ]]; then
|
||||
echo "${USAGE_IN} : ${USAGE_OUT}"
|
||||
echo "${USAGE_IN} : ${USAGE_OUT}"
|
||||
echo ""
|
||||
DIFF_TOTAL=$((DIFF_TOTAL+DIFF_IN))
|
||||
DIFF_TOTAL=$((DIFF_TOTAL+DIFF_OUT))
|
||||
elif [[ "${DISPLAY}" = "in" ]]; then
|
||||
echo "${USAGE_IN}"
|
||||
echo "${USAGE_IN}"
|
||||
echo ""
|
||||
DIFF_TOTAL=$((DIFF_TOTAL+DIFF_IN))
|
||||
elif [[ "${DISPLAY}" = "out" ]]; then
|
||||
echo "${USAGE_OUT}"
|
||||
echo "${USAGE_OUT}"
|
||||
echo ""
|
||||
DIFF_TOTAL=$((DIFF_TOTAL+DIFF_OUT))
|
||||
fi
|
||||
else
|
||||
echo "?"
|
||||
echo "?"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Remember the total and idle CPU times for the next check.
|
||||
echo "${BYTES_IN}" > "${PREV_FILE}"
|
||||
echo "${BYTES_OUT}" >> "${PREV_FILE}"
|
||||
|
||||
if [[ "${DIFF_TOTAL}" -ge "${URGENT_VALUE}" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
BATTERY=0
|
||||
BATTERY_INFO=$(acpi -b | grep "Battery ${BATTERY}")
|
||||
BATTERY_STATE=$(echo "${BATTERY_INFO}" | grep -wo "Full\|Charging\|Not")
|
||||
BATTERY_POWER=$(echo "${BATTERY_INFO}" | grep -o '[0-9]\+%' | tr -d '%')
|
||||
|
||||
URGENT_VALUE=10
|
||||
|
||||
if [[ "${BATTERY_STATE}" = "Charging" ]]; then
|
||||
echo "${BATTERY_POWER}%+"
|
||||
echo "${BATTERY_POWER}%+"
|
||||
echo ""
|
||||
elif [[ "${BATTERY_STATE}" = "Not" ]]; then
|
||||
echo "${BATTERY_POWER}%-"
|
||||
echo "${BATTERY_POWER}%-"
|
||||
echo ""
|
||||
else
|
||||
echo "${BATTERY_POWER}%"
|
||||
echo "${BATTERY_POWER}%"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if [[ "${BATTERY_POWER}" -le "${URGENT_VALUE}" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
@@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
|
||||
# One of the following: xrandr, xbacklight, kernel
|
||||
METHOD="xbacklight"
|
||||
|
||||
# Left click
|
||||
if [[ "${BLOCK_BUTTON}" -eq 1 ]]; then
|
||||
~/.Scripts/ChangeWallpapers.sh
|
||||
#elif [[ "${BLOCK_BUTTON}" -eq 2 ]]; then
|
||||
# ~/.Scripts/ChangeWallpapers.sh
|
||||
#elif [[ "${BLOCK_BUTTON}" -eq 3 ]]; then
|
||||
# xbacklight -dec 10
|
||||
elif [[ "${BLOCK_BUTTON}" -eq 4 ]]; then
|
||||
xbacklight -inc 5
|
||||
elif [[ "${BLOCK_BUTTON}" -eq 5 ]]; then
|
||||
xbacklight -dec 5
|
||||
fi
|
||||
|
||||
URGENT_VALUE=10
|
||||
|
||||
if [[ "${METHOD}" = "xrandr" ]]; then
|
||||
device="${BLOCK_INSTANCE:-primary}"
|
||||
xrandrOutput=$(xrandr --verbose)
|
||||
|
||||
if [[ "${device}" = "primary" ]]; then
|
||||
device=$(echo "${xrandrOutput}" | grep 'primary' | head -n 1 | awk -F ' ' '{print $1}')
|
||||
fi
|
||||
|
||||
curBrightness=$(echo "${xrandrOutput}" | grep "${device}" -A 5 | grep -i "Brightness" | awk -F ':' '{print $2}')
|
||||
elif [[ "${METHOD}" = "kernel" ]]; then
|
||||
device="${BLOCK_INSTANCE:-intel_backlight}"
|
||||
maxBrightness=$(cat /sys/class/backlight/${device}/max_brightness)
|
||||
curBrightness=$(cat /sys/class/backlight/${device}/brightness)
|
||||
elif [[ "${METHOD}" = "xbacklight" ]]; then
|
||||
curBrightness=$(xbacklight -get)
|
||||
fi
|
||||
|
||||
if [[ "${curBrightness}" -le 0 ]]; then
|
||||
echo "X"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if [[ "${METHOD}" = "xrandr" ]]; then
|
||||
percent=$(echo "scale=0;${curBrightness} * 100" | bc -l)
|
||||
elif [[ "${METHOD}" = "kernel" ]]; then
|
||||
percent=$(echo "scale=0;${curBrightness} / ${maxBrightness} * 100" | bc -l)
|
||||
elif [[ "${METHOD}" = "xbacklight" ]]; then
|
||||
percent=$(echo "scale=0;${curBrightness}" | bc -l)
|
||||
fi
|
||||
|
||||
percent=${percent%.*}
|
||||
|
||||
if [[ "${percent}" -le 0 ]]; then
|
||||
echo "X"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo "${percent}%"
|
||||
echo "${percent}%"
|
||||
echo ""
|
||||
|
||||
if [[ "${percent}" -le "${URGENT_VALUE}" ]]; then
|
||||
exit 33
|
||||
fi
|
||||
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
# Source: http://askubuntu.com/a/450136
|
||||
|
||||
URGENT_VALUE=90
|
||||
|
||||
PREV_TOTAL=0
|
||||
PREV_IDLE=0
|
||||
|
||||
cpuFile="/tmp/.cpu"
|
||||
|
||||
if [[ -f "${cpuFile}" ]]; then
|
||||
fileCont=$(cat "${cpuFile}")
|
||||
PREV_TOTAL=$(echo "${fileCont}" | head -n 1)
|
||||
PREV_IDLE=$(echo "${fileCont}" | tail -n 1)
|
||||
fi
|
||||
|
||||
CPU=(`cat /proc/stat | grep '^cpu '`) # Get the total CPU statistics.
|
||||
unset CPU[0] # Discard the "cpu" prefix.
|
||||
IDLE=${CPU[4]} # Get the idle CPU time.
|
||||
|
||||
# Calculate the total CPU time.
|
||||
TOTAL=0
|
||||
|
||||
for VALUE in "${CPU[@]:0:4}"; do
|
||||
let "TOTAL=$TOTAL+$VALUE"
|
||||
done
|
||||
|
||||
if [[ "${PREV_TOTAL}" != "" ]] && [[ "${PREV_IDLE}" != "" ]]; then
|
||||
# Calculate the CPU usage since we last checked.
|
||||
let "DIFF_IDLE=$IDLE-$PREV_IDLE"
|
||||
let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL"
|
||||
let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10"
|
||||
echo "${DIFF_USAGE}%"
|
||||
echo "${DIFF_USAGE}%"
|
||||
echo ""
|
||||
else
|
||||
echo "?"
|
||||
echo "?"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Remember the total and idle CPU times for the next check.
|
||||
echo "${TOTAL}" > "${cpuFile}"
|
||||
echo "${IDLE}" >> "${cpuFile}"
|
||||
|
||||
if [[ "${DIFF_USAGE}" -gt 0 ]] && [[ "${DIFF_USAGE}" -gt "${URGENT_VALUE}" ]]; then
|
||||
exit 33
|
||||
fi
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
SSPID=$(pgrep -l fcitx |awk -F ' ' '{print $1}')
|
||||
|
||||
if [[ "${SSPID}" != "" ]]; then
|
||||
echo ""
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
echo ""
|
||||
fi
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Left click
|
||||
if [[ "${BLOCK_BUTTON}" -eq 1 ]]; then
|
||||
sudo ufw enable
|
||||
# Middle click
|
||||
elif [[ "${BLOCK_BUTTON}" -eq 2 ]]; then
|
||||
sudo ufw reload
|
||||
# Right click
|
||||
elif [[ "${BLOCK_BUTTON}" -eq 3 ]]; then
|
||||
sudo ufw disable
|
||||
fi
|
||||
|
||||
status=$(sudo ufw status 2>/dev/null)
|
||||
|
||||
if [[ $? -gt 0 ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ "${status}" != *inactive* ]]; then
|
||||
echo "on"
|
||||
echo "on"
|
||||
echo ""
|
||||
else
|
||||
echo "off"
|
||||
echo "off"
|
||||
echo ""
|
||||
fi
|
||||
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
|
||||
#if [[ "${BLOCK_BUTTON}" -eq 1 ]]; then
|
||||
# termite -e alsamixer
|
||||
#elif [[ "${BLOCK_BUTTON}" -eq 4 ]]; then
|
||||
# amixer -q sset Master 2%+
|
||||
#elif [[ "${BLOCK_BUTTON}" -eq 5 ]]; then
|
||||
# amixer -q sset Master 2%-
|
||||
#fi
|
||||
VALUE=$(amixer -c 0 contents | \
|
||||
awk -F"," '
|
||||
$1 == "numid=14" {
|
||||
c=1
|
||||
} c && /: values/ {
|
||||
split($0, a, "=")
|
||||
print a[2];
|
||||
exit
|
||||
}')
|
||||
|
||||
if [[ "${VALUE}" == "on" ]]; then
|
||||
echo ""
|
||||
#else
|
||||
# echo ""
|
||||
# echo ""
|
||||
fi
|
||||
|
||||
|
||||
#from https://unix.stackexchange.com/questions/76375/how-do-i-detect-wheter-the-audio-cable-is-connected
|
||||
#One way could perhaps be to use amixer.
|
||||
|
||||
#Jack plugged in:
|
||||
|
||||
#$ amixer -c 0 contents
|
||||
#numid=29,iface=CARD,name='Front Headphone Jack'
|
||||
# ; type=BOOLEAN,access=r-------,values=1
|
||||
# : values=on
|
||||
#...
|
||||
#Jack not plugged in:
|
||||
|
||||
#$ amixer -c 0 contents
|
||||
#numid=29,iface=CARD,name='Front Headphone Jack'
|
||||
# ; type=BOOLEAN,access=r-------,values=1
|
||||
# : values=off
|
||||
#...
|
||||
#So for that specific one I could do:
|
||||
|
||||
#amixer -c 0 contents | \
|
||||
#awk -F"," '
|
||||
#$1 == "numid=own" { 此處的own的序號必須自己尋找
|
||||
# c=1
|
||||
#} c && /: values/ {
|
||||
# split($0, a, "=")
|
||||
# print a[2];
|
||||
# exit
|
||||
#}'
|
||||
#giving output of on or off.
|
||||
#
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
TYPE="${BLOCK_INSTANCE:-caps}"
|
||||
|
||||
lockLine=$(xset -q | grep "Num Lock")
|
||||
|
||||
capsLock=$(echo "${lockLine}" | awk -F ' ' '{print $4}')
|
||||
numLock=$(echo "${lockLine}" | awk -F ' ' '{print $8}')
|
||||
|
||||
if [[ "${capsLock}" == "on" && "${numLock}" == "on" ]]; then
|
||||
echo " "
|
||||
echo ""
|
||||
elif [[ "${capsLock}" == "on" ]]; then
|
||||
echo ""
|
||||
echo ""
|
||||
elif [[ "${numLock}" == "on" ]]; then
|
||||
echo ""
|
||||
echo ""
|
||||
else
|
||||
exit
|
||||
fi
|
||||
@@ -0,0 +1,154 @@
|
||||
#!/usr/bin/env perl
|
||||
# Copyright (C) 2014 Tony Crisci <tony@dubstepdish.com>
|
||||
# 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/>.
|
||||
|
||||
# Requires playerctl binary to be in your path (except cmus)
|
||||
# See: https://github.com/acrisci/playerctl
|
||||
|
||||
# Set instance=NAME in the i3blocks configuration to specify a music player
|
||||
# (playerctl will attempt to connect to org.mpris.MediaPlayer2.[NAME] on your
|
||||
# DBus session).
|
||||
|
||||
use Time::HiRes qw(usleep);
|
||||
use Env qw(BLOCK_INSTANCE);
|
||||
|
||||
use constant DELAY => 50; # Delay in ms to let network-based players (spotify) reflect new data.
|
||||
use constant SPOTIFY_STR => 'spotify';
|
||||
|
||||
my @metadata = ();
|
||||
my $player_arg = "";
|
||||
|
||||
if ($BLOCK_INSTANCE) {
|
||||
$player_arg = "--player='$BLOCK_INSTANCE'";
|
||||
}
|
||||
|
||||
sub buttons {
|
||||
my $method = shift;
|
||||
|
||||
if($method eq 'mpd') {
|
||||
if ($ENV{'BLOCK_BUTTON'} == 1) {
|
||||
system("mpc prev");
|
||||
} elsif ($ENV{'BLOCK_BUTTON'} == 2) {
|
||||
system("mpc toggle");
|
||||
} elsif ($ENV{'BLOCK_BUTTON'} == 3) {
|
||||
system("mpc next");
|
||||
} elsif ($ENV{'BLOCK_BUTTON'} == 4) {
|
||||
system("mpc volume +10");
|
||||
} elsif ($ENV{'BLOCK_BUTTON'} == 5) {
|
||||
system("mpc volume -10");
|
||||
}
|
||||
} elsif ($method eq 'cmus') {
|
||||
if ($ENV{'BLOCK_BUTTON'} == 1) {
|
||||
system("cmus-remote --prev");
|
||||
} elsif ($ENV{'BLOCK_BUTTON'} == 2) {
|
||||
system("cmus-remote --pause");
|
||||
} elsif ($ENV{'BLOCK_BUTTON'} == 3) {
|
||||
system("cmus-remote --next");
|
||||
}
|
||||
} elsif ($method eq 'playerctl') {
|
||||
if ($ENV{'BLOCK_BUTTON'} == 1) {
|
||||
system("playerctl $player_arg previous");
|
||||
usleep(DELAY * 1000) if $BLOCK_INSTANCE eq SPOTIFY_STR;
|
||||
} elsif ($ENV{'BLOCK_BUTTON'} == 2) {
|
||||
system("playerctl $player_arg play-pause");
|
||||
} elsif ($ENV{'BLOCK_BUTTON'} == 3) {
|
||||
system("playerctl $player_arg next");
|
||||
usleep(DELAY * 1000) if $BLOCK_INSTANCE eq SPOTIFY_STR;
|
||||
} elsif ($ENV{'BLOCK_BUTTON'} == 4) {
|
||||
system("playerctl $player_arg volume 0.01+");
|
||||
} elsif ($ENV{'BLOCK_BUTTON'} == 5) {
|
||||
system("playerctl $player_arg volume 0.01-");
|
||||
}
|
||||
} elsif ($method eq 'rhythmbox') {
|
||||
if ($ENV{'BLOCK_BUTTON'} == 1) {
|
||||
system("rhythmbox-client --previous");
|
||||
} elsif ($ENV{'BLOCK_BUTTON'} == 2) {
|
||||
system("rhythmbox-client --play-pause");
|
||||
} elsif ($ENV{'BLOCK_BUTTON'} == 3) {
|
||||
system("rhythmbox-client --next");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub cmus {
|
||||
my @cmus = split /^/, qx(cmus-remote -Q);
|
||||
if ($? == 0) {
|
||||
foreach my $line (@cmus) {
|
||||
my @data = split /\s/, $line;
|
||||
if (shift @data eq 'tag') {
|
||||
my $key = shift @data;
|
||||
my $value = join ' ', @data;
|
||||
|
||||
@metadata[0] = $value if $key eq 'artist';
|
||||
@metadata[1] = $value if $key eq 'title';
|
||||
}
|
||||
}
|
||||
|
||||
if (@metadata) {
|
||||
buttons('cmus');
|
||||
|
||||
# metadata found so we are done
|
||||
print(join ' - ', @metadata);
|
||||
exit 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub mpd {
|
||||
my $data = qx(mpc current);
|
||||
if (not $data eq '') {
|
||||
buttons("mpd");
|
||||
print($data);
|
||||
exit 0;
|
||||
}
|
||||
}
|
||||
|
||||
sub playerctl {
|
||||
buttons('playerctl');
|
||||
|
||||
my $artist = qx(playerctl $player_arg metadata artist);
|
||||
# exit status will be nonzero when playerctl cannot find your player
|
||||
exit(0) if $? || $artist eq '(null)';
|
||||
|
||||
push(@metadata, $artist) if $artist;
|
||||
|
||||
my $title = qx(playerctl $player_arg metadata title);
|
||||
exit(0) if $? || $title eq '(null)';
|
||||
|
||||
push(@metadata, $title) if $title;
|
||||
|
||||
print(join(" - ", @metadata)) if @metadata;
|
||||
}
|
||||
|
||||
sub rhythmbox {
|
||||
buttons('rhythmbox');
|
||||
|
||||
my $data = qx(rhythmbox-client --print-playing --no-start);
|
||||
print($data);
|
||||
}
|
||||
|
||||
if ($player_arg eq '' or $player_arg =~ /mpd/) {
|
||||
mpd;
|
||||
}
|
||||
elsif ($player_arg =~ /cmus/) {
|
||||
cmus;
|
||||
}
|
||||
elsif ($player_arg =~ /rhythmbox/) {
|
||||
rhythmbox;
|
||||
}
|
||||
else {
|
||||
playerctl;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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("%.f%%\n",pct)
|
||||
|
||||
# short text
|
||||
printf("%.f%%\n", pct)
|
||||
|
||||
# color
|
||||
if (pct > 90) {
|
||||
print("#FF0000\n")
|
||||
} else if (pct > 80) {
|
||||
print("#FFAE00\n")
|
||||
} else if (pct > 70) {
|
||||
print("#FFF600\n")
|
||||
}
|
||||
}
|
||||
' /proc/meminfo
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Left click
|
||||
if [[ "${BLOCK_BUTTON}" -eq 1 ]]; then
|
||||
amixer -q sset Capture 5%+
|
||||
# Middle click
|
||||
elif [[ "${BLOCK_BUTTON}" -eq 2 ]]; then
|
||||
amixer -q sset Capture toggle
|
||||
# Right click
|
||||
elif [[ "${BLOCK_BUTTON}" -eq 3 ]]; then
|
||||
amixer -q sset Capture 5%-
|
||||
fi
|
||||
|
||||
statusLine=$(amixer get Capture | tail -n 1)
|
||||
status=$(echo "${statusLine}" | grep -wo "on")
|
||||
volume=$(echo "${statusLine}" | awk -F ' ' '{print $5}' | tr -d '[]%')
|
||||
|
||||
if [[ "${status}" == "on" ]]; then
|
||||
echo "${volume}%"
|
||||
echo "${volume}%"
|
||||
echo ""
|
||||
else
|
||||
echo "off"
|
||||
echo "off"
|
||||
echo ""
|
||||
fi
|
||||
@@ -0,0 +1,188 @@
|
||||
#!/bin/bash
|
||||
# IMPORTANT:
|
||||
# To make this block work, you have to edit your block-command.
|
||||
# It should point to this file. For best performance, only use it on blocks
|
||||
# you want to monitor.
|
||||
#
|
||||
# Example:
|
||||
# command=~/.i3-blocks/blocks/notifier $BLOCK_NAME
|
||||
echo "ss"
|
||||
echo "ss"
|
||||
echo ""
|
||||
|
||||
BLOCK_NAME="${1}"
|
||||
|
||||
if [[ "${BLOCK_NAME}" == "" ]] || [[ "${BLOCK_NAME}" == "notifier" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
BLOCK_PATH="${SCRIPT_DIR}/${BLOCK_NAME}"
|
||||
|
||||
if [[ ! -f "${BLOCK_PATH}" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BLOCK_OUT=$(bash "${BLOCK_PATH}")
|
||||
BLOCK_URGENT=$?
|
||||
|
||||
# Nothing to display.
|
||||
if [[ "${BLOCK_OUT}" == "" ]]; then
|
||||
exit "${BLOCK_URGENT}"
|
||||
fi
|
||||
|
||||
NOTIFY=0
|
||||
|
||||
NOTIFY_CHANGES="weather display"
|
||||
NOTIFY_ALWAYS=""
|
||||
NOTIFY_NEVER="launcher playerctl scroll"
|
||||
|
||||
if [[ "${NOTIFY_NEVER}" != *${BLOCK_NAME}* ]]; then
|
||||
BLOCK_UCFIRST=$(echo "${BLOCK_NAME}" | head -c 1 | tr [a-z] [A-Z]; echo "${BLOCK_NAME}" | tail -c +2)
|
||||
|
||||
CHECK_SUM=$(echo "${BLOCK_NAME}-${BLOCK_INSTANCE}" | md5sum | awk '{print $1}')
|
||||
CACHE_FILE="/tmp/.notify-cache-${CHECK_SUM}"
|
||||
|
||||
BLOCK_DESC=$(echo "${BLOCK_OUT}" | head -n 1)
|
||||
BLOCK_VALUE=$(echo "${BLOCK_OUT}" | tail -n 1)
|
||||
BLOCK_ICON=""
|
||||
|
||||
if [[ "${NOTIFY_ALWAYS}" == *${BLOCK_NAME}* ]]; then
|
||||
NOTIFY=1
|
||||
elif [[ "${BLOCK_URGENT}" -gt 0 ]]; then
|
||||
NOTIFY=1
|
||||
fi
|
||||
|
||||
VALUE_CHANGED=0
|
||||
HAS_CACHEFILE=0
|
||||
if [[ -f "${CACHE_FILE}" ]]; then
|
||||
HAS_CACHEFILE=1
|
||||
CACHED_VALUE=$(cat "${CACHE_FILE}")
|
||||
#MODIFIED_TIME=$(stat -c '%Y' "${CACHE_FILE}")
|
||||
#CURRENT_TIME=$(date +%s)
|
||||
#ELAPSED_TIME=$((MODIFIED_TIME - CURRENT_TIME))
|
||||
if [[ "${BLOCK_VALUE}" != "${CACHED_VALUE}" ]]; then
|
||||
VALUE_CHANGED=1
|
||||
if [[ "${NOTIFY_CHANGES}" == *${BLOCK_NAME}* ]]; then
|
||||
NOTIFY=1
|
||||
fi
|
||||
fi
|
||||
elif [[ "${NOTIFY_CHANGES}" == *${BLOCK_NAME}* ]]; then
|
||||
NOTIFY=1
|
||||
fi
|
||||
|
||||
if [[ "${NOTIFY}" -eq 1 ]]; then
|
||||
if [[ "${BLOCK_NAME}" == "audio" ]]; then
|
||||
BLOCK_MESSAGE="Audio level changed to ${BLOCK_VALUE}."
|
||||
elif [[ "${BLOCK_NAME}" == "bandwidth" ]]; then
|
||||
BLOCK_MESSAGE="Traffic went to ${BLOCK_VALUE}."
|
||||
elif [[ "${BLOCK_NAME}" == "battery" ]]; then
|
||||
BLOCK_MESSAGE="Energy changed to ${BLOCK_VALUE}."
|
||||
elif [[ "${BLOCK_NAME}" == "countdown" ]]; then
|
||||
BLOCK_MESSAGE="Remaining time is now ${BLOCK_VALUE}."
|
||||
elif [[ "${BLOCK_NAME}" == "cpu" ]]; then
|
||||
BLOCK_MESSAGE="CPU utilization is now ${BLOCK_VALUE}."
|
||||
elif [[ "${BLOCK_NAME}" == "feed" ]]; then
|
||||
BLOCK_MESSAGE="Newest article is ${BLOCK_VALUE}."
|
||||
elif [[ "${BLOCK_NAME}" == "mail" ]]; then
|
||||
BLOCK_MESSAGE="Unread emails went to ${BLOCK_VALUE}."
|
||||
elif [[ "${BLOCK_NAME}" == "memory" ]]; then
|
||||
BLOCK_MESSAGE="Memory utilization is now ${BLOCK_VALUE}."
|
||||
elif [[ "${BLOCK_NAME}" == "packages" ]]; then
|
||||
BLOCK_MESSAGE="${BLOCK_VALUE} packages are now ready to update."
|
||||
elif [[ "${BLOCK_NAME}" == "space" ]]; then
|
||||
BLOCK_MESSAGE="Space utilization is now ${BLOCK_INSTANCE}."
|
||||
elif [[ "${BLOCK_NAME}" == "ssid" ]]; then
|
||||
BLOCK_MESSAGE="SSID changed to ${BLOCK_VALUE}."
|
||||
elif [[ "${BLOCK_NAME}" == "temperature" ]]; then
|
||||
BLOCK_MESSAGE="Sensor temperature changed to ${BLOCK_VALUE}."
|
||||
elif [[ "${BLOCK_NAME}" == "trash" ]]; then
|
||||
BLOCK_MESSAGE="${BLOCK_VALUE} items are now in the trash."
|
||||
else
|
||||
BLOCK_MESSAGE="${BLOCK_UCFIRST} is now ${BLOCK_VALUE}."
|
||||
fi
|
||||
|
||||
if [[ "${BLOCK_NAME}" == "audio" ]]; then
|
||||
BLOCK_ICON="audio-volume-high-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "bandwidth" ]]; then
|
||||
BLOCK_ICON="network-wireless-acquiring-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "battery" ]]; then
|
||||
BLOCK_ICON="battery-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "bluetooth" ]]; then
|
||||
BLOCK_ICON="bluetooth-active-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "brightness" ]]; then
|
||||
BLOCK_ICON="display-brightness-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "cmus" ]]; then
|
||||
BLOCK_ICON="emblem-music-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "countdown" ]]; then
|
||||
BLOCK_ICON="document-open-recent-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "cpu" ]]; then
|
||||
BLOCK_ICON="indicator-cpufreq"
|
||||
elif [[ "${BLOCK_NAME}" == "datetime" ]]; then
|
||||
BLOCK_ICON="system-run-symbolic" # TODO
|
||||
elif [[ "${BLOCK_NAME}" == "device" ]]; then
|
||||
BLOCK_ICON="system-run-symbolic" # TODO
|
||||
elif [[ "${BLOCK_NAME}" == "display" ]]; then
|
||||
BLOCK_ICON="video-display-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "feed" ]]; then
|
||||
BLOCK_ICON="folder-documents-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "firewall" ]]; then
|
||||
BLOCK_ICON="changes-prevent-symbolic.svg" # TODO
|
||||
elif [[ "${BLOCK_NAME}" == "ip-address" ]]; then
|
||||
BLOCK_ICON="avatar-default-symbolic" # TODO
|
||||
elif [[ "${BLOCK_NAME}" == "keystate" ]]; then
|
||||
BLOCK_ICON="format-text-underline-symbolic" # TODO
|
||||
elif [[ "${BLOCK_NAME}" == "launcher" ]]; then
|
||||
BLOCK_ICON="system-run-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "load" ]]; then
|
||||
BLOCK_ICON="indicator-cpufreq" # TODO
|
||||
elif [[ "${BLOCK_NAME}" == "locale" ]]; then
|
||||
BLOCK_ICON="format-text-larger-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "mail" ]]; then
|
||||
BLOCK_ICON="mail-send-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "memory" ]]; then
|
||||
BLOCK_ICON="drive-harddisk-solidstate-symbolic" # TODO
|
||||
elif [[ "${BLOCK_NAME}" == "microphone" ]]; then
|
||||
BLOCK_ICON="audio-input-microphone-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "network" ]]; then
|
||||
BLOCK_ICON="network-wireless-connected-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "packages" ]]; then
|
||||
BLOCK_ICON="view-refresh-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "playerctl" ]]; then
|
||||
BLOCK_ICON="emblem-music-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "process" ]]; then
|
||||
BLOCK_ICON="process-stop-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "space" ]]; then
|
||||
BLOCK_ICON="drive-harddisk-solidstate-symbolic" # TODO
|
||||
elif [[ "${BLOCK_NAME}" == "ssid" ]]; then
|
||||
BLOCK_ICON="system-users-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "temperature" ]]; then
|
||||
BLOCK_ICON="object-inverse" # TODO
|
||||
elif [[ "${BLOCK_NAME}" == "trash" ]]; then
|
||||
BLOCK_ICON="user-trash-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "usb" ]]; then
|
||||
BLOCK_ICON="drive-removable-media-usb-symbolic-1"
|
||||
elif [[ "${BLOCK_NAME}" == "vpn" ]]; then
|
||||
BLOCK_ICON="dialog-password-symbolic" # TODO
|
||||
elif [[ "${BLOCK_NAME}" == "weather" ]]; then
|
||||
BLOCK_ICON="weather-few-clouds-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "webcam" ]]; then
|
||||
BLOCK_ICON="camera-web-symbolic"
|
||||
elif [[ "${BLOCK_NAME}" == "window" ]]; then
|
||||
BLOCK_ICON="view-dual-symbolic" # TODO
|
||||
fi
|
||||
|
||||
if [[ "${BLOCK_URGENT}" -gt 0 ]]; then
|
||||
notify-send -u critical -t 5000 -i "${BLOCK_ICON}" -a "i3block-${BLOCK_NAME}" "${BLOCK_UCFIRST}" "${BLOCK_MESSAGE}"
|
||||
else
|
||||
notify-send -u normal -t 3500 -i "${BLOCK_ICON}" -a "i3block-${BLOCK_NAME}" "${BLOCK_UCFIRST}" "${BLOCK_MESSAGE}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${VALUE_CHANGED}" -eq 1 ]] || [[ "${HAS_CACHEFILE}" -eq 0 ]]; then
|
||||
echo "${BLOCK_VALUE}" > "${CACHE_FILE}"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "${BLOCK_OUT}"
|
||||
exit "${BLOCK_URGENT}"
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
# Based on https://aur.archlinux.org/packages/playerctl/
|
||||
|
||||
INSTANCE="${BLOCK_INSTANCE}"
|
||||
if [[ "${INSTANCE}" != "" ]]; then
|
||||
ARGUMENTS="--player ${INSTANCE}"
|
||||
fi
|
||||
|
||||
ICON_PLAY="➤"
|
||||
ICON_PAUSE="Ⅱ"
|
||||
ICON_STOP="≠"
|
||||
CUR_ICON=""
|
||||
|
||||
if [[ "${BLOCK_BUTTON}" -eq 1 ]]; then
|
||||
$(playerctl ${ARGUMENTS} previous)
|
||||
elif [[ "${BLOCK_BUTTON}" -eq 2 ]]; then
|
||||
$(playerctl ${ARGUMENTS} play-pause)
|
||||
elif [[ "${BLOCK_BUTTON}" -eq 3 ]]; then
|
||||
$(playerctl ${ARGUMENTS} next)
|
||||
elif [[ "${BLOCK_BUTTON}" -eq 4 ]]; then
|
||||
$(playerctl ${ARGUMENTS} volume 0.2+)
|
||||
elif [[ "${BLOCK_BUTTON}" -eq 5 ]]; then
|
||||
$(playerctl ${ARGUMENTS} volume 0.2-)
|
||||
fi
|
||||
|
||||
PLAYER_STATUS=$(playerctl ${ARGUMENTS} status)
|
||||
INFO_TITLE=$(playerctl ${ARGUMENTS} metadata title)
|
||||
INFO_ALBUM=$(playerctl ${ARGUMENTS} metadata album)
|
||||
INFO_ARTIST=$(playerctl ${ARGUMENTS} metadata artist)
|
||||
|
||||
if [[ "${PLAYER_STATUS}" = "Paused" ]]; then
|
||||
CUR_ICON="${ICON_PAUSE}"
|
||||
elif [[ "${PLAYER_STATUS}" = "Playing" ]]; then
|
||||
CUR_ICON="${ICON_PLAY}"
|
||||
else
|
||||
CUR_ICON="${ICON_STOP}"
|
||||
fi
|
||||
|
||||
if [[ "${INFO_TITLE}" != "" ]] && [[ "${INFO_ARTIST}" != "" ]]; then
|
||||
echo "${INFO_ARTIST} - ${INFO_TITLE} ${CUR_ICON}"
|
||||
echo "${INFO_ARTIST} - ${INFO_TITLE} ${CUR_ICON}"
|
||||
fi
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "${BLOCK_BUTTON}" -eq 1 ]]; then
|
||||
termite -e nmtui
|
||||
fi
|
||||
|
||||
SSID_NAME=$(iwgetid -r)
|
||||
|
||||
# You can put any urgent name so the block will give warning
|
||||
# if a network with this name is used, like public wifi or alike.
|
||||
# You can separate multiple values with \|
|
||||
URGENT_VALUE=""
|
||||
|
||||
if [[ "${SSID_NAME}" != "" ]]; then
|
||||
echo "${SSID_NAME}"
|
||||
echo "${SSID_NAME}"
|
||||
echo ""
|
||||
|
||||
if [[ "${URGENT_VALUE}" != "" ]] && [[ $(echo "${SSID_NAME}" | grep -we "${URGENT_VALUE}") != "" ]]; then
|
||||
exit 33
|
||||
fi
|
||||
else
|
||||
echo "x"
|
||||
echo "x"
|
||||
echo ""
|
||||
fi
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
SSPID=$(pgrep -l sslocal |awk -F ' ' '{print $1}')
|
||||
|
||||
if [[ "${SSPID}" != "" ]]; then
|
||||
echo ""
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
echo ""
|
||||
echo ""
|
||||
fi
|
||||
@@ -0,0 +1,69 @@
|
||||
#!/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/>.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
use Getopt::Long;
|
||||
|
||||
binmode(STDOUT, ":utf8");
|
||||
|
||||
# default values
|
||||
my $t_warn = 70;
|
||||
my $t_crit = 90;
|
||||
my $chip = "";
|
||||
my $temperature = -9999;
|
||||
|
||||
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';
|
||||
|
||||
# Print short_text, full_text
|
||||
print "$temperature°C\n" x2;
|
||||
|
||||
# Print color, if needed
|
||||
if ($temperature >= $t_crit) {
|
||||
print "#FF0000\n";
|
||||
exit 33;
|
||||
} elsif ($temperature >= $t_warn) {
|
||||
print "#FFFC00\n";
|
||||
}
|
||||
|
||||
exit 0;
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
TIME=$(date '+%a %b %d %H:%M')
|
||||
|
||||
echo "${TIME}"
|
||||
echo "${TIME}"
|
||||
echo ""
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
DEVICE_NAME="${BLOCK_INSTANCE:-Keyboard}"
|
||||
|
||||
DEVICE_INFO=$(lsusb | grep -i kingston)
|
||||
|
||||
if [[ "${DEVICE_INFO}" != "" ]]; then
|
||||
echo ""
|
||||
echo ""
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Left click
|
||||
if [[ "${BLOCK_BUTTON}" -eq 1 ]]; then
|
||||
termite -e alsamixer
|
||||
# amixer -q sset Master 10%+
|
||||
# Middle click
|
||||
elif [[ "${BLOCK_BUTTON}" -eq 2 ]]; then
|
||||
amixer -q sset Master toggle
|
||||
# Right click
|
||||
#elif [[ "${BLOCK_BUTTON}" -eq 2 ]]; then
|
||||
# amixer -q sset Master 10%-
|
||||
elif [[ "${BLOCK_BUTTON}" -eq 4 ]]; then
|
||||
amixer -q sset Master 2%+
|
||||
elif [[ "${BLOCK_BUTTON}" -eq 5 ]]; then
|
||||
amixer -q sset Master 2%-
|
||||
fi
|
||||
|
||||
statusLine=$(amixer get Master | tail -n 1)
|
||||
status=$(echo "${statusLine}" | grep -wo "on")
|
||||
|
||||
volume=$(echo "${statusLine}" | awk -F ' ' '{print $4}' | tr -d '[]%')
|
||||
|
||||
VALUE=$(amixer -c 0 contents | \
|
||||
awk -F"," '
|
||||
$1 == "numid=14" {
|
||||
c=1s
|
||||
} c && /: values/ {
|
||||
split($0, a, "=")
|
||||
print a[2];
|
||||
exit
|
||||
}')
|
||||
|
||||
|
||||
if [[ "${status}" = "on" && "${VALUE}" = "on" ]]; then
|
||||
# if [[ "${VALUE}" = "on" ]]; then
|
||||
echo " ${volume}%"
|
||||
echo " ${volume}%"
|
||||
echo ""
|
||||
# elif
|
||||
# echo " ${volume}%"
|
||||
# echo " ${volume}%"
|
||||
# echo ""
|
||||
# fi
|
||||
elif [[ "${status}" = "on" && "${VALUE}" = "off" ]]; then
|
||||
echo " ${volume}%"
|
||||
echo ""
|
||||
else
|
||||
echo " 00%"
|
||||
echo " 00%"
|
||||
echo ""
|
||||
fi
|
||||
@@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
# Based on http://openweathermap.org/current
|
||||
|
||||
API_KEY="8ca3ef456139c165488fb6a6f00739ed"
|
||||
|
||||
# Check on http://openweathermap.org/find
|
||||
CITY_ID="${BLOCK_INSTANCE}"
|
||||
|
||||
URGENT_LOWER=0
|
||||
URGENT_HIGHER=30
|
||||
|
||||
ICON_SUNNY=""
|
||||
ICON_CLOUDY=""
|
||||
ICON_RAINY=""
|
||||
ICON_STORM=""
|
||||
ICON_SNOW=""
|
||||
ICON_FOG=""
|
||||
|
||||
SYMBOL_CELSIUS="℃"
|
||||
# WEATHER_URL="http://api.openweathermap.org/data/2.5/weather?id="1808773"&appid="44db6a862fba0b067b1930da0d769e98"$&units=metric"
|
||||
WEATHER_URL="https://api.openweathermap.org/data/2.5/weather?id=${CITY_ID}&appid=${API_KEY}&units=metric"
|
||||
|
||||
WEATHER_INFO=$(wget -qO- "${WEATHER_URL}")
|
||||
WEATHER_MAIN=$(echo "${WEATHER_INFO}" | grep -o -e '\"main\":\"[a-Z]*\"' | awk -F ':' '{print $2}' | tr -d '"')
|
||||
WEATHER_TEMP=$(echo "${WEATHER_INFO}" | grep -o -e '\"temp\":\-\?[0-9]*' | awk -F ':' '{print $2}' | tr -d '"')
|
||||
|
||||
if [[ "${WEATHER_MAIN}" = *Snow* ]]; then
|
||||
echo "${ICON_SNOW} ${WEATHER_TEMP}${SYMBOL_CELSIUS}"
|
||||
echo "${ICON_SNOW} ${WEATHER_TEMP}${SYMBOL_CELSIUS}"
|
||||
echo ""
|
||||
elif [[ "${WEATHER_MAIN}" = *Rain* ]] || [[ "${WEATHER_MAIN}" = *Drizzle* ]]; then
|
||||
echo "${ICON_RAINY} ${WEATHER_TEMP}${SYMBOL_CELSIUS}"
|
||||
echo "${ICON_RAINY} ${WEATHER_TEMP}${SYMBOL_CELSIUS}"
|
||||
echo ""
|
||||
elif [[ "${WEATHER_MAIN}" = *Cloud* ]]; then
|
||||
echo "${ICON_CLOUDY} ${WEATHER_TEMP}${SYMBOL_CELSIUS}"
|
||||
echo "${ICON_CLOUDY} ${WEATHER_TEMP}${SYMBOL_CELSIUS}"
|
||||
echo ""
|
||||
elif [[ "${WEATHER_MAIN}" = *Clear* ]]; then
|
||||
echo "${ICON_SUNNY} ${WEATHER_TEMP}${SYMBOL_CELSIUS}"
|
||||
echo "${ICON_SUNNY} ${WEATHER_TEMP}${SYMBOL_CELSIUS}"
|
||||
echo ""
|
||||
elif [[ "${WEATHER_MAIN}" = *Fog* ]] || [[ "${WEATHER_MAIN}" = *Mist* ]]; then
|
||||
echo "${ICON_FOG} ${WEATHER_TEMP}${SYMBOL_CELSIUS}"
|
||||
echo "${ICON_FOG} ${WEATHER_TEMP}${SYMBOL_CELSIUS}"
|
||||
echo ""
|
||||
else
|
||||
echo "${WEATHER_MAIN} ${WEATHER_TEMP}${SYMBOL_CELSIUS}"
|
||||
echo "${WEATHER_MAIN} ${WEATHER_TEMP}${SYMBOL_CELSIUS}"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if [[ "${WEATHER_TEMP}" -lt "${URGENT_LOWER}" ]] || [[ "${WEATHER_TEMP}" -gt "${URGENT_HIGHER}" ]]; then
|
||||
exit 33
|
||||
fi
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ -c /dev/video0 ]]; then
|
||||
if [[ "$(fuser /dev/video0)" != "" ]]; then
|
||||
echo "rec"
|
||||
echo "rec"
|
||||
echo ""
|
||||
else
|
||||
echo "on"
|
||||
echo "on"
|
||||
echo ""
|
||||
else
|
||||
echo "off"
|
||||
echo "off"
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
ACTIVE_WINDOW=$(xprop -id $(xprop -root _NET_ACTIVE_WINDOW | cut -d ' ' -f 5) WM_NAME | cut -d '"' -f 2)
|
||||
|
||||
if [[ "${ACTIVE_WINDOW}" != "" ]]; then
|
||||
echo "${ACTIVE_WINDOW}"
|
||||
echo "${ACTIVE_WINDOW}"
|
||||
echo ""
|
||||
fi
|
||||
@@ -0,0 +1,2 @@
|
||||
# Rice
|
||||
# Rice
|
||||
@@ -0,0 +1,478 @@
|
||||
#####################################################################################################################
|
||||
################# Define the $mod variable/key #################
|
||||
#####################################################################################################################
|
||||
|
||||
# Key to rule them all : Super(Windows) or Alt key?
|
||||
|
||||
# Mod4 = Windows or Super key on keyboard
|
||||
# Mod1 = Alt key on keyboard
|
||||
|
||||
#Set Alt key
|
||||
#set $mod Mod1
|
||||
|
||||
#set Super key
|
||||
set $mod Mod4
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# Define the movements keys - variables #################
|
||||
#####################################################################################################################
|
||||
|
||||
|
||||
#This is setup for qwerty
|
||||
set $up l
|
||||
set $down k
|
||||
set $left j
|
||||
set $right semicolon
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# Single and Dual screen #################
|
||||
#####################################################################################################################
|
||||
exec --no-startup-id xrandr --output eDP-1-1 --mode 1920x1080 --rate 60.00
|
||||
exec xrandr --setprovideroutputsource modesetting NVIDIA-0
|
||||
exec xrandr --auto
|
||||
exec --no-startup-id ~/.config/i3/scripts/conky_start.sh
|
||||
exec --no-startup-id ~/.config/i3/scripts/conky_two.sh
|
||||
#exec --no-startup-id ~/.config/i3/scripts/glavastart.sh
|
||||
|
||||
# switch to workspace
|
||||
bindsym $mod+1 workspace 1
|
||||
bindsym $mod+2 workspace 2
|
||||
bindsym $mod+3 workspace 3
|
||||
bindsym $mod+4 workspace 4
|
||||
bindsym $mod+5 workspace 5
|
||||
bindsym $mod+6 workspace 6
|
||||
bindsym $mod+7 workspace 7
|
||||
bindsym $mod+8 workspace 8
|
||||
bindsym $mod+9 workspace 9
|
||||
|
||||
# move focused container to workspace
|
||||
bindsym $mod+Shift+1 move container to workspace 1
|
||||
bindsym $mod+Shift+2 move container to workspace 2
|
||||
bindsym $mod+Shift+3 move container to workspace 3
|
||||
bindsym $mod+Shift+4 move container to workspace 4
|
||||
bindsym $mod+Shift+5 move container to workspace 5
|
||||
bindsym $mod+Shift+6 move container to workspace 6
|
||||
bindsym $mod+Shift+7 move container to workspace 7
|
||||
bindsym $mod+Shift+8 move container to workspace 8
|
||||
bindsym $mod+Shift+9 move container to workspace 9
|
||||
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# 3 menu's in arcolinux #################
|
||||
#####################################################################################################################
|
||||
|
||||
# start dmenu
|
||||
bindsym $mod+shift+d exec --no-startup-id dmenu_run -i -nb '#2E3440' -nf '#81a1c1' -sb '#81a1c1' -sf '#2E3440' -fn 'SourceCodePro:bold:pixelsize=16'
|
||||
|
||||
# start rofi full
|
||||
bindsym $mod+d exec --no-startup-id rofi -show drun -font "Source Code Pro 14"
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# how to exit, logoff, suspend, ... #################
|
||||
#####################################################################################################################
|
||||
|
||||
#Backup exit
|
||||
#Press ctrl+alt+x - check toolbar for next choices
|
||||
bindsym $mod+0 mode "$mode_system"
|
||||
|
||||
set $mode_system System (k) lock, (l) logout, (u) suspend, (h) hibernate, (r) reboot, (s) shutdown
|
||||
mode "$mode_system" {
|
||||
|
||||
bindsym k exec --no-startup-id ~/.config/i3/scripts/i3exit.sh lock, mode "default"
|
||||
# bindsym k exec i3lock -i ~/Pictures/walls/waterfall2.jpg
|
||||
bindsym l exec --no-startup-id ~/.config/i3/scripts/i3exit.sh logout, mode "default"
|
||||
bindsym u exec --no-startup-id ~/.config/i3/scripts/i3exit.sh suspend, mode "default"
|
||||
bindsym h exec --no-startup-id ~/.config/i3/scripts/i3exit.sh hibernate, mode "default"
|
||||
bindsym r exec --no-startup-id ~/.config/i3/scripts/i3exit.sh reboot, mode "default"
|
||||
bindsym s exec --no-startup-id ~/.config/i3/scripts/i3exit.sh shutdown, mode "default"
|
||||
|
||||
# back to normal: Enter or Escape
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
|
||||
# ArcoLinux Logout
|
||||
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# reload changed configuration #################
|
||||
#####################################################################################################################
|
||||
|
||||
|
||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||
bindsym $mod+Shift+r restart
|
||||
|
||||
# reload the configuration file
|
||||
bindsym $mod+Shift+c reload
|
||||
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# Stopping an application #################
|
||||
#####################################################################################################################
|
||||
|
||||
# kill focused window
|
||||
#bindsym $mod+Shift+q kill
|
||||
bindsym $mod+q kill
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# Moving around in i3 #################
|
||||
#####################################################################################################################
|
||||
|
||||
|
||||
# Use Mouse+$mod to drag floating windows to their wanted position
|
||||
floating_modifier $mod
|
||||
|
||||
# toggle tiling / floating
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# change focus
|
||||
bindsym $mod+$left focus left
|
||||
bindsym $mod+$down focus down
|
||||
bindsym $mod+$up focus up
|
||||
bindsym $mod+$right focus right
|
||||
|
||||
# alternatively, you can use the cursor keys:
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
# move focused window
|
||||
bindsym $mod+Shift+$left move left
|
||||
bindsym $mod+Shift+$down move down
|
||||
bindsym $mod+Shift+$up move up
|
||||
bindsym $mod+Shift+$right move right
|
||||
|
||||
# alternatively, you can use the cursor keys:
|
||||
bindsym $mod+Shift+Left move left
|
||||
bindsym $mod+Shift+Down move down
|
||||
bindsym $mod+Shift+Up move up
|
||||
bindsym $mod+Shift+Right move right
|
||||
|
||||
#shortcuts
|
||||
bindsym $mod+F1 exec --no-startup-id firefox
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# moving around workspaces #################
|
||||
#####################################################################################################################
|
||||
|
||||
|
||||
# next/previous workspace
|
||||
|
||||
bindsym Mod1+Tab workspace next
|
||||
bindsym Mod1+Shift+Tab workspace prev
|
||||
bindsym $mod+Tab workspace back_and_forth
|
||||
|
||||
#navigate workspaces next / previous
|
||||
bindsym Mod1+Ctrl+Right workspace next
|
||||
bindsym Mod1+Ctrl+Left workspace prev
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# Scratchpad #################
|
||||
#####################################################################################################################
|
||||
# Make the currently focused window a scratchpad
|
||||
bindsym $mod+Shift+minus move scratchpad
|
||||
|
||||
# Show the first scratchpad window
|
||||
bindsym $mod+minus scratchpad show
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# Tiling parameters #################
|
||||
#####################################################################################################################
|
||||
|
||||
# orientation for new workspaces
|
||||
default_orientation horizontal
|
||||
|
||||
# split in horizontal orientation
|
||||
bindsym $mod+h split h
|
||||
|
||||
# split in vertical orientation
|
||||
bindsym $mod+v split v
|
||||
|
||||
# enter fullscreen mode for the focused container
|
||||
# Super + F in arcolinux is execute thunar
|
||||
bindsym $mod+f fullscreen toggle
|
||||
|
||||
# change container layout (stacked, tabbed, toggle split)
|
||||
# qwerty/azerty issue for letter z
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+w layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
|
||||
# change focus between tiling / floating windows
|
||||
bindsym $mod+space focus mode_toggle
|
||||
|
||||
# focus the parent container
|
||||
bindsym $mod+a focus parent
|
||||
|
||||
#autotiling
|
||||
exec_always --no-startup-id autotiling
|
||||
|
||||
####################################################################################################################
|
||||
# resize window (you can also use the mouse for that)
|
||||
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
mode "resize" {
|
||||
# These bindings trigger as soon as you enter the resize mode
|
||||
|
||||
# Pressing left will shrink the window’s width.
|
||||
# Pressing right will grow the window’s width.
|
||||
# Pressing up will shrink the window’s height.
|
||||
# Pressing down will grow the window’s height.
|
||||
bindsym $left resize shrink width 10 px or 10 ppt
|
||||
bindsym $down resize grow height 10 px or 10 ppt
|
||||
bindsym $up resize shrink height 10 px or 10 ppt
|
||||
bindsym $right resize grow width 10 px or 10 ppt
|
||||
|
||||
# same bindings, but for the arrow keys
|
||||
bindsym Left resize shrink width 10 px or 10 ppt
|
||||
bindsym Down resize grow height 10 px or 10 ppt
|
||||
bindsym Up resize shrink height 10 px or 10 ppt
|
||||
bindsym Right resize grow width 10 px or 10 ppt
|
||||
|
||||
# back to normal: Enter or Escape
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# choose the font #################
|
||||
#####################################################################################################################
|
||||
|
||||
# Font for window titles. Will also be used by the bar unless a different font
|
||||
# is used in the bar {} block below.
|
||||
# choose your font
|
||||
#font pango:Noto Mono Regular 13
|
||||
font pango:Source Code Pro 13
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# autostart - execute applications at boot time #################
|
||||
#####################################################################################################################
|
||||
|
||||
|
||||
#Authentication dialog
|
||||
# exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# applications keyboard shortcuts #################
|
||||
#####################################################################################################################
|
||||
|
||||
bindsym $mod+Return exec --no-startup-id xfce4-terminal;focus
|
||||
|
||||
bindsym control+mod1+u exec --no-startup-id pavucontrol
|
||||
|
||||
bindsym $mod+Shift+Return exec --no-startup-id thunar;focus
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# screenshots #################
|
||||
#####################################################################################################################
|
||||
|
||||
bindsym Print exec gnome-screenshot
|
||||
bindsym $mod+Print exec gnome-screenshot -i
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# audio settings #################
|
||||
#####################################################################################################################
|
||||
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
|
||||
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
|
||||
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# light #################
|
||||
#####################################################################################################################
|
||||
|
||||
# Sreen brightness controls
|
||||
bindsym XF86MonBrightnessUp exec light -A 1 # increase screen brightness
|
||||
bindsym XF86MonBrightnessDown exec light -U 1 # decrease screen brightness
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# bar toggle #################
|
||||
#####################################################################################################################
|
||||
|
||||
# bar toggle, hide or show
|
||||
bindsym $mod+b bar mode toggle
|
||||
|
||||
bindsym $mod+i bar mode invisible
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# Popups control #################
|
||||
#####################################################################################################################
|
||||
|
||||
#Popups during fullscreen mode
|
||||
popup_during_fullscreen smart
|
||||
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# i3 gaps next #################
|
||||
#####################################################################################################################
|
||||
|
||||
for_window [class="^.*"] border pixel 2
|
||||
gaps inner 24
|
||||
gaps outer 10
|
||||
#smart_gaps on
|
||||
#smart_borders on
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# i3 gaps change #################
|
||||
#####################################################################################################################
|
||||
|
||||
|
||||
|
||||
set $mode_gaps Gaps: (o) outer, (i) inner
|
||||
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
|
||||
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
|
||||
bindsym $mod+Shift+g mode "$mode_gaps"
|
||||
|
||||
mode "$mode_gaps" {
|
||||
bindsym o mode "$mode_gaps_outer"
|
||||
bindsym i mode "$mode_gaps_inner"
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
mode "$mode_gaps_inner" {
|
||||
bindsym plus gaps inner current plus 5
|
||||
bindsym minus gaps inner current minus 5
|
||||
bindsym 0 gaps inner current set 0
|
||||
|
||||
bindsym Shift+plus gaps inner all plus 5
|
||||
bindsym Shift+minus gaps inner all minus 5
|
||||
bindsym Shift+0 gaps inner all set 0
|
||||
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
mode "$mode_gaps_outer" {
|
||||
bindsym plus gaps outer current plus 5
|
||||
bindsym minus gaps outer current minus 5
|
||||
bindsym 0 gaps outer current set 0
|
||||
|
||||
bindsym Shift+plus gaps outer all plus 5
|
||||
bindsym Shift+minus gaps outer all minus 5
|
||||
bindsym Shift+0 gaps outer all set 0
|
||||
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
################# picom of i3wm #################
|
||||
#####################################################################################################################
|
||||
|
||||
#if you want transparency on non-focused windows, ...
|
||||
exec_always --no-startup-id picom --config ~/.config/picom/picom.sample.conf
|
||||
exec_always --no-startup-id ~/.config/i3/scripts/mouse.sh
|
||||
exec_always feh --bg-fill /home/quinta/Downloads/735.png
|
||||
exec_always --no-startup-id i3-auto-layout
|
||||
exec_always --no-startup-id $HOME/.config/polybar/launch.sh dark
|
||||
exec_always --no-startup-id i3-auto-layout
|
||||
exec_always --no-startup-id dunst -config $HOME/.config/dunst/base16-nord.dunstrc
|
||||
#note: my custom dunst configuration can be found here https://pastebin.com/P4i1N8ub curl it to $HOME/.config/dunst/base16-nord.dunstrc
|
||||
exec_always --no-startup-id /usr/lib/kdeconnectd
|
||||
|
||||
bindsym Mod4+Mod1+Shift+minus exec \
|
||||
i3-msg "gaps outer current minus 5" && \
|
||||
i3-msg "gaps inner current minus 5"
|
||||
|
||||
bindsym Mod4+Mod1+Shift+plus exec \
|
||||
i3-msg "gaps outer current plus 5" && \
|
||||
i3-msg "gaps inner current plus 5"
|
||||
|
||||
|
||||
|
||||
#####################################################################################################################
|
||||
#####################################################################################################################
|
||||
#####################################################################################################################
|
||||
################# bar appearance #################
|
||||
#####################################################################################################################
|
||||
#####################################################################################################################
|
||||
#####################################################################################################################
|
||||
set $base00 #101218
|
||||
set $base01 #1f222d
|
||||
set $base02 #252936
|
||||
set $base03 #5e81ac
|
||||
set $base04 #C0C5CE
|
||||
set $base05 #d1d4e0
|
||||
set $base06 #C9CCDB
|
||||
set $base07 #ffffff
|
||||
set $base08 #ee829f
|
||||
set $base09 #f99170
|
||||
set $base0A #ffefcc
|
||||
set $base0B #a5ffe1
|
||||
set $base0C #97e0ff
|
||||
set $base0D #97bbf7
|
||||
set $base0E #c0b7f9
|
||||
set $base0F #fcc09e
|
||||
#its neon blue #4666FF
|
||||
|
||||
|
||||
|
||||
##START THEMING WM
|
||||
|
||||
# Window color settings
|
||||
# class border backgr. text indicator
|
||||
client.focused #fbf1c7 #fbf1c7 #ffffff #fbf1c7
|
||||
client.unfocused #32302f #282828 #888888 #32302f
|
||||
client.focused_inactive #282828 #282828 #888888 #282828
|
||||
client.placeholder #282828 # #888888 #82828
|
||||
client.urgent #900000 #900000 #ffffff #900000
|
||||
|
||||
client.background #242424
|
||||
|
||||
##STOP THEMING WM
|
||||
|
||||
#####################################################################################################################
|
||||
#####################################################################################################################
|
||||
#####################################################################################################################
|
||||
#####################################################################################################################
|
||||
#####################################################################################################################
|
||||
######################################## THE END ###########################################
|
||||
#####################################################################################################################
|
||||
#####################################################################################################################
|
||||
#####################################################################################################################
|
||||
#####################################################################################################################
|
||||
#####################################################################################################################
|
||||
@@ -0,0 +1,190 @@
|
||||
# This file has been auto-generated by i3-config-wizard(1).
|
||||
# It will not be overwritten, so edit it as you like.
|
||||
#
|
||||
# Should you change your keyboard layout some time, delete
|
||||
# this file and re-run i3-config-wizard(1).
|
||||
#
|
||||
|
||||
# i3 config file (v4)
|
||||
#
|
||||
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
|
||||
|
||||
set $mod Mod4
|
||||
|
||||
# Font for window titles. Will also be used by the bar unless a different font
|
||||
# is used in the bar {} block below.
|
||||
font pango:monospace 8
|
||||
|
||||
# This font is widely installed, provides lots of unicode glyphs, right-to-left
|
||||
# text rendering and scalability on retina/hidpi displays (thanks to pango).
|
||||
#font pango:DejaVu Sans Mono 8
|
||||
|
||||
# Start XDG autostart .desktop files using dex. See also
|
||||
# https://wiki.archlinux.org/index.php/XDG_Autostart
|
||||
exec --no-startup-id dex --autostart --environment i3
|
||||
|
||||
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
|
||||
# they are included here as an example. Modify as you see fit.
|
||||
|
||||
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
|
||||
# screen before suspend. Use loginctl lock-session to lock your screen.
|
||||
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
|
||||
|
||||
# NetworkManager is the most popular way to manage wireless networks on Linux,
|
||||
# and nm-applet is a desktop environment-independent system tray GUI for it.
|
||||
exec --no-startup-id nm-applet
|
||||
|
||||
# Use pactl to adjust volume in PulseAudio.
|
||||
set $refresh_i3status killall -SIGUSR1 i3status
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
|
||||
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
|
||||
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
|
||||
|
||||
# Use Mouse+$mod to drag floating windows to their wanted position
|
||||
floating_modifier $mod
|
||||
|
||||
# start a terminal
|
||||
bindsym $mod+Return exec termite
|
||||
|
||||
# kill focused window
|
||||
bindsym $mod+q kill
|
||||
|
||||
# start dmenu (a program launcher)
|
||||
bindsym $mod+d exec --no-startup-id dmenu_run
|
||||
# A more modern dmenu replacement is rofi:
|
||||
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"
|
||||
# There also is i3-dmenu-desktop which only displays applications shipping a
|
||||
# .desktop file. It is a wrapper around dmenu, so you need that installed.
|
||||
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
|
||||
|
||||
# change focus
|
||||
bindsym $mod+j focus left
|
||||
bindsym $mod+k focus down
|
||||
bindsym $mod+l focus up
|
||||
bindsym $mod+semicolon focus right
|
||||
|
||||
# alternatively, you can use the cursor keys:
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
# move focused window
|
||||
bindsym $mod+Shift+j move left
|
||||
bindsym $mod+Shift+k move down
|
||||
bindsym $mod+Shift+l move up
|
||||
bindsym $mod+Shift+semicolon move right
|
||||
|
||||
# alternatively, you can use the cursor keys:
|
||||
bindsym $mod+Shift+Left move left
|
||||
bindsym $mod+Shift+Down move down
|
||||
bindsym $mod+Shift+Up move up
|
||||
bindsym $mod+Shift+Right move right
|
||||
|
||||
# split in horizontal orientation
|
||||
bindsym $mod+h split h
|
||||
|
||||
# split in vertical orientation
|
||||
bindsym $mod+v split v
|
||||
|
||||
# enter fullscreen mode for the focused container
|
||||
bindsym $mod+f fullscreen toggle
|
||||
|
||||
# change container layout (stacked, tabbed, toggle split)
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+w layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
# toggle tiling / floating
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# change focus between tiling / floating windows
|
||||
bindsym $mod+space focus mode_toggle
|
||||
|
||||
# focus the parent container
|
||||
bindsym $mod+a focus parent
|
||||
|
||||
# focus the child container
|
||||
#bindsym $mod+d focus child
|
||||
|
||||
# Define names for default workspaces for which we configure key bindings later on.
|
||||
# We use variables to avoid repeating the names in multiple places.
|
||||
set $ws1 "1"
|
||||
set $ws2 "2"
|
||||
set $ws3 "3"
|
||||
set $ws4 "4"
|
||||
set $ws5 "5"
|
||||
set $ws6 "6"
|
||||
set $ws7 "7"
|
||||
set $ws8 "8"
|
||||
set $ws9 "9"
|
||||
set $ws10 "10"
|
||||
|
||||
# switch to workspace
|
||||
bindsym $mod+1 workspace number $ws1
|
||||
bindsym $mod+2 workspace number $ws2
|
||||
bindsym $mod+3 workspace number $ws3
|
||||
bindsym $mod+4 workspace number $ws4
|
||||
bindsym $mod+5 workspace number $ws5
|
||||
bindsym $mod+6 workspace number $ws6
|
||||
bindsym $mod+7 workspace number $ws7
|
||||
bindsym $mod+8 workspace number $ws8
|
||||
bindsym $mod+9 workspace number $ws9
|
||||
bindsym $mod+0 workspace number $ws10
|
||||
|
||||
# move focused container to workspace
|
||||
bindsym $mod+Shift+1 move container to workspace number $ws1
|
||||
bindsym $mod+Shift+2 move container to workspace number $ws2
|
||||
bindsym $mod+Shift+3 move container to workspace number $ws3
|
||||
bindsym $mod+Shift+4 move container to workspace number $ws4
|
||||
bindsym $mod+Shift+5 move container to workspace number $ws5
|
||||
bindsym $mod+Shift+6 move container to workspace number $ws6
|
||||
bindsym $mod+Shift+7 move container to workspace number $ws7
|
||||
bindsym $mod+Shift+8 move container to workspace number $ws8
|
||||
bindsym $mod+Shift+9 move container to workspace number $ws9
|
||||
bindsym $mod+Shift+0 move container to workspace number $ws10
|
||||
|
||||
# reload the configuration file
|
||||
bindsym $mod+Shift+c reload
|
||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||
bindsym $mod+Shift+r restart
|
||||
# exit i3 (logs you out of your X session)
|
||||
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
|
||||
|
||||
# resize window (you can also use the mouse for that)
|
||||
mode "resize" {
|
||||
# These bindings trigger as soon as you enter the resize mode
|
||||
|
||||
# Pressing left will shrink the window’s width.
|
||||
# Pressing right will grow the window’s width.
|
||||
# Pressing up will shrink the window’s height.
|
||||
# Pressing down will grow the window’s height.
|
||||
bindsym j resize shrink width 10 px or 10 ppt
|
||||
bindsym k resize grow height 10 px or 10 ppt
|
||||
bindsym l resize shrink height 10 px or 10 ppt
|
||||
bindsym semicolon resize grow width 10 px or 10 ppt
|
||||
|
||||
# same bindings, but for the arrow keys
|
||||
bindsym Left resize shrink width 10 px or 10 ppt
|
||||
bindsym Down resize grow height 10 px or 10 ppt
|
||||
bindsym Up resize shrink height 10 px or 10 ppt
|
||||
bindsym Right resize grow width 10 px or 10 ppt
|
||||
|
||||
# back to normal: Enter or Escape or $mod+r
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
bindsym $mod+r mode "default"
|
||||
}
|
||||
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
# Start i3bar to display a workspace bar (plus the system information i3status
|
||||
# finds out, if available)
|
||||
#bar {
|
||||
# status_command i3status
|
||||
#}
|
||||
|
||||
#polybar
|
||||
exec_always --no-startup-id $HOME/.config/polybar/launch.sh
|
||||
exec_always feh --bg-fill /home/theglitchh/Pictures/arch.png
|
||||
@@ -0,0 +1,120 @@
|
||||
# i3blocks config file
|
||||
#
|
||||
# Please see man i3blocks for a complete reference!
|
||||
# The man page is also hosted at http://vivien.github.io/i3blocks
|
||||
#
|
||||
# List of valid properties:
|
||||
#
|
||||
align=center
|
||||
# color
|
||||
command=$HOME/.config/i3/Blocks/$BLOCK_NAME
|
||||
# full_text
|
||||
# instance
|
||||
# interval
|
||||
# label
|
||||
markup=none
|
||||
# min_widt
|
||||
# name
|
||||
separator=false
|
||||
separator_block_width=18
|
||||
# short_text
|
||||
# signal
|
||||
# urgent
|
||||
|
||||
|
||||
#plugins
|
||||
|
||||
#[firewall]
|
||||
#interval=10
|
||||
#label=F
|
||||
|
||||
#[window]
|
||||
#interval=1
|
||||
|
||||
#[notifier]
|
||||
#label=
|
||||
#interval=1
|
||||
|
||||
#[microphone]
|
||||
#label=m
|
||||
#interval=100
|
||||
|
||||
[playerctl2]
|
||||
label=
|
||||
interval=5
|
||||
|
||||
[mediaplayer]
|
||||
label=
|
||||
interval=1
|
||||
|
||||
#[weather]
|
||||
#instance=1808773
|
||||
#label=寨
|
||||
#interval=2
|
||||
|
||||
#[weather]
|
||||
#instance=1792947
|
||||
#label=津
|
||||
#interval=300
|
||||
|
||||
[bandwidth]
|
||||
instance=wlp2s0;in
|
||||
label=
|
||||
interval=1
|
||||
|
||||
[bandwidth]
|
||||
instance=wlp2s0;out
|
||||
label=
|
||||
interval=1
|
||||
|
||||
[ssid]
|
||||
label=
|
||||
interval=60
|
||||
|
||||
[volume]
|
||||
interval=1
|
||||
|
||||
[brightness]
|
||||
label=
|
||||
interval=1
|
||||
|
||||
[battery]
|
||||
label=
|
||||
instance=0
|
||||
interval=5
|
||||
|
||||
|
||||
[temperature]
|
||||
instance=Core
|
||||
label=
|
||||
interval=5
|
||||
|
||||
[memory]
|
||||
label=
|
||||
interval=30
|
||||
|
||||
[cpu]
|
||||
label=
|
||||
interval=2
|
||||
|
||||
[time]
|
||||
interval=1
|
||||
label=
|
||||
|
||||
[usb]
|
||||
instance=kingston
|
||||
interval=10
|
||||
separator_block_width=10
|
||||
|
||||
[fcitx]
|
||||
interval=10
|
||||
separator_block_width=10
|
||||
|
||||
[sslocal]
|
||||
interval=300
|
||||
separator_block_width=10
|
||||
|
||||
[keystate]
|
||||
interval=3
|
||||
|
||||
|
||||
+226
@@ -0,0 +1,226 @@
|
||||
# Thank you code_nomad: http://9m.no/ꪯ鵞
|
||||
# and Arch Wiki contributors: https://wiki.archlinux.org/index.php/Compton
|
||||
|
||||
#################################
|
||||
#
|
||||
# Backend
|
||||
#
|
||||
#################################
|
||||
|
||||
# Backend to use: "xrender" or "glx".
|
||||
# GLX backend is typically much faster but depends on a sane driver.
|
||||
backend = "glx";
|
||||
#backend = "xrender"
|
||||
|
||||
#################################
|
||||
#
|
||||
# GLX backend
|
||||
#
|
||||
#################################
|
||||
|
||||
glx-no-stencil = true;
|
||||
|
||||
# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
|
||||
# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified,
|
||||
# but a 20% increase when only 1/4 is.
|
||||
# My tests on nouveau show terrible slowdown.
|
||||
glx-copy-from-front = false;
|
||||
|
||||
# GLX backend: Use MESA_copy_sub_buffer to do partial screen update.
|
||||
# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated.
|
||||
# May break VSync and is not available on some drivers.
|
||||
# Overrides --glx-copy-from-front.
|
||||
# glx-use-copysubbuffermesa = true;
|
||||
|
||||
# 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).
|
||||
# Recommended if it works.
|
||||
glx-no-rebind-pixmap = true;
|
||||
|
||||
# GLX backend: GLX buffer swap method we assume.
|
||||
# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
|
||||
# undefined is the slowest and the safest, and the default value.
|
||||
# copy is fastest, but may fail on some drivers,
|
||||
# 2-6 are gradually slower but safer (6 is still faster than 0).
|
||||
# Usually, double buffer means 2, triple buffer means 3.
|
||||
# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
|
||||
# Useless with --glx-use-copysubbuffermesa.
|
||||
# Partially breaks --resize-damage.
|
||||
# Defaults to undefined.
|
||||
#glx-swap-method = "undefined";
|
||||
|
||||
#################################
|
||||
#
|
||||
# Shadows
|
||||
#
|
||||
#################################
|
||||
|
||||
# Enabled client-side shadows on windows.
|
||||
shadow = true;
|
||||
# The blur radius for shadows. (default 12)
|
||||
shadow-radius = 9;
|
||||
# The left offset for shadows. (default -15)
|
||||
shadow-offset-x = -9.5;
|
||||
# The top offset for shadows. (default -15)
|
||||
shadow-offset-y = -9;
|
||||
# The translucency for shadows. (default .75)
|
||||
shadow-opacity = 1;
|
||||
|
||||
log-level = "warn";
|
||||
#change your username here
|
||||
#log-file = "/home/erik/.config/compton.log";
|
||||
|
||||
# Set if you want different colour shadows
|
||||
# shadow-red = 0.0;
|
||||
# shadow-green = 0.0;
|
||||
# shadow-blue = 0.0;
|
||||
|
||||
# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches
|
||||
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
|
||||
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
|
||||
shadow-exclude = [
|
||||
"! name~=''",
|
||||
"name = 'Notification'",
|
||||
"name = 'Plank'",
|
||||
"name = 'Docky'",
|
||||
"name = 'Kupfer'",
|
||||
"name = 'xfce4-notifyd'",
|
||||
"name *= 'VLC'",
|
||||
"name *= 'compton'",
|
||||
"class_g = 'Firefox' && argb",
|
||||
"class_g = 'Conky'",
|
||||
"class_g = 'Kupfer'",
|
||||
"class_g = 'Synapse'",
|
||||
"class_g ?= 'Notify-osd'",
|
||||
"class_g ?= 'Cairo-dock'",
|
||||
"class_g = 'Cairo-clock'",
|
||||
"class_g ?= 'Xfce4-notifyd'",
|
||||
"class_g ?= 'Xfce4-power-manager'",
|
||||
"_GTK_FRAME_EXTENTS@:c",
|
||||
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
|
||||
];
|
||||
# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners)
|
||||
shadow-ignore-shaped = false;
|
||||
|
||||
#################################
|
||||
#
|
||||
# Opacity
|
||||
#
|
||||
#################################
|
||||
|
||||
inactive-opacity = 1;
|
||||
active-opacity = 1;
|
||||
frame-opacity = 1;
|
||||
inactive-opacity-override = false;
|
||||
|
||||
# Dim inactive windows. (0.0 - 1.0)
|
||||
# inactive-dim = 0.2;
|
||||
# Do not let dimness adjust based on window opacity.
|
||||
# inactive-dim-fixed = true;
|
||||
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
|
||||
# blur-background = true;
|
||||
# Blur background of opaque windows with transparent frames as well.
|
||||
# blur-background-frame = true;
|
||||
# Do not let blur radius adjust based on window opacity.
|
||||
blur-background-fixed = false;
|
||||
blur-background-exclude = [
|
||||
"window_type = 'dock'",
|
||||
"window_type = 'desktop'",
|
||||
"_GTK_FRAME_EXTENTS@:c"
|
||||
];
|
||||
|
||||
#################################
|
||||
#
|
||||
# Fading
|
||||
#
|
||||
#################################
|
||||
|
||||
# Fade windows during opacity changes.
|
||||
fading = true;
|
||||
# The time between steps in a fade in milliseconds. (default 10).
|
||||
fade-delta = 5;
|
||||
# Opacity change between steps while fading in. (default 0.028).
|
||||
fade-in-step = 0.03;
|
||||
# Opacity change between steps while fading out. (default 0.03).
|
||||
fade-out-step = 0.03;
|
||||
# Fade windows in/out when opening/closing
|
||||
# no-fading-openclose = true;
|
||||
|
||||
# Specify a list of conditions of windows that should not be faded.
|
||||
fade-exclude = [ ];
|
||||
|
||||
#################################
|
||||
#
|
||||
# Other
|
||||
#
|
||||
#################################
|
||||
|
||||
# Try to detect WM windows and mark them as active.
|
||||
mark-wmwin-focused = true;
|
||||
# Mark all non-WM but override-redirect windows active (e.g. menus).
|
||||
mark-ovredir-focused = true;
|
||||
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
|
||||
# Usually more reliable but depends on a EWMH-compliant WM.
|
||||
use-ewmh-active-win = true;
|
||||
# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
|
||||
detect-rounded-corners = false;
|
||||
|
||||
# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows.
|
||||
# This prevents opacity being ignored for some apps.
|
||||
# For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
|
||||
detect-client-opacity = true;
|
||||
|
||||
# Specify refresh rate of the screen.
|
||||
# If not specified or 0, compton will try detecting this with X RandR extension.
|
||||
#refresh-rate = 48;
|
||||
|
||||
# Vertical synchronization: match the refresh rate of the monitor
|
||||
# this breaks transparency in virtualbox - put a "#" before next line to fix that
|
||||
vsync = true;
|
||||
|
||||
# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
|
||||
# Reported to have no effect, though.
|
||||
dbe = true;
|
||||
|
||||
# Limit compton to repaint at most once every 1 / refresh_rate second to boost performance.
|
||||
# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already,
|
||||
# unless you wish to specify a lower refresh rate than the actual value.
|
||||
#sw-opti = true;
|
||||
|
||||
# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games.
|
||||
# Known to cause flickering when redirecting/unredirecting windows.
|
||||
unredir-if-possible = false;
|
||||
|
||||
# Specify a list of conditions of windows that should always be considered focused.
|
||||
focus-exclude = [ ];
|
||||
|
||||
# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time.
|
||||
detect-transient = true;
|
||||
# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time.
|
||||
# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too.
|
||||
detect-client-leader = true;
|
||||
|
||||
#################################
|
||||
#
|
||||
# Window type settings
|
||||
#
|
||||
#################################
|
||||
|
||||
wintypes:
|
||||
{
|
||||
tooltip = { fade = true; shadow = true; opacity = 0.9; focus = true;};
|
||||
dock = { shadow = true; }
|
||||
dnd = { shadow = false; }
|
||||
popup_menu = { opacity = 1; }
|
||||
dropdown_menu = { opacity = 1; }
|
||||
};
|
||||
|
||||
######################
|
||||
#
|
||||
# XSync
|
||||
# See: https://github.com/yshui/compton/commit/b18d46bcbdc35a3b5620d817dd46fbc76485c20d
|
||||
#
|
||||
######################
|
||||
|
||||
# Use X Sync fence to sync clients' draw calls. Needed on nvidia-drivers with GLX backend for some users.
|
||||
xrender-sync-fence = true;
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
case "$1" in
|
||||
lock)
|
||||
i3lock -i ~/Pictures/walls/waterfall2.jpg
|
||||
;;
|
||||
logout)
|
||||
i3-msg exit
|
||||
;;
|
||||
suspend)
|
||||
systemctl suspend
|
||||
;;
|
||||
hibernate)
|
||||
systemctl hibernate
|
||||
;;
|
||||
reboot)
|
||||
systemctl reboot
|
||||
;;
|
||||
shutdown)
|
||||
systemctl poweroff
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
# Version 0.1 Tuesday, 07 May 2013
|
||||
# Comments and complaints http://www.nicknorton.net
|
||||
# GUI for mouse wheel speed using imwheel in Gnome
|
||||
# imwheel needs to be installed for this script to work
|
||||
# sudo apt-get install imwheel
|
||||
# Pretty much hard wired to only use a mouse with
|
||||
# left, right and wheel in the middle.
|
||||
# If you have a mouse with complications or special needs,
|
||||
# use the command xev to find what your wheel does.
|
||||
#
|
||||
### see if imwheel config exists, if not create it ###
|
||||
if [ ! -f ~/.imwheelrc ]
|
||||
then
|
||||
|
||||
cat >~/.imwheelrc<<EOF
|
||||
".*"
|
||||
None, Up, Button4, 1
|
||||
None, Down, Button5, 1
|
||||
Control_L, Up, Control_L|Button4
|
||||
Control_L, Down, Control_L|Button5
|
||||
Shift_L, Up, Shift_L|Button4
|
||||
Shift_L, Down, Shift_L|Button5
|
||||
EOF
|
||||
|
||||
fi
|
||||
##########################################################
|
||||
|
||||
CURRENT_VALUE=$(awk -F 'Button4,' '{print $2}' ~/.imwheelrc)
|
||||
|
||||
NEW_VALUE=3
|
||||
|
||||
if [ "$NEW_VALUE" == "" ];
|
||||
then exit 0
|
||||
fi
|
||||
|
||||
sed -i "s/\($TARGET_KEY *Button4, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button4, and write new value.
|
||||
sed -i "s/\($TARGET_KEY *Button5, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button5, and write new value.
|
||||
|
||||
cat ~/.imwheelrc
|
||||
imwheel -kill
|
||||
|
||||
# END OF SCRIPT FILE
|
||||
Reference in New Issue
Block a user