SOLVED - shortcut to hide left, top & bottom panels, + full screen

Hi,
I’m new user of DT and also new to this forum.
Many thanks to developers, maintainers and all other people who share their knowledge about DT!!! Great software, great comunity!

I have a question about shortcuts. Because I’m sometimes forced to edit on a notebook (16 inch display), I need very often to hide panels and make the DT full screen (like the title of my post says).
Can I achieve this with only one key combination (shortcut)? Maybe to start a lua script with one key combination?

On my notebook I use Windows.

Thanks in advance for your help! :slight_smile:

Tab will hide panels at least

yes, tab hides all panels. The right panel I need for editing. :wink: So this option is not good for me.

And F11 toggles full-screen mode.

https://darktable-org.github.io/dtdocs/en/slideshow/usage/

https://darktable-org.github.io/dtdocs/en/overview/user-interface/screen-layout/

Pressing h shows the shortcuts.

https://darktable-org.github.io/dtdocs/en/overview/user-interface/keyboard-shortcuts/

1 Like

thanks, I know, but all these options require more than 2 shortcuts…
I’m looking for a solution, with only 1 shortcut. :wink:
I want only 1 shortcut, to do all the things described in the title. :slight_smile:
Is it possible?

I don’t think so. You can assign a shortcut to only one action. So F11, Tab. Half a second.

Is it possible to execute all these actions in a script?
And start the script with one key shortcut?

That’s an idea!
@wpferguson , would that work?

Welcome to pixls!

I can’t speak to using lua scripts (i am ignorant of such things), but you might be able to do it with a macro program. I know some windows users utilize them to make office stuff “faster”. Internet search for macro programs should help you start the research

Ah! :slight_smile:

So, I found a lua example: panels_demo.lua
I could try to change this script for my needs.
But I still have a question: how can I start this script, using a key combination? :slight_smile:

thanks!

The idea is to toggle the state of left/bottom/top panels, and enter full screen when a specific key combination is pressed, like this:

local panels = {"DT_UI_PANEL_CENTER_TOP",     -- center top panel
                "DT_UI_PANEL_CENTER_BOTTOM",  -- center bottom panel 
                "DT_UI_PANEL_TOP",            -- complete top panel
                "DT_UI_PANEL_LEFT",           -- left panel  
                "DT_UI_PANEL_BOTTOM"}         -- complete bottom panel

local panel_status = {}

-- save panel visibility

for i = 1,#panels do
  panel_status[i] = dt.gui.panel_visible(panels[i])
end

dt.print(_("toggle panels"))
for i = 1, #panels do
  if panel_status[i] then
    dt.print(string.format(_("hiding %s"), panels[i]))
    dt.gui.panel_hide(panels[i])
  else
    dt.print(string.format(_("showing %s"), panels[i]))
	dt.gui.panel_show(panels[i])
  end
end

dt.gui.action("global/fullscreen", 1.000)

Yes. :smile:

There are Lua API calls to control panel visibility, darktable lua documentation - darktable.gui.panel_hide and darktable lua documentation - darktable.gui.panel_visible

2 Likes
dt.register_event(MODULE, "shortcut",
  function(event, shortcut)
    -- do something
  end, "tooltip for shortcut"
)

You add this to your script. You start the script using script_manager. You then go to preferences->shortcuts->Lua scripts and look for the shortcut you created and assign a keystroke sequence to it. After that any time you hit the sequence the script will be activated.

EDIT: You can add more than 1 shortcut to a script so you could have different setups assigned to different shortcuts. Shortcut names must be unique so change MODULE to MODULE .. "some name"

2 Likes

You can do double or triple key presses I think so you could hit tab to go full with no panels and then double press tab to make the right panel show…and then I think that is sticky while you edit image to image and subsequent single tab pushes will toggle between no panels and right panel only…so maybe this could be a simple option…

It works great, thanks! :slight_smile:
I put this code in luarc and it is run every time when DT starts.

-- show all just in case
dt.gui.panel_show_all()

dt.register_event(MODULE, "shortcut",
  function(event, shortcut)
	local panels = {"DT_UI_PANEL_CENTER_TOP",     -- center top panel
                "DT_UI_PANEL_CENTER_BOTTOM",  -- center bottom panel 
                "DT_UI_PANEL_TOP",            -- complete top panel
                "DT_UI_PANEL_LEFT",           -- left panel  
                "DT_UI_PANEL_BOTTOM"}         -- complete bottom panel
				
	for i = 1, #panels do
	  if dt.gui.panel_visible(panels[i]) then
		dt.gui.panel_hide(panels[i])
	  else
		dt.gui.panel_show(panels[i])
	  end
	end

	dt.gui.action("global/fullscreen", 1.000)
	
  end, "toggle panels"
)
3 Likes

Glad you got it working.

A heads up. Since you used the luarc file to contain your code, I’m guessing you don’t have the lua-scripts installed. If at some point you do decide to install the lua-scripts and you use scripts installer to do it, the the existing luarc file will get renamed to luarc.bak and it will be replaced with a luarc file that starts script_manager.

1 Like

Yes, you are right. I installed now lua scripts. Where is the best place to store my lua script in order to be executed every time when DT starts?

I note that you have found your 1 shortcut solution.
For the sake of good order, though, since nobody else have mentioned it:

Shift+Ctrl+r toggles the right pane

So you could have solved it in two shortcuts:

  1. Tab
  2. Shift+Ctrl+r
2 Likes