air icon indicating copy to clipboard operation
air copied to clipboard

Screen refresh

Open Emru1 opened this issue 1 year ago • 3 comments

I've created simple program for screen refreshing and ghosts removal (basically swapping white and black, fullscreen). I've also modified rc.lua to use it via button. Entry in crontab could also be desirable. Program is available here: https://git.sr.ht/~emru/scref/ Compile with mkdir -p ~/.local/bin/; gcc -lX11 scref.h -o ~/.local/bin/scref. Needs libx11-dev package on Alpine/PostmarketOS. Here is rc.lua diff:

diff --git a/rc.lua b/rc.lua
index 3eaec05..60f9479 100644
--- a/rc.lua
+++ b/rc.lua
@@ -81,7 +81,7 @@ warmslider:connect_signal("property::value", function(maybe, new_value)
 end)
 
 wifitoggle = wibox.widget({
-  text = "Toggle",
+  text = "WiFi",
   align = "center",
   widget = wibox.widget.textbox,
 })
@@ -100,6 +100,17 @@ sleepbutton:connect_signal("button::press", function()
   awful.spawn(gears.filesystem.get_configuration_dir() .. "suspend.sh")
 end)
 
+refreshbutton = wibox.widget({
+  text = "Refresh",
+  align = "center",
+  widget = wibox.widget.textbox,
+})
+
+refreshbutton:connect_signal("button::press", function()
+  pop.visible = not pop.visible
+  awful.spawn("scref")
+end)
+
 powerbutton = wibox.widget({
   text = "Poweroff",
   align = "center",
@@ -130,7 +141,6 @@ pop = awful.popup({
         coldslider,
         { text = "Warm", widget = wibox.widget.textbox },
         warmslider,
-        { text = "WiFi", widget = wibox.widget.textbox },
         {
           wifitoggle,
 
@@ -156,6 +166,14 @@ pop = awful.popup({
           shape = gears.shape.rounded_bar,
           widget = wibox.widget.background,
         },
+        {
+          refreshbutton,
+
+          bg = "#ff00ff",
+          clip = true,
+          shape = gears.shape.rounded_bar,
+          widget = wibox.widget.background,
+        },
         forced_num_cols = 2,
         forced_num_rows = 4,
         homogeneous = true,

What do you think? Is it worth to add it to air?

Emru1 avatar Sep 29 '24 15:09 Emru1

Hey! This is cool and could be an interesting addition. I'm wondering, when are you using it? I don't recall seeing too many "ghosts", I felt like the screen was doing a pretty good job at refreshing itself 🤔

bjesus avatar Oct 12 '24 18:10 bjesus

Well, from time to time, when I move between programs, or when I think font in koreader starts to be a little blurry, then I launch refresh I'm also wondering, is it possible to manually call hardware refresh, instead of this trick with fulscreen X program, but I had no time recently to check it

Emru1 avatar Oct 12 '24 19:10 Emru1

I'm happy to add it, but I think we'll want it to have an alpine/pmos package first. I'm not so keen on asking users to compile stuff on their reader honestly. If it has a package I can easily just add it to the list of packages to be installed in the README, and update rc.lua to include a button for it.

bjesus avatar Oct 27 '24 16:10 bjesus