diff --git a/.assets/bibtex/list.png b/.assets/bibtex/list.png new file mode 100644 index 0000000..8507eda Binary files /dev/null and b/.assets/bibtex/list.png differ diff --git a/.assets/bibtex/rofi.gif b/.assets/bibtex/rofi.gif new file mode 100644 index 0000000..ade60b3 Binary files /dev/null and b/.assets/bibtex/rofi.gif differ diff --git a/.assets/polybar/clock.png b/.assets/polybar/clock.png new file mode 100644 index 0000000..974ed2f Binary files /dev/null and b/.assets/polybar/clock.png differ diff --git a/.assets/polybar/clock_alt.png b/.assets/polybar/clock_alt.png new file mode 100644 index 0000000..2027089 Binary files /dev/null and b/.assets/polybar/clock_alt.png differ diff --git a/.assets/polybar/full.png b/.assets/polybar/full.png new file mode 100644 index 0000000..e45d85c Binary files /dev/null and b/.assets/polybar/full.png differ diff --git a/.assets/polybar/i3-highlight.png b/.assets/polybar/i3-highlight.png new file mode 100644 index 0000000..46402bd Binary files /dev/null and b/.assets/polybar/i3-highlight.png differ diff --git a/.assets/polybar/i3-mode.png b/.assets/polybar/i3-mode.png new file mode 100644 index 0000000..d4b2e45 Binary files /dev/null and b/.assets/polybar/i3-mode.png differ diff --git a/.assets/polybar/i3-normal.png b/.assets/polybar/i3-normal.png new file mode 100644 index 0000000..d6ead86 Binary files /dev/null and b/.assets/polybar/i3-normal.png differ diff --git a/.assets/polybar/minimal.png b/.assets/polybar/minimal.png new file mode 100644 index 0000000..b612555 Binary files /dev/null and b/.assets/polybar/minimal.png differ diff --git a/.assets/polybar/mpris.png b/.assets/polybar/mpris.png new file mode 100644 index 0000000..a3363f3 Binary files /dev/null and b/.assets/polybar/mpris.png differ diff --git a/.assets/polybar/network.png b/.assets/polybar/network.png new file mode 100644 index 0000000..e5928e1 Binary files /dev/null and b/.assets/polybar/network.png differ diff --git a/.assets/polybar/system.png b/.assets/polybar/system.png new file mode 100644 index 0000000..7be3734 Binary files /dev/null and b/.assets/polybar/system.png differ diff --git a/README.md b/README.md index afc39f1..b97d6ec 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Enjoy! * [`nvim`](https://neovim.io/) - Neovim configuration * [`pandoc`](https://pandoc.org) - Pandoc plaintext transformation options (mostly latex templates) * [`picom`](https://github.com/yshui/picom) - X11 compositor (maintained fork from compton) -* [`polybar`](https://github.com/polybar/polybar) - Easy to customize statusbar +* [`polybar`](polybar/README.md) - Easy to customize statusbar * [`qutebrowser`](https://github.com/qutebrowser/qutebrowser) - vim-key enabled web browser * [`rofi`](https://github.com/davatorium/rofi) - Application launcher, dmenu replacement * [`sxhkd`](https://github.com/baskerville/sxhkd) - X11 hotkey manager @@ -60,7 +60,7 @@ Enjoy! * `rofi` contains additional scripts and a simple theming framework for rofi and should probably be reorganized to put the correct files into the correct directories (per xdg) at some point. * `.local/bin` in `scripts` `stow` unit contains most executable user scripts. Most of these have been migrated to their corresponding modules (e.g. if a script exclusively targets git functionality, it will live there), some stand-alone scripts remain however. * `.local/share/pandoc` contains configuration for academic latex (pandoc, really) writing and is of interest if you want to use this functionality. -* `.xinitrc` is used for x initialization and program startup. +* `.xinitrc` is used for x initialization and program startup. At some point, some of the consistently running applications may be moved to runit as supervised services. * Generally, directories starting with a . are only meaningful for the *repository* not for the functionality of the machine that these dotfiles are deployed on. That means `.gitlab-ci.yml`, `.assets/`, `.stowrc` and similar files and directories will not show up in the final deployment in any home directory. Perhaps they should be called dotdot-files since they're the dotfiles for my dotfiles. 🙂 (Also, 'dotfiles'.) [^shreq]: I may remove this requirement in the future to make modules more self-contained. However, relying on some base utility scripts makes it easier to avoid duplicating such functionality for each individual script in other modules. diff --git a/bibtex/.local/bin/bib-due b/bibtex/.local/bin/bib-due new file mode 100755 index 0000000..032f513 --- /dev/null +++ b/bibtex/.local/bin/bib-due @@ -0,0 +1,147 @@ +#!/usr/bin/env sh +# shows due entries of bibtex file passed in +# HACK: brittle! will break on various bibfile abnormities (even just on due date w/o priority) +# FIXME: reimplementation with real library needed +# + +OPTIND=1 # Reset in case getopts has been used previously in the shell. +fields="due|priority|\bauthor\b|\btitle\b" +filterby="due" +file="${BIBFILE}" +until="" + +show_help() { + printf "%s\n" \ + "" \ + " bib-due Show due readings from bibtex file." \ + "" \ + " Usage: bib-due [-hv] -i input.bib -r 'due|priority|\bauthor|\btitle' -l 'due' -u '2020-05-12'" \ + "" \ + " Options:" \ + "" \ + " -i [bibtex-file] Input bibtex file to scrape and get items from." \ + "" \ + " -r [fields] Field values to read in file." \ + "" \ + " -l [filter] Field to use as filter entity." \ + " This field is required for the scraper to pick entries up." \ + "" \ + " help | -h | --help Print out this help." \ + "" \ + " Invoked without arguments, bib-due will scrape the file defined in BIBFILE environment variable, " \ + " filtering entries with the 'due' field, and getting the values for 'due', 'priority', 'author', " \ + " and 'title' fields. It will then print the entries to stdout." \ + "" \ + " Example output line:" \ + "" \ + ' 2020-06-25 (1): Sergei Gerasymchuk -- “Ze” time in Ukraine (Gerasymchuk2019) ' \ + "" +} + +filter_until() { + # filter for dates, with line numbers + filtered=$(echo "$entries" | grep -noE '[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}') + + # redirect entries to fifo pipe + mkfifo filteredentries + finish() { + rm filteredentries + } + trap finish EXIT + echo "$filtered" >filteredentries & + + # find first date past until filter + lastline="" + while IFS= read -r line; do + cond=$(printf '%s' "$line" | cut -d: -f2) + cond=$(date -d "$cond" +%s) + if [ "$cond" -gt "$until" ]; then + lastline=$(printf '%s' "$line" | cut -d: -f1) + break + fi + done /dev/null || echo $(basename ${i%_*})) $(readlink -f $i)"; done ; hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp1_input ; Base temperature for where to start the ramp (in degrees celsius) -base-temperature = 40 +base-temperature = 50 ; Threshold temperature to display warning label (in degrees celsius) warn-temperature = 70 units = true @@ -209,26 +211,44 @@ date-alt = %A, %d %B %Y (W %V) time-alt = %H:%M label = %date% %{T2} %{T-}%time% +; display information on currently playing track, allows simple track manipulation +[module/music] +type = custom/script +exec = $XDG_CONFIG_HOME/polybar/scripts/poly-mprisdisplay +exec-if = type $XDG_CONFIG_HOME/polybar/scripts/poly-mprisdisplay +tail = true +click-left = kill -USR1 %pid% +click-right = kill -USR2 %pid% +; TODO: add album art display (on click?) - retrieved by playerctl metadata mpris:artUrl + +; display information on remaining papers to read for the upcoming week +[module/papersdue] +type = custom/script +exec = $XDG_CONFIG_HOME/polybar/scripts/poly-papersdue +exec-if = type bib-due +tail = true +click-left = exist rofi-bib-due normal "opening due papers" && rofi-bib-due -p1 -u $(date --date='fri this week' +%Y-%m-%d) +; format-foreground = ${colors.primary} +format-prefix = " " +interval = 120 + +; display unified available packages for update on arch from repos/aur +; uses pacman-contrib/checkupdates if available to avoid partial arch upgrades [module/archupdates] type = custom/script exec = $XDG_CONFIG_HOME/polybar/scripts/poly-archupdates +exec-if = type $XDG_CONFIG_HOME/polybar/scripts/poly-archupdates interval = 600 format =