aboutsummaryrefslogtreecommitdiffstats
path: root/mail/dot-mbsyncrc.byteplant
diff options
context:
space:
mode:
Diffstat (limited to 'mail/dot-mbsyncrc.byteplant')
0 files changed, 0 insertions, 0 deletions
t */ .highlight .err { color: #FF5370 } /* Error */ .highlight .esc { color: #89DDFF } /* Escape */ .highlight .g { color: #EEFFFF } /* Generic */ .highlight .k { color: #BB80B3 } /* Keyword */ .highlight .l { color: #C3E88D } /* Literal */ .highlight .n { color: #EEFFFF } /* Name */ .highlight .o { color: #89DDFF } /* Operator */ .highlight .p { color: #89DDFF } /* Punctuation */ .highlight .ch { color: #546E7A; font-style: italic } /* Comment.Hashbang */ .highlight .cm { color: #546E7A; font-style: italic } /* Comment.Multiline */ .highlight .cp { color: #546E7A; font-style: italic } /* Comment.Preproc */ .highlight .cpf { color: #546E7A; font-style: italic } /* Comment.PreprocFile */ .highlight .c1 { color: #546E7A; font-style: italic } /* Comment.Single */ .highlight .cs { color: #546E7A; font-style: italic } /* Comment.Special */ .highlight .gd { color: #FF5370 } /* Generic.Deleted */ .highlight .ge { color: #89DDFF } /* Generic.Emph */ .highlight .ges { color: #FFCB6B } /* Generic.EmphStrong */ .highlight .gr { color: #FF5370 } /* Generic.Error */ .highlight .gh { color: #C3E88D } /* Generic.Heading */ .highlight .gi { color: #C3E88D } /* Generic.Inserted */ .highlight .go { color: #546E7A } /* Generic.Output */ .highlight .gp { color: #FFCB6B } /* Generic.Prompt */ .highlight .gs { color: #FF5370 } /* Generic.Strong */ .highlight .gu { color: #89DDFF } /* Generic.Subheading */ .highlight .gt { color: #FF5370 } /* Generic.Traceback */ .highlight .kc { color: #89DDFF } /* Keyword.Constant */ .highlight .kd { color: #BB80B3 } /* Keyword.Declaration */ .highlight .kn { color: #89DDFF; font-style: italic } /* Keyword.Namespace */ .highlight .kp { color: #89DDFF } /* Keyword.Pseudo */ .highlight .kr { color: #BB80B3 } /* Keyword.Reserved */ .highlight .kt { color: #BB80B3 } /* Keyword.Type */ .highlight .ld { color: #C3E88D } /* Literal.Date */ .highlight .m { color: #F78C6C } /* Literal.Number */ .highlight .s { color: #C3E88D } /* Literal.String */ .highlight .na { color: #BB80B3 } /* Name.Attribute */ .highlight .nb { color: #82AAFF } /* Name.Builtin */ .highlight .nc { color: #FFCB6B } /* Name.Class */ .highlight .no { color: #EEFFFF } /* Name.Constant */ .highlight .nd { color: #82AAFF } /* Name.Decorator */ .highlight .ni { color: #89DDFF } /* Name.Entity */ .highlight .ne { color: #FFCB6B } /* Name.Exception */ .highlight .nf { color: #82AAFF } /* Name.Function */ .highlight .nl { color: #82AAFF } /* Name.Label */ .highlight .nn { color: #FFCB6B } /* Name.Namespace */ .highlight .nx { color: #EEFFFF } /* Name.Other */ .highlight .py { color: #FFCB6B } /* Name.Property */ .highlight .nt { color: #FF5370 } /* Name.Tag */ .highlight .nv { color: #89DDFF } /* Name.Variable */ .highlight .ow { color: #89DDFF; font-style: italic } /* Operator.Word */ .highlight .pm { color: #89DDFF } /* Punctuation.Marker */ .highlight .w { color: #EEFFFF } /* Text.Whitespace */ .highlight .mb { color: #F78C6C } /* Literal.Number.Bin */ .highlight .mf { color: #F78C6C } /* Literal.Number.Float */ .highlight .mh { color: #F78C6C } /* Literal.Number.Hex */ .highlight .mi { color: #F78C6C } /* Literal.Number.Integer */ .highlight .mo { color: #F78C6C } /* Literal.Number.Oct */ .highlight .sa { color: #BB80B3 } /* Literal.String.Affix */ .highlight .sb { color: #C3E88D } /* Literal.String.Backtick */ .highlight .sc { color: #C3E88D } /* Literal.String.Char */ .highlight .dl { color: #EEFFFF } /* Literal.String.Delimiter */ .highlight .sd { color: #546E7A; font-style: italic } /* Literal.String.Doc */ .highlight .s2 { color: #C3E88D } /* Literal.String.Double */ .highlight .se { color: #EEFFFF } /* Literal.String.Escape */ .highlight .sh { color: #C3E88D } /* Literal.String.Heredoc */ .highlight .si { color: #89DDFF } /* Literal.String.Interpol */ .highlight .sx { color: #C3E88D } /* Literal.String.Other */ .highlight .sr { color: #89DDFF } /* Literal.String.Regex */ .highlight .s1 { color: #C3E88D } /* Literal.String.Single */ .highlight .ss { color: #89DDFF } /* Literal.String.Symbol */ .highlight .bp { color: #89DDFF } /* Name.Builtin.Pseudo */ .highlight .fm { color: #82AAFF } /* Name.Function.Magic */ .highlight .vc { color: #89DDFF } /* Name.Variable.Class */ .highlight .vg { color: #89DDFF } /* Name.Variable.Global */ .highlight .vi { color: #89DDFF } /* Name.Variable.Instance */ .highlight .vm { color: #82AAFF } /* Name.Variable.Magic */ .highlight .il { color: #F78C6C } /* Literal.Number.Integer.Long */
#!/usr/bin/guile \
-e main-rofi -s
!#

(add-to-load-path "/home/titan/dev/dotfiles/lib/guile/")

(use-modules (ice-9 rdelim)
             (ice-9 popen)
             (ice-9 ftw)
             (ice-9 format)
             (ice-9 and-let-star)
             (utils))

(define habits-dir (expand-file "~/org/habits/"))

(define (get-habit-files dir)
  (scandir dir (lambda (file) (string-suffix? ".dat" file))))

(define (prepare-options files)
  (string-join (map (lambda (name) (string-drop-right name 4)) files) "\n"))

(define (rofi-capture-option options)
  (let* ((cmd (format #f "echo -e ~s | rofi -dmenu" options))
         (port (open-input-pipe cmd))
         (option (read-line port)))
    (close-pipe port)
    (if (eof-object? option) #f option)))

(define (rofi-capture-habit-quantity habit)
  (let* ((cmd (format #f "echo 1 | rofi -dmenu -p 'Add to ~a'" habit))
         (port (open-input-pipe cmd))
         (quantity (read-line port)))
    (close-pipe port)
    (if (eof-object? quantity) #f quantity)))

(define (main-rofi args)
  (and-let* ((habit (rofi-capture-option (prepare-options (get-habit-files habits-dir))))
             (quantity (rofi-capture-habit-quantity habit))
             (file-out (open-file (string-append habits-dir habit ".dat") "a")))
    (format file-out "~d:~a\n" (current-time) quantity)
    (close-port file-out)))