added seafile icon for status
This commit is contained in:
parent
d53b1c26b9
commit
cab1b9ec31
41
bin/seafile_check
Executable file
41
bin/seafile_check
Executable file
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Gets the current seafile status to display icon
|
||||
|
||||
SYNC_COMPLETE=$(printf '%s %s' '%{F#0F0}' $(echo -e '\Uf0216')) # green
|
||||
SYNC_IN_PROGRESS=$(printf '%s %s' '%{F#FF0}' $(echo -e '\Uf1216')) # yellow
|
||||
SYNC_FAILED=$(printf '%s %s' '%{F#F00}' $(echo -e '\Uf0b98')) # red
|
||||
|
||||
if ! command -v seaf-cli &>/dev/null ; then
|
||||
echo "Seafile not downloaded to device!">2
|
||||
echo "$SYNC_FAILED"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# getting folder status and trimming headers
|
||||
SEAFILE_STATUS=$(seaf-cli status | tail -n +2)
|
||||
ERRORS=$(echo "$SEAFILE_STATUS" | grep "error")
|
||||
if [[ -n "$ERRORS" ]] ; then
|
||||
# some directories have errors
|
||||
echo "Error: Failed to sync">2
|
||||
echo "$ERRORS">2
|
||||
echo "$SYNC_FAILED"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
IN_PROGRESS=$(echo "$SEAFILE_STATUS" | grep -v "synchronized")
|
||||
if [[ -n "$IN_PROGRESS" ]] ; then
|
||||
# some form of syncing in progress
|
||||
echo "$SYNC_IN_PROGRESS"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -z "$IN_PROGRESS" ]] ; then
|
||||
# nothing in progress and no errors
|
||||
echo "$SYNC_COMPLETE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# should never get here
|
||||
echo "UNKNOWN_ERROR!">2
|
||||
exit 1
|
@ -35,7 +35,7 @@ exec --no-startup-id dex --autostart --environment i3 'workspace 2; exec brave-b
|
||||
|
||||
# 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
|
||||
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock-blur --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.
|
||||
@ -59,7 +59,7 @@ floating_modifier $mod
|
||||
bindsym $mod+Return exec st
|
||||
|
||||
# lock the screen
|
||||
bindsym $mod+q exec ~/.local/bin/i3lock-blur
|
||||
bindsym $mod+q exec i3lock-blur
|
||||
|
||||
# kill focused window
|
||||
bindsym $mod+Shift+q kill
|
||||
|
@ -18,6 +18,8 @@ separator = |
|
||||
separator-foreground = ${colors.disabled}
|
||||
module-margin = 1
|
||||
padding = 2
|
||||
; multi-monitor support
|
||||
monitor = ${env:MONITOR}
|
||||
; places bar at the top
|
||||
bottom = false
|
||||
fixed-center = true
|
||||
@ -32,7 +34,7 @@ inherit = section/base-bar
|
||||
height = 16pt
|
||||
; modules
|
||||
modules-left = xworkspaces xwindow-thinkpad weather-thinkpad
|
||||
modules-right = battery pulseaudio memory cpu wlan date
|
||||
modules-right = battery pulseaudio memory cpu wlan seafile date
|
||||
|
||||
[bar/desktop-bar]
|
||||
; desktop bar config
|
||||
@ -42,7 +44,7 @@ height = 24pt
|
||||
; modules
|
||||
modules-left = xworkspaces xwindow-desktop
|
||||
modules-center = weather-desktop
|
||||
modules-right = pulseaudio memory cpu eth date
|
||||
modules-right = pulseaudio memory cpu eth seafile date
|
||||
|
||||
|
||||
|
||||
@ -174,5 +176,11 @@ date-alt = %a, %b %d %l:%M %P
|
||||
label = %date%
|
||||
label-foreground = ${colors.primary}
|
||||
|
||||
[module/seafile]
|
||||
; custom seafile script
|
||||
type = custom/script
|
||||
exec = seafile_check
|
||||
interval = 3
|
||||
|
||||
[settings]
|
||||
screenchange-reload = true
|
||||
|
@ -9,6 +9,7 @@
|
||||
~/.local/bin/ssh_agent_check: bin/ssh_agent_check
|
||||
~/.local/bin/display_uptime: bin/display_uptime
|
||||
~/.local/bin/docker_check: bin/docker_check
|
||||
~/.local/bin/seafile_check: bin/seafile_check
|
||||
~/.local/bin/watertracker: src/watertracker/watertracker
|
||||
~/.local/bin/weather: src/weather/weather
|
||||
~/.local/bin/bluebikes: src/bluebikes/bluebikes
|
||||
|
Loading…
x
Reference in New Issue
Block a user