Author |
Message |
greengeek

Joined: 20 Jul 2010 Posts: 5834 Location: Republic of Novo Zelande
|
Posted: Wed 10 Oct 2018, 14:21 Post subject:
|
|
fredx181 wrote: | I cannot understand btw, what can be the problem when restarting X, but apparently for you there's some issue with that. | Yes, X restart is problematic for me - I will try to explain:
I try to keep my system small and "lean" - so I often use software by loading pets during a session - rather than having those pets permanently loaded into a savefile (I have no savefile).
Imagine the situation where I have a number of windows open (browser , word processor etc) and I decide the screen is too bright so I load Mikes pet to control gamma and brightness - if I am forced to restart X to get the pet working, then all of those windows will close and I will be back to a blank desktop and I will have to start my session all over again.
(Restart WM does not cause window loss)
|
Back to top
|
|
 |
fabrice_035

Joined: 28 Apr 2014 Posts: 768 Location: Bretagne / France
|
Posted: Wed 10 Oct 2018, 14:25 Post subject:
|
|
greengeek wrote: |
Code: | xrandr --output LVDS1 --set BACKLIGHT 5 |
Code: | xrandr --output LVDS1 --set BACKLIGHT 10 |
("BACKLIGHT" must be uppercase)
. |
Code: |
root# xrandr | grep " connected " | awk '{ print$1 }'
HDMI-0
LVDS
root# xrandr --output LVDS --set BACKLIGHT 5
X Error of failed request: BadName (named color or font does not exist)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 11 (RRQueryOutputProperty)
Serial number of failed request: 33
Current serial number in output stream: 33
root#
|
|
Back to top
|
|
 |
greengeek

Joined: 20 Jul 2010 Posts: 5834 Location: Republic of Novo Zelande
|
Posted: Wed 10 Oct 2018, 14:32 Post subject:
|
|
Mike Walsh wrote: | Does anybody know where the script dealing with the contents of the notification area resides? Be interesting to find out, actually.: |
Hi Mike,
I am no expert at this but hopefully I can show one method to position tray icons:
If you are using JWM as your WM, open the hidden file /root/.jwmrc-tray
Here is mine:
Code: | <JWM>
<Tray autohide="false" insert="right" x="0" y="-1" border="1" height="28" >
<!-- Additional TrayButton attribute: label -->
<TrayButton label="Menu" icon="logo-mini.png" border="true">root:3</TrayButton>
<TrayButton popup="Show Desktop" icon="mini-desktop.xpm" border="true">showdesktop</TrayButton>
<TrayButton popup="Terminal" icon="/usr/local/lib/X11/pixmaps/console24.png" border="true">exec:urxvt</TrayButton>
<TrayButton popup="Files" icon="/usr/local/lib/X11/pixmaps/folder24.png" border="true">exec:rox</TrayButton>
<TrayButton popup="Browser" icon="/usr/local/lib/X11/pixmaps/www24.png" border="true">exec:defaultbrowser</TrayButton>
<TrayButton popup="Leafpad" icon="/usr/local/lib/X11/mini-icons/leafpad.png" border="true">exec:leafpad</TrayButton>
<TrayButton popup="BacklightUP" icon="/usr/local/lib/X11/pixmaps/brightup24.png" border="true">exec:xbacklight +15</TrayButton>
<TrayButton popup="BacklightDWN" icon="/usr/local/lib/X11/pixmaps/brightdwn24.png" border="true">exec:xbacklight -10</TrayButton>
<TrayButton popup="XVkbd" icon="/usr/local/lib/X11/pixmaps/kbd24.png" border="true">exec:xvkbdstart</TrayButton>
<Pager/>
<!-- Additional TaskList attribute: maxwidth -->
<TaskList maxwidth="200"/>
<Dock/>
<!-- Additional Swallow attribute: height -->
<!-- <Swallow name="blinky">
blinkydelayed -bg "#DCDAD5"
</Swallow> -->
<!-- <Swallow name="xtmix-launcher">
xtmix -launch
</Swallow> -->
<!-- <Swallow name="asapm">
asapmshell -u 4
</Swallow> -->
<!-- <Swallow name="freememapplet" width="34">
freememappletshell
</Swallow> -->
<!-- <Swallow name="freememapplet" width="34">
freememappletshell
</Swallow> -->
<Swallow name="xload" width="32">
xload -nolabel -bg "#888888" -fg red -hl white
</Swallow>
<Clock format="%H:%M">minixcal</Clock>
</Tray>
</JWM> |
I can now add in the line that Mochi was using to position his unicode symbol as a tray icon eg:
Code: | <TrayButton label="◑">exec:/usr/bin/mm_brightness_slider</TrayButton> |
If I put that line in the "TrayButton" area (eg in the blank space that I left above the "XVKBD" tray button declaration) then that icon will appear on the left hand side of the menu tray, with the icons sitting to the right of the menu button.
If I put that line somewhere in the "swallow" declarations then it will appear in the tray area near the clock
To activate the change all I need to do is:
and the icon appears without losing all of my open windows (as would happen with a restart X)
(I am sure Mochi and others will correct my fundamental misunderstandings about this )
|
Back to top
|
|
 |
greengeek

Joined: 20 Jul 2010 Posts: 5834 Location: Republic of Novo Zelande
|
Posted: Wed 10 Oct 2018, 14:36 Post subject:
|
|
fabrice_035 wrote: | root# xrandr --output LVDS --set BACKLIGHT 5
X Error of failed request: BadName (named color or font does not exist)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 11 (RRQueryOutputProperty)
Serial number of failed request: 33
Current serial number in output stream: 33
root#
[/code] | Hi Fabrice, can you post the output of the following command please?
Code: | xrandr --verbose | grep Backlight |
(must use capital B for Backlight)
|
Back to top
|
|
 |
fredx181

Joined: 11 Dec 2013 Posts: 4481 Location: holland
|
Posted: Wed 10 Oct 2018, 15:17 Post subject:
|
|
@greengeek
Following MochiMoppel's brightness slider example for adding to ~/.jwmrc:
Code: | <TrayButton label="◑">exec:/usr/bin/mm_brightness_slider</TrayButton> |
Then:
For Mike's BrightSelect.sh script, add in ~/.jwmrc
Code: | <TrayButton label="◑">exec:/usr/local/bin/BrightSelect.sh</TrayButton> |
Then: "jwm -restart" should do.
But then maybe better remove /root/Startup/ScreenControl.sh
(to avoid displaying the yad icon (will be duplicate), in case you do restart X or reboot with save)
Quote: | xrandr --verbose | grep Backlight |
This gives no output for me.
Fred
_________________ Dog Linux website
Tinylinux blog by wiak
|
Back to top
|
|
 |
Mike Walsh

Joined: 28 Jun 2014 Posts: 6397 Location: King's Lynn, UK.
|
Posted: Wed 10 Oct 2018, 15:34 Post subject:
|
|
@ Ian:-
Give this one a try. It's identical to the one from last night, with the addition of a 'pinstall.sh' script that places the icon in the tray when you install it.
https://www.datafilehost.com/d/dc10b5c2
Not sure how you'd remove the icon afterwards, though.
....doesn't get rid of it for me (and I'm not too sure how a 'puninstall.sh' script works.)
See what ya think. I spoil you, buddy..!
Mike.
_________________ MY 'PUPPY' PACKAGES

|
Back to top
|
|
 |
greengeek

Joined: 20 Jul 2010 Posts: 5834 Location: Republic of Novo Zelande
|
Posted: Thu 11 Oct 2018, 13:36 Post subject:
|
|
Mike Walsh wrote: | Give this one a try....
Not sure how you'd remove the icon afterwards, though. | Not a problem for me - the icon mysteriously disappears after I shut down (that's why I like having no save file)
Quote: | See what ya think. I spoil you, buddy..!  | Indeed - many thanks for the updated pet. It's perfect for some of my needs. Working as described and yad definitely makes the interface look good
HOWEVER - i still feel that adjusting gamma is the wrong approach if backlight control is available. Of course it isn't always available, but on many monitors - even external ones it is available so I feel people should be aware of it.
Here are some threads that offer more information:
https://unix.stackexchange.com/questions/189675/is-there-a-way-to-adjusts-the-brightness-of-the-monitor/189690
https://github.com/jonls/redshift/issues/436
(this thread also mentions "Clight")
and here is the thread re ddccontrol: https://github.com/ddccontrol/ddccontrol
I think each user should inspect the output of xrandr (xrandr --verbose) to see if "BACKLIGHT" or "Backlight" or "backlight" are mentioned anywhere.
In theory, any device that has such a variable noted by xrandr should be able to have its backlight controlled, rather than dimming pixels or altering the colour balance of pixels.
Once you have the info from xrandr regarding the range of backlight values permissible within xrandr then you can script the required values into the correctly spelled "backlight" variable.
(i mention this not as a negative against your pets - but just in case future users are looking for other specific ways to control backlight)
|
Back to top
|
|
 |
greengeek

Joined: 20 Jul 2010 Posts: 5834 Location: Republic of Novo Zelande
|
Posted: Fri 12 Oct 2018, 04:30 Post subject:
|
|
To find out if you might be able to control backlight intensity rather than controlling pixel attributes try the following command:
Code: | xrandr --verbose | grep -e "ack" -e "ACK" |
If it returns numerical values then you do not necessarily need to use pixel control as a method of controlling brightness.
EDIT : Ooops! Corrected typo. The command will work now. Sorry!
|
Back to top
|
|
 |
gjuhasz

Joined: 29 Sep 2008 Posts: 422
|
Posted: Mon 12 Nov 2018, 19:40 Post subject:
Battery saving brightness control for Intel laptops |
|
Hi,
I found a battery saving brightness control method for my HP laptop (HP 250 G6 with Intel HD 520 graphics).
See details at
http://murga-linux.com/puppy/viewtopic.php?t=96964&start=241
Have fun!
Regards
gjuhasz
|
Back to top
|
|
 |
recobayu

Joined: 15 Sep 2010 Posts: 389 Location: indonesia
|
Posted: Tue 12 Feb 2019, 04:11 Post subject:
|
|
I go to here:
https://unix.stackexchange.com/a/429389 and works for me. Now, what is the keyboard shortcut for this? I have acer laptop that uses Fn+left arrow and Fn+right arrow to change brightness. But I don't know what is the shortcut key. I want to add it to /root/.jwm/jwmrc-personal.
Thank you.
|
Back to top
|
|
 |
Mike Walsh

Joined: 28 Jun 2014 Posts: 6397 Location: King's Lynn, UK.
|
Posted: Tue 12 Feb 2019, 08:25 Post subject:
|
|
@ recobayu:-
I think you would need to set up the keyboard shortcuts first, in /etc/xdg/templates/_root_.jwmrc. (See the 'Key bindings' section down near the bottom). Needs a re-start of 'X' for them to be recognised.
Then you should be able to add the shortcuts into /root/.jwm/jwmrc-personal. No guarantees, mind, but that's the way I would approach it.
Mike.
_________________ MY 'PUPPY' PACKAGES

|
Back to top
|
|
 |
recobayu

Joined: 15 Sep 2010 Posts: 389 Location: indonesia
|
Posted: Tue 12 Feb 2019, 21:38 Post subject:
|
|
Thank You Mike, It works!
First, I make a script "brightup" in /usr/bin and write this:
Code: | bright=`cat /sys/class/backlight/intel_backlight/brightness`;echo $(($bright+50))>/sys/class/backlight/intel_backlight/brightness |
And I make a script "brightdown" in /usr/bin and also write this:
Code: | bright=`cat /sys/class/backlight/intel_backlight/brightness`;echo $(($bright-50))>/sys/class/backlight/intel_backlight/brightness |
After that, I clik on menu:
Desktop >> Desktop Settings >> Shortcuts >> On the Keyboard shortcuts tab, I choose "Add new shortcut" >> On Combobox, I choose XF86MonBrightnessUp >> on Action, I write "exec: brightup" >> click Apply.
I also choose key XF86MonBrightnessDown --> action "exec:brightdown", click Apply.
I click Ok on the window JWM shortcus, I think it is automatically restartwm. So I do not need to restart x. And alhamdulillah It works!
I look at /root/.jwm/jwmrc-personal, and i see two line added below <!-- Key bindings -->
Code: | <Key key="XF86MonBrightnessUp">exec: brightup</Key>
<Key key="XF86MonBrightnessDown">exec: brightdown</Key> |
Thank You, Mike.
|
Back to top
|
|
 |
Mike Walsh

Joined: 28 Jun 2014 Posts: 6397 Location: King's Lynn, UK.
|
Posted: Wed 13 Feb 2019, 20:23 Post subject:
|
|
@ recobayu:-
Ah, that's good to hear. Glad it's working for you.
I meant to say that you need to run
...in the terminal, followed by a re-start of "X". That's only because it's the exact same routine which is automatically run by every .pet package when it first installs; /etc/xdg/templates/_root_.jwmrc is the 'master' script for the main Menu (and it also re-updates all your key-bindings, etc., and anything else which might have changed with the install of a new package).
Mike.
_________________ MY 'PUPPY' PACKAGES

|
Back to top
|
|
 |
|