Browse Source

Remove lemonbar scripts

master
Riyyi 5 years ago
parent
commit
99f13642c1
  1. 4
      .config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml
  2. 2
      .config/xorg/xinitrc
  3. 39
      .scripts/panel/battery.sh
  4. 23
      .scripts/panel/brightness.sh
  5. 15
      .scripts/panel/iface.sh
  6. 129
      .scripts/panel/lemonbar.sh
  7. 34
      .scripts/panel/volume.sh
  8. 31
      .scripts/panel/wifi.sh
  9. 36
      .scripts/panel/workspaces.sh
  10. 4
      packages

4
.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml

@ -15,4 +15,8 @@
<property name="last-sort-column" type="string" value="THUNAR_COLUMN_NAME"/>
<property name="last-sort-order" type="string" value="GTK_SORT_ASCENDING"/>
<property name="last-side-pane" type="string" value="ThunarShortcutsPane"/>
<property name="last-location-bar" type="string" value="ThunarLocationEntry"/>
<property name="hidden-bookmarks" type="array">
<value type="string" value="network:///"/>
</property>
</channel>

2
.config/xorg/xinitrc

@ -21,7 +21,7 @@ inputctl.sh -s off
# Daemon starting
dunst &
redshift &
redshift -P &
emacs --daemon &
thunar --daemon &

39
.scripts/panel/battery.sh

@ -1,39 +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="-"
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 -t 30000 "Battery critically low!"
fi
else
if [ "$CAPACITY" -ge "95" ]; then
notify-send -u low -r 1 "You should probably unplug."
fi
ICON=""
fi
printf "%s\n" "battery%{F$COLOR}$ICON $CAPACITY%$TIME%{F-}"

23
.scripts/panel/brightness.sh

@ -1,23 +0,0 @@
#!/bin/sh
BRIGHTNESS_CONTROL="$HOME/.scripts/brightnesscontrol.sh"
# Right click, scroll up, scroll down
R="A3:$BRIGHTNESS_CONTROL s 30:"
U="A4:$BRIGHTNESS_CONTROL u 10:"
D="A5:$BRIGHTNESS_CONTROL d 10:"
PERCENTAGE=$($BRIGHTNESS_CONTROL getbrightness)
if [ "$PERCENTAGE" -ge "75" ]; then
ICON="" # f111
elif [ "$PERCENTAGE" -ge "25" ]; then
ICON="" # f042
else
ICON="" # f1ce
# ICON="" # f111
fi
INPUT="%{$R}%{$U}%{$D}"
END="%{A}%{A}%{A}"
printf "%s\n" "brightness$INPUT$ICON $PERCENTAGE%$END" > "$PANEL_PIPE" &

15
.scripts/panel/iface.sh

@ -1,15 +0,0 @@
#!/bin/sh
ICON=""
WIRED="${1:-eth0}"
COLOR="-"
if [ ! -d /sys/class/net/${WIRED} ] ||
[ "$(cat /sys/class/net/$WIRED/operstate)" = 'down' ] ||
[ "$(ip a | grep $WIRED | awk '/inet / {print $2}')" = "" ]; then
COLOR="$COLOR7"
else
COLOR="$COLOR15"
fi
printf "%s\n" "iface%{F$COLOR}$ICON%{F-}"

129
.scripts/panel/lemonbar.sh

@ -1,129 +0,0 @@
#!/bin/sh
title() {
# Grab focused window's ID
if [ -n "$1" ]; then
ID="$(printf "%s" "$1" | cut -f 2)"
else
ID="$(xprop -root '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"
fi
# Grabs focused window's title
if [ "$ID" = "0x0" ]; then
TITLE=""
else
TITLE="$(xprop -id "$ID" ' $0' WM_NAME | awk '{
$1=""; $0=substr($0, 3, length($0) - 3);
if (length($0) <= 75)
print $0
else
print substr($0, 1, 72)"..."
}')"
fi
printf "%s\n" "title$TITLE"
}
clock() {
# Grabs date in 11:59 A/PM format
DATETIME=$(date "+%I:%M %p")
printf "%s\n" "clock $DATETIME"
}
bar() {
lemonbar \
-a 20 -g x"$PANEL_HEIGHT" -n "$PANEL_NAME" \
-f "DejaVu Sans-8" -o 0 \
-f "FontAwesome5Free Solid-8" -o -3 \
-f "FontAwesome5Free Regular-8" -o -3 \
-f "FontAwesome5 Brands-8" -o -3 \
-B "$BGCOLOR_INACTIVE" -F "$COLOR15"
}
start() {
# Kill existing panel
while [ "$(pgrep -cx lemonbar.sh)" -gt 1 ]; do
pkill -ox -9 lemonbar.sh;
done
pkill xprop
pkill sleep
# Trap all subshells
trap 'trap - TERM; kill 0' INT TERM QUIT EXIT
# Create named pipe
[ -p $PANEL_PIPE ] && rm "$PANEL_PIPE"
mkfifo "$PANEL_PIPE"
# Directory of this script
DIR="$(dirname "$0")"
# Setup workspaces block with xprop events
xprop -root -spy _NET_CURRENT_DESKTOP _NET_NUMBER_OF_DESKTOPS | while read -r line; do
"$DIR"/workspaces.sh
done > "$PANEL_PIPE" &
# Setup window title block with xprop events
xprop -root -spy '\t$0\n' _NET_ACTIVE_WINDOW | while read -r line; do
title "$line"
done > "$PANEL_PIPE" &
# Setup interrupt blocks
"$DIR"/volume.sh
"$DIR"/brightness.sh
# Setup block timers
while :; do title; sleep 1; done > "$PANEL_PIPE" &
while :; do "$DIR"/wifi.sh; sleep 10; done > "$PANEL_PIPE" &
while :; do "$DIR"/iface.sh; sleep 10; done > "$PANEL_PIPE" &
while :; do "$DIR"/battery.sh; sleep 30; done > "$PANEL_PIPE" &
while :; do clock; sleep 5; done > "$PANEL_PIPE" &
while read -r line ; do
case $line in
workspaces*)
workspaces=${line#workspaces}
;;
title*)
title=${line#title}
;;
volume*)
volume=${line#volume}
;;
brightness*)
brightness=${line#brightness}
;;
wifi*)
wifi=${line#wifi}
;;
iface*)
iface=${line#iface}
;;
battery*)
battery=${line#battery}
;;
clock*)
clock=${line#clock}
;;
esac
printf "%s\n" "%{l}$workspaces%{c}$title%{r}$volume $brightness $wifi $iface $battery $clock "
done < "$PANEL_PIPE" | bar | sh &
# Tray and panel on top of the root window, fixes fullscreen programs
if [ "$WM" = "bspwm" ];then
ROOT="$(xdo id -N Bspwm -n root | sort | head -n 1)"
PANEL_ID=$(xdo id -m -a "$PANEL_NAME")
TRAY_ID=$(xdo id -a "stalonetray")
xdo above -t "$ROOT" "$TRAY_ID" "$PANEL_ID"
fi
wait
}
case "$1" in
start)
"$1"
;;
"")
start
;;
esac

34
.scripts/panel/volume.sh

@ -1,34 +0,0 @@
#!/bin/sh
MEDIA_CONTROL="$HOME/.scripts/mediacontrol.sh"
# Left click, scroll click, right click, scroll up and scroll down
L="A1:pavucontrol:"
S="A2:$MEDIA_CONTROL set 0:"
R="A3:$MEDIA_CONTROL toggle:"
U="A4:$MEDIA_CONTROL up 5:"
D="A5:$MEDIA_CONTROL down 5:"
VOLUME="$($MEDIA_CONTROL getvolume)"
COLOR="-"
if [ "$($MEDIA_CONTROL getmute)" = "true" ]; then
COLOR="$COLOR7"
SYMBOL=""
else
COLOR="$COLOR15"
if [ "$VOLUME" -ge "50" ]; then
SYMBOL=""
elif [ "$VOLUME" -ge "25" ]; then
SYMBOL=""
else
SYMBOL=""
fi
fi
INPUT="%{$L}%{$S}%{$R}%{$U}%{$D}"
END="%{A}%{A}%{A}%{A}%{A}"
printf "%s\n" "volume%{F$COLOR}$INPUT$SYMBOL $VOLUME%$END%{F-}" > "$PANEL_PIPE" &

31
.scripts/panel/wifi.sh

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

36
.scripts/panel/workspaces.sh

@ -1,36 +0,0 @@
#!/bin/sh
# Suppress output
NULL=""
# Scroll up, scroll down
if [ "$WM" = "bspwm" ];then
SWITCH="bspc desktop -f"
U="A4:$SWITCH prev.local:"
D="A5:$SWITCH next.local:"
elif [ "$WM" = "i3" ];then
SWITCH="i3-msg workspace"
NULL="> /dev/null 2>&1"
U="A4:$SWITCH prev_on_output $NULL:"
D="A5:$SWITCH next_on_output $NULL:"
fi
CURRENT=$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3 + 1}')
WORKSPACES="$(xprop -root '\n$0\n$1\n$2\n$3\n$4\n$5\n$6\n$7\n$8\n$9' _NET_DESKTOP_NAMES \
| awk -v c="$CURRENT" -v s="$SWITCH" -v n="$NULL" \
-v c7="$COLOR7" -v c15="$COLOR15" -v b="$BGCOLOR" -v bi="$BGCOLOR_INACTIVE" '
/".*"/ {
name = substr($0, 2, length($0) - 2);
if (c == FNR - 1)
printf "%{B%s} %s %{B%s}",
b, name, bi
else
printf "%{F%s}%{A:%s \"%s\" %s:} %s %{A}%{F%s}",
c7, s, name, n, name, c15
}
')"
printf "%s\n" "workspaces%{$U}%{$D}$WORKSPACES%{A}%{A}"

4
packages

@ -5,7 +5,7 @@ arandr
arc-gtk-theme
arc-icon-theme
base
breeze-icons-git
breeze-icons
brightnessctl
bspwm
capitaine-cursors
@ -60,7 +60,6 @@ jq
kdenlive
kolourpaint
krita
lemonbar-xft-git
lib32-alsa-lib
lib32-alsa-plugins
lib32-glibc
@ -73,6 +72,7 @@ linux
linux-headers
linux-lts
linux-lts-headers
llvm
lvm2
lxappearance
man-db

Loading…
Cancel
Save