Coder Social home page Coder Social logo

Comments (1)

rosenpin avatar rosenpin commented on May 29, 2024 1

Currently it's impossible to do this.
A relatively easy way to do this will be to

  1. add support for a "skip" flag for the script, where the skip will represent the number of events to skip, for example ./i3-agenda -... --skip 1 will fetch the events[1] (the second closest event)
  2. make a utility script that will keep the skip number in a file. Something like
#!/bin/bash
file=/tmp/i3-agenda-skip.tmp
skip=$(cat $file)
skip+=1
echo $skip >> $file
  1. make polybar refresh the events on scroll
[module/agenda]
    ...
    type = custom/script
    exec = i3-agenda -c ~/.google_credentials.json -ttl 30 --skip $(cat /tmp/i3-agenda-skip.tmp) 
    enable-scroll = true
    scroll-up = onscroll.sh && i3-agenda -c ~/.google_credentials.json --update --skip $(cat /tmp/i3-agenda-skip.tmp) 
    interval = 1 # you can instead refresh the bar manually on scroll up instead of having a low interval. See here for more info https://github.com/polybar/polybar/issues/563

Bonus

  1. You can make a crontab to periodically reset the /tmp/i3-agenda-skip.tmp so the events will return to normal after scrolling, you could also add a right click option in polybar to reset the skip file, making the functionality: scroll to next event, right click to go back to current event

TODO:

  • add support for skip flag in i3-agenda

from i3-agenda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.