Browse Source

Remove i3bar and i3blocks

master
Riyyi 5 years ago
parent
commit
6233d49805
  1. 88
      .config/i3/blocks
  2. 17
      .config/i3/config
  3. 41
      .scripts/wm/battery.sh
  4. 21
      .scripts/wm/brightness.sh
  5. 13
      .scripts/wm/iface.sh
  6. 31
      .scripts/wm/volume.sh
  7. 32
      .scripts/wm/wifi.sh
  8. 1
      packages

88
.config/i3/blocks

@ -1,88 +0,0 @@
# 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
# color
# command
# full_text
# instance
# interval
# label
# min_width
# name
# separator
# separator_block_width
# short_text
# signal
# urgent
# Global properties
#
# The top properties below are applied to every block, but can be overridden.
# Each block command defaults to the script name to avoid boilerplate.
command=$HOME/.scripts/wm/$BLOCK_NAME
separator_block_width=20
markup=none
separator=false
align=center
[volume.sh]
markup=pango
interval=once
signal=1
[brightness.sh]
interval=once
signal=2
[wifi.sh]
interval=10
[iface.sh]
interval=10
[battery.sh]
interval=30
[time]
label=
command=date '+%I:%M %p '
interval=5
# Generic media player support
#
# This displays "ARTIST - SONG" if a music is playing.
# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others.
#[mediaplayer]
#instance=spotify
#interval=5
#signal=10
# Temperature
#
# Support multiple chips, though lm-sensors.
# The script may be called with -w and -c switches to specify thresholds,
# see the script for details.
#[temperature]
#label=TEMP
#interval=10
# Key indicators
#
# Add the following bindings to i3 config file:
#
# bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks
# bindsym --release Num_Lock exec pkill -SIGRTMIN+11 i3blocks
#[keyindicator]
#instance=CAPS
#interval=once
#signal=11
#[keyindicator]
#instance=NUM
#interval=once
#signal=11

17
.config/i3/config

@ -56,23 +56,6 @@ client.urgent $bgcolor_urgent $bgcolor_urgent $white $dar
# Font
font pango:DejaVu Sans, FontAwesome5Free Solid, FontAwesome5Brands 8
bar {
colors {
background $bgcolor_inactive
separator $darkwhite
statusline $white
# border background text
focused_workspace $bgcolor $bgcolor $white
inactive_workspace $bgcolor_inactive $bgcolor_inactive $darkwhite
active_workspace $bgcolor_inactive $bgcolor_inactive $darkwhite
urgent_workspace $bgcolor_urgent $bgcolor_urgent $white
}
# position top
status_command i3blocks -c $HOME/.config/i3/blocks
#strip_workspace_numbers yes
tray_output primary
}
##--- Bindings ---##
#--- Basic bindings ---#

41
.scripts/wm/battery.sh

@ -1,41 +0,0 @@
#!/bin/sh
BAT_INFO=${BLOCK_INSTANCE:-"$(acpi -b | grep ': [^Unknown]')"}
CAPACITY=$(echo $BAT_INFO | awk '{ print int($4) }')
TIME="$(echo $BAT_INFO | awk '{ print substr($5, 0, length($5) - 3) }')"
CHARACTER=":"
if [ "$TIME" != "" ] && [ "${TIME#*$CHARACTER}" != "$TIME" ]; then
TIME=" ($TIME)"
else
TIME=""
fi
COLOR="$COLOR15"
if [ "$(echo $BAT_INFO | awk '{ print $6 }')" = "remaining" ]; then
if [ "$CAPACITY" -ge "80" ]; then
ICON=""
elif [ "$CAPACITY" -ge "60" ]; then
ICON=""
elif [ "$CAPACITY" -ge "40" ]; then
ICON=""
elif [ "$CAPACITY" -ge "20" ]; then
ICON=""
else
ICON=""
COLOR="$COLOR9"
notify-send -u critical -r 1 "Battery critically low!"
fi
else
if [ "$CAPACITY" -ge "95" ]; then
notify-send -u low -r 1 "You should probably unplug."
fi
ICON=""
fi
echo "$ICON $CAPACITY%$TIME"
echo "$ICON $CAPACITY%"
echo "$COLOR"

21
.scripts/wm/brightness.sh

@ -1,21 +0,0 @@
#!/bin/sh
case $BLOCK_BUTTON in
3) brightnessctl -q s 30% ;; # right click
4) brightnessctl -q s +10% ;; # scroll up
5) brightnessctl -q s 10%- ;; # scroll down
esac
PERCENTAGE=$(brightnessctl | awk '/\([0-9]+%\)/ { print substr($4, 2, length($4) - 3) }')
if [ "$PERCENTAGE" -ge "75" ]; then
ICON=""
elif [ "$PERCENTAGE" -ge "25" ]; then
ICON=""
else
ICON=""
fi
echo "$ICON $PERCENTAGE%"
echo "$ICON $PERCENTAGE%"
echo "$COLOR15"

13
.scripts/wm/iface.sh

@ -1,13 +0,0 @@
#!/bin/sh
WIRED="${BLOCK_INSTANCE:-eth0}"
echo ""
echo ""
if [ ! -d /sys/class/net/${WIRED} ] ||
[ "$(cat /sys/class/net/$WIRED/operstate)" = 'down' ] ||
[ "$(ip a | grep $WIRED | awk '/inet / {print $2}')" = "" ]; then
echo "$COLOR7"
else
echo "$COLOR15"
fi

31
.scripts/wm/volume.sh

@ -1,31 +0,0 @@
#!/bin/sh
MEDIACONTROL="$HOME/.scripts/mediacontrol.sh"
case $BLOCK_BUTTON in
1) pavucontrol ;; # Left click
2) $MEDIACONTROL set 0 ;; # Scroll click
3) $MEDIACONTROL toggle ;; # Right click
4) $MEDIACONTROL up 5 ;; # Scroll up
5) $MEDIACONTROL down 5 ;; # Scroll down
esac
VOLUME="$($MEDIACONTROL getvolume)%"
if [ "$($MEDIACONTROL getmute)" = "1" ]; then
COLOR="$COLOR7"
SYMBOL=""
else
COLOR="$COLOR15"
if [ "${VOLUME%?}" -ge "50" ]; then
SYMBOL=""
elif [ "${VOLUME%?}" -ge "25" ]; then
SYMBOL=""
else
SYMBOL=""
fi
fi
echo "<span color='$COLOR'>$SYMBOL $VOLUME</span>"

32
.scripts/wm/wifi.sh

@ -1,32 +0,0 @@
#!/bin/sh
WIRELESS="${BLOCK_INSTANCE:-wlan0}"
ICON=""
if [ ! -d /sys/class/net/${WIRELESS}/wireless ] ||
[ "$(cat /sys/class/net/$WIRELESS/operstate)" = 'down' ]; then
echo "$ICON"
echo "$ICON"
echo "$COLOR7"
else
SSID="$(iw dev $WIRELESS link | awk '/SSID/ { print $2 }')"
QUALITY=$(grep $WIRELESS /proc/net/wireless | \
awk '{ print int($3 * 100 / 70) }')
echo "$ICON $QUALITY%"
echo "$ICON $QUALITY%"
echo "$COLOR15"
fi
notify() {
notify-send -r 3 "Wifi" "\
Interface: $WIRELESS
SSID: $SSID
IP: $(ip a show $WIRELESS | \
awk '/inet / { print substr($2, 0, length($2) - 3) }')"
}
case $BLOCK_BUTTON in
1) notify ;;
esac

1
packages

@ -38,7 +38,6 @@ gvfs-gphoto2
gvfs-mtp
gvim
htop
i3blocks
i3-gaps
i3lock-color-git
imagemagick

Loading…
Cancel
Save