GithubHelp home page GithubHelp logo

idea_seat's Introduction

IDEA 久坐提醒插件

前言

对于程序员来说,经常会遇到项目周期短的状况。白天开会讨论需求,晚上加班写代码,熬夜发版本,上线改 Bug。工作日就是:开会、写代码、倒水、上厕所、抽烟、改 Bug,一天最开心的时刻就是带薪拉屎。

好不容易到了周末,有时还会通宵玩游戏,半个月也不运动一次。再好的身体,也会被这种高强度的工作,无规律的生活所击垮。随着年龄越来越大,加上每天久坐不起来运动运动,这样下去身体真的顶不住,久坐有挺多危害的:

1、久坐可能会导致心脑血管疾病增加

2、久坐可能会导致免疫力低下

3、久坐可能会导致损脑伤胃

4、久坐可能会得痔*

为了男朋友身体健康,我开发了一款插件,这插件可以 40 分钟提醒一次该起来起来运动啦,并且展示一些**的动图。12 个经典小动作让你肩不痛,腰不酸,腿不麻!

img

安装

下面是插件的安装教程:

也可以查看B站的安装教学视频:https://www.bilibili.com/video/BV1Vy4y1H7mC/

1. 下载 Jar 包

地址:https://github.com/s-unscrupulous/idea_seat

2. 安装插件

打开 IDEA 设置 -> Plugins -> 右上角齿轮 -> Install Plugin from Disk

img

3. 开启插件

工具栏 Tools 点击,找到 Assistant setting,就能设置提醒时间了。

img

过了半小时,弹出来一个胖胖的「打工人」动图,提醒你该休息了。

img

动图下方配上了一句话:原地踏步的时候,手掌向上朝天花板的方向推出去,手掌收回来的时候大拇指差不多要碰到你的肩膀,通过同时托举水瓶可以加大难度。

这插件不仅仅能提醒你该休息了,而且还提示你需要做哪些动作来缓解疲劳。

img

这个插件装备了 12 种缓解疲劳的动作,自己去解锁吧。。。

我在代码中加入了鼠标监听的功能,如果鼠标十分钟没有移动过,那就认为我在休息了。这时候会把定时任务取消,只有下一次移动鼠标时才会重新启动定时任务。大家对这个插件感兴趣的可以装一装,喜欢给个 Star!

TODO

  • 支持 JetBrains 所有产品
  • 丰富运动素材

交流群

这只是第一个版本,后面还会不断更新。有需求的朋友可以加入交流群讨论啊!

扫描下方二维码关注微信公众号「逛逛GitHub」,回复「插件交流群」即可进群啦。

img

idea_seat's People

Contributors

s-unscrupulous avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

idea_seat's Issues

一点建议

建议添加是否检查鼠标移动的按键
我大部分时间都是通过VIM编代码,同时很多都是用快捷键方式。所以容易触发取消时间倒计时。希望能够增添这个关闭鼠标移动检测选项。

PHPStorm安装后,报错了

image

image

安装完成重启后,发现 tools 菜单下没有设置项,然后看了下已安装插件列表,发现报错了。如上图所示

PhpStorm 2021.1.4
Build #PS-211.7628.25, built on June 30, 2021
Licensed to PhpStorm Evaluator
Expiration date: May 17, 2024
Runtime version: 11.0.11+9-b1341.60 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 16
Registry: run.processes.with.pty=TRUE
Non-Bundled Plugins: com.github.holgerbrandl.pasteimages/ (1.2.10), com.github.wenzewoo.jetbrains.plugin.jetbrains-markdown-image-support (1.4.1-SNAPSHOT), com.shuzijun.markdown-editor (1.12), io.zhile.research.ide-eval-resetter (2.3.5), zielu.gittoolbox (211.9.9), dev.ekvedaras.laravelquery (2.1.1), com.laravel_idea.plugin (6.2.2.211)

好评+一些建议

感谢您制作的插件,非常新颖且实用!

希望后续增加以下功能:

  • 休息状态下增加倒计时功能
  • 提供计时器的更多选项
  • 支持休息提醒的图片和提示问题的自定义

判断鼠标未移动代码是否有问题

image

ScheduledExecutorService service = Executors
                .newSingleThreadScheduledExecutor();
        AtomicInteger count = new AtomicInteger();
        service.scheduleAtFixedRate(() -> {
            if (QueryListener.flag) {
                QueryListener.flag = false;
                count.set(0);
            } else {
                count.getAndIncrement();
                if (count.get() > 5) {
                    ScheduledService.getInstance().removeTask();
                }
            }
        }, 5, 60, TimeUnit.SECONDS);

这里当count>5时,取消定时任务,意思是五分钟没移动鼠标,在第六分钟取消定时任务的意思吗?

@Override
    public void mouseMoved(@NotNull EditorMouseEvent e) {
        long now = System.currentTimeMillis();
        flag = true;
        if (SettingAction.isStart && now - beforeMouse > Constant.Infor.STOP_TIME && !ScheduledService.getInstance().isTaskRunning()) {
            ScheduledService.getInstance().addTask(0, true);
        }
        beforeMouse = now;
    }

这里的判断是两次时间间隔超过10分钟,则重新开始定时任务。
那如果用户六分钟未移动鼠标,使定时任务停止。在第七分钟移动了一下鼠标,之后每次移动鼠标间隔都不会超过10分钟,定时任务是否永远不会启动了?
另外,为啥我的提示只有文字,没有动图

女朋友

我们缺的是插件嘛 我们缺个这样的女票啊 哈哈哈

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.