This commit is contained in:
Pavel Korytov 2020-08-24 15:52:43 +05:00
parent 587d6edb6a
commit 9e17ed451f
5 changed files with 59 additions and 30 deletions

View file

@ -1,5 +1,5 @@
#!/bin/bash
afk_event=$(curl -s -X GET "http://localhost:5600/api/0/buckets/aw-watcher-afk_pdsk/events?limit=1" -H "accept: application/json")
afk_event=$(curl -s -X GET "http://localhost:5600/api/0/buckets/aw-watcher-afk_pntk/events?limit=1" -H "accept: application/json")
status=$(echo ${afk_event} | jq -r '.[0].data.status')
afk_time=$(echo "${afk_event}" | jq -r '.[0].duration' | xargs -I ! date -u -d @! +"%H:%M")

View file

@ -2,6 +2,7 @@
#
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
# Copyright 2020 Pavel Korytov <thexcloud@gmail.com>
#
# Licensed under the terms of the GNU GPL v3, or any later version.
#
@ -30,45 +31,59 @@ close(ACPI);
# fail on unexpected output
if ($acpi !~ /: (\w+), (\d+)%/) {
die "$acpi\n";
die "$acpi\n";
}
$status = $1;
$percent = $2;
$full_text = "$percent%";
if ($status eq 'Discharging') {
$full_text .= ' DIS';
} elsif ($status eq 'Charging') {
$full_text .= ' CHR';
if ($percent < 20) {
$full_text = '';
} elsif ($percent < 40) {
$full_text = '';
} elsif ($percent < 60) {
$full_text = '';
} elsif ($percent < 85) {
$full_text = '';
} else {
$full_text = '';
}
} elsif ($status eq 'Charging' or $status eq 'Full' or $status eq 'Unknown') {
$full_text = '';
}
$full_text .= " $percent%";
$short_text = $full_text;
if ($acpi =~ /(\d\d:\d\d):/) {
$full_text .= " ($1)";
$full_text .= " $1";
}
# print text
print "$full_text\n";
print "$short_text\n";
# consider color and urgent flag only on discharge
if ($status eq 'Discharging') {
if ($percent < 20) {
print "#FF0000\n";
} elsif ($percent < 40) {
print "#FFAE00\n";
} elsif ($percent < 60) {
print "#FFF600\n";
} elsif ($percent < 85) {
print "#A8FF00\n";
}
if ($percent < 20) {
print "#FF0000\n";
} elsif ($percent < 40) {
print "#FFAE00\n";
} elsif ($percent < 60) {
print "#FFF600\n";
} elsif ($percent < 85) {
print "#A8FF00\n";
} else {
print "#2FFF00\n";
}
if ($percent < 5) {
exit(33);
}
if ($percent < 5) {
exit(33);
}
} elsif ($status eq 'Charging' or $status eq 'Full' or $status eq 'Unknown') {
print "#FFFE00\n"
}
exit(0);

View file

@ -5,6 +5,10 @@ hide_edge_borders both
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# Apply XFCE Settings
exec xfsettingsd
exec xiccd
# start a terminal
bindsym $mod+Return exec "i3-msg 'workspace 1 🚀; exec i3-sensible-terminal'"
@ -239,12 +243,12 @@ mode "apps" {
bindsym v exec vk-messenger; mode default
bindsym s exec slack; mode default;
bindsym m exec "i3-sensible-terminal -e ncmpcpp"; mode default
bindsym c exec "copyq toggle"; mode default
bindsym k exec "keepassxc"; mode default
bindsym e exec mailspring; mode default
}
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bindsym $mod+p exec "copyq menu"
bindsym $mod+Shift+x exec "i3lock -f -i /home/pavel/Pictures/lock-wallpaper.png"
# Colors
@ -289,6 +293,10 @@ bindsym XF86AudioPause exec mpc pause
bindsym XF86AudioNext exec mpc next
bindsym XF86AudioPrev exec mpc prev
# Screen brightness
bindsym XF86MonBrightnessUp exec xbacklight -inc 5
bindsym XF86MonBrightnessDown exec xbacklight -dec 5
exec --no-startup-id pulseeffects --gapplication-service
# Screenshots
@ -315,6 +323,6 @@ exec --no-startup-id mpd
# Stuff
exec aw-qt
exec xfsettingsd
exec xiccd
exec dunst
exec kde-connect-indicator
exec copyq

View file

@ -66,16 +66,19 @@ API_KEY=8948d12cd68a3b7ac60d405ed4118b43
interval=1200
[weather]
LOCATION="Saint-Petersburg"
LOCATION="Tyumen"
color=#FF9600
interval=3600
separator=false
[sun]
LAT=59.944045N
LON=30.281716E
LAT=57.1553N
LON=65.5619E
interval=600
[battery]
interval=60
[aw_afk]
interval=60

View file

@ -181,7 +181,7 @@ set splitbelow
set splitright
set inccommand=split
set switchbuf=vsplit
set redrawtime=250
set redrawtime=500
" Indent
set tabstop=4
@ -651,7 +651,7 @@ let g:ale_lint_on_enter = 0
let g:ale_lint_on_insert_leave = 0
let g:ale_completion_enabled = 0
let g:ale_linter_aliases = {'svelte': ['css', 'javascript']}
let g:ale_linters = {'python': ['pyls'], 'tex': ['chktex'], 'cpp': ['clang'], 'vue': ['eslint'], 'typescript': ['tsserver', 'tslint'], 'svelte': ['eslint']}
let g:ale_linters = {'python': ['prospector'], 'tex': ['chktex'], 'cpp': ['clang'], 'vue': ['eslint'], 'typescript': ['tsserver', 'tslint'], 'svelte': ['eslint']}
let g:ale_fixers = {
\ 'python': ['yapf', 'isort', 'remove_trailing_lines', 'trim_whitespace'],
\ 'tex': ['latexindent', 'textlint', 'remove_trailing_lines', 'trim_whitespace'],
@ -961,16 +961,19 @@ colorscheme palenight
highlight! TermCursorNC guibg=red
"highlight Conceal guibg=Normal guifg=Normal
hi Normal guibg=NONE ctermbg=NONE
highlight! link Conceal Normal
highlight! illuminatedWord cterm=underline gui=underline
" Airline
let g:airline_theme='palenight'
let g:airline_powerline_fonts = 1
" let g:airline_extensions = []
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_idx_mode = 1
let g:airline#extensions#tabline#formatter = 'unique_tail'
let g:airline_section_b = '%{Uptime()}'
let g:airline_highlighting_cache = 1
" vim-clap
"let g:clap_search_box_border_symbols = {'curve': ["f", "g"], 'nil': ['', ''] }