Terminator screen default position - layout

I want to force Terminator to open at the top-left of my screen. When I saved the layout I had the window positioned correctly. However, whenever I open Terminator upon computer restart, the window is positioned near the top and about 1.5 inches from the left.
I've been messing around with the config file, but cannot figure out the 'position' paramters. For example, under [[[child0]]] :
position = 36:32
and under [[[child1]]] :
position = 834
Can anyone explain how to customize these parameters?
System info:
Ubuntu 17.10, kernel 4.13.0-43
screen dimensions: 1920x1080 pixels, or 508x286 mm
Terminator v 1.91
terminator/config :
[global_config]
always_split_with_profile = True
suppress_multiple_term_dialog = True
title_transmit_bg_color = "#8ae234"
[keybindings]
[layouts]
[[default]]
[[[child0]]]
fullscreen = False
last_active_term = a69b1a79-eb9d-4c15-ac27-0502efc4c4f7
last_active_window = True
maximised = False
order = 0
parent = ""
position = 36:32
size = 808, 1014
title = bp#bpenner: ~
type = Window
[[[child1]]]
order = 0
parent = child0
position = 834
ratio = 0.826560951437
type = VPaned
[[[terminal2]]]
order = 0
parent = child1
profile = BP
type = Terminal
uuid = a69b1a79-eb9d-4c15-ac27-0502efc4c4f7
[[[terminal3]]]
order = 1
parent = child1
profile = BP
type = Terminal
uuid = 454d7873-3e55-49a4-af8c-6456f99d5e1e
[plugins]
[profiles]
[[default]]
cursor_color = "#aaaaaa"

There are a couple of things to try.
The following worked for me:
Open Terminator, then adjust its window's size and position as desired.
In the Terminator window, in the command-line area, right-click then choose Preferences.
In the Layouts tab, expand the Type / Name list, select Terminal1, then click Save.
Exit the Preferences dialog, then close and re-open Terminator.
Another approach that one can use to configure the display properties of many applications is to add the --geometry= parameter to the application's command line.
In a shell command line, type man x to display the man page for the X window system.
Scroll down to GEOMETRY SPECIFICATIONS.

I believe that your config file is missing the first [[[window0]]] entry, which comes before the [[[child]]] entries on my default settings.
Here are my config settings in which the first window starts with the upper left corner at position y=100 and x=100 pixels and it's size is 1000 X 700 pixels.
(notice the different format required to make these entries)
[global_config]
[keybindings]
[profiles]
[[default]]
audible_bell = True
cursor_color = "#aaaaaa"
[layouts]
[[default]]
[[[window0]]]
type = Window
parent = ""
size = 1000 , 700
position = 100:100
[[[child1]]]
type = Terminal
parent = window0
[plugins]
Hope it helps.

This worked for me to set terminator windows on the top left corner on 4k display (ubuntu 22.04):
Edit config file nano ~/.config/terminator/config
Under [[[window0]]] add size and position:
[[[window0]]]
type = Window
size = 1920, 1080
position = 0:0
parent = ""

Related

Drag & Drop (swap) 3 texture buttons in a Margin Container->VBox

Following along a great tutorial, code is replicated yet does not function as shown. No new texture appears to be created when I try to drag the texture button. Only difference is the tutorial uses a TextureRect, while I'm using a TextureButton.
extends TextureButton
func get_drag_data(position: Vector2):
var vControl = Control.new()
var vData = {}
var vTexture = TextureRect.new()
vTexture.expand = true
vTexture.texture = texture_disabled
vTexture.rect_size = Vector2(320, 400)
vControl.add_child(vTexture)
vTexture.rect_position = -0.5 * vTexture.rect_size
set_drag_preview(vTexture)
return vData
Code above is attached to Party_1. texture_disabled does have a texture set.
It would work if you had the code in get_drag_data looking like this:
func get_drag_data(_position: Vector2):
var vTexture = TextureRect.new()
vTexture.expand = true
vTexture.texture = texture_disabled
vTexture.rect_size = Vector2(320, 400)
set_drag_preview(vTexture)
return {}
However, that would place the TextureRect top-left corner at the cursor position.
You want to offset the position of the TextureRect so it is centered at the cursor position. To do that, you create another Control, add the TextureRect as a child to it… And pass the TextureRect anyway? No, that does not work, you need to pass the new Control:
func get_drag_data(_position: Vector2):
var vTexture = TextureRect.new()
vTexture.expand = true
vTexture.texture = texture_disabled
vTexture.rect_size = Vector2(320, 400)
var vControl = Control.new()
vControl.add_child(vTexture)
vTexture.rect_position = -0.5 * vTexture.rect_size
set_drag_preview(vControl)
return {}
Please notice I'm giving vControl to set_drag_preview, not vTexture.
You cannot give to set_drag_preview a Control that has a parent. In fact, if you tried you would get an error in the Output console saying:
_gui_set_drag_preview: Condition "p_control->get_parent() != nullptr" is true.
Or
_gui_set_drag_preview: Condition "p_control->is_inside_tree()" is true.

Resizing and positioning Excel windows correctly on a specific monitor

On opening Excel I want to programmatically create a new window of the workbook, similar to the View Menu -> New Window command in Excel.
Then I want to position and resize these windows to 60% and 40% of the screen resolution respectively and and they should be arranged side by side on a horizontal monitor in a dual monitor system.
The other monitor could either be vertical or horizontal.
All this works well when the horizonal monitor is the primary monitor but if its the secondary monitor.
The first window is not resized properly by width. and so there is an unused area left at the right end of the monitor as shown in the picture.
The resize code that I use is as under
Sub Resize()
Dim mainWindow As Window
Dim secondWindow As Window
'Recalculate new widths and positions
Dim mainWindowWidth As Double
Dim secondWindowWidth As Double
mainWindowWidth = 0.6 * screenWidthPoints
secondWindowWidth = 0.4 * screenWidthPoints
'Assign window variables
If Not IsNull(ActiveWorkbook.Windows(1)) Then
Set mainWindow = ActiveWorkbook.Windows(1)
'switch to normal state before setting width, else will throw error if the window state is maximized and then try to set width
mainWindow.WindowState = xlNormal
mainWindow.Left = horzMonPoints.Left
mainWindow.Top = horzMonPoints.Top
mainWindow.Width = mainWindowWidth
End If
If Not IsNull(ActiveWorkbook.Windows(2)) Then
Set secondWindow = ActiveWorkbook.Windows(2)
secondWindow.Top = mainWindow.Top
secondWindow.Width = secondWindowWidth
secondWindow.Left = mainWindow.Left + mainWindow.Width
secondWindow.Height = mainWindow.Height
End If End Sub
The code to calculate number of monitors and monitor widths and heights, I used windows API calls in VBA.
From this link.

Debugging this jade+coffeescript code on Express4 server

I am looking for some help as I don't know how bad those lines of codes are.
I am trying to adapt this original Codepen.io work (http://codepen.io/ettrics/pen/Jdjdzp/ , by Ettrics) for one of my teaching project. I run my web page on a Express4+Stylus+Coffescript Node's server.
The CoffeeScript file:
# Each popup takes the entire window, so it is a modal
Modal = ->
# Make it easier for yourself by not having to type as much to select an element (QuerySelectorAll)
$qsa = (el) ->
document.querySelectorAll(el)
trigger = $qsa('.modal__trigger') # What you click to activate the modal
modals = $qsa('.modal') # The entire modal (takes up entire window)
modalsbg = $qsa('.modal__bg') # The entire modal (takes up entire window)
content = $qsa('.modal__content') # The inner content of the modal
closers = $qsa('.modal__close') # An element used to close the modal
isOpen = false
contentDelay = 100 # Duration after you click the button and wait for the content to show
len = trigger.length
getId = (event) ->
event.preventDefault()
# Get the value of the data-modal attribute from the button
modalId = this.dataset.modal
# Remove the '#' from the string
len = modalId.length
modalId = modalId.substring(1, len)
# Select the modal we want to activate
modal = document.getElementById(modalId)
# Execute function that creates the temporary expanding div named fakeDiv
makefakeDiv(this, modal)
makefakeDiv = (self, modal) ->
fakeDiv = document.getElementById('modal__temp');
# If there isn't a 'fakeDiv', create one and append it to the button that was
# clicked. after that execute the function 'moveTrigger' which handles the animations.
if fakeDiv?
fakeDiv = document.createElement('div')
fakeDiv.id = 'modal__temp'
self.appendChild(fakeDiv)
moveTrigger(self, modal, fakeDiv)
moveTrigger = (trigger, modal, div) ->
triggerProps = trigger.getBoundingClientRect()
modalProps = modal.querySelector('.modal__content').getBoundingClientRect()
xc = window.innerWidth / 2
yc = window.innerHeight / 2
######## VOIR LE CSS !!
# This class increases z-index value so the button goes overtop the other buttons
trigger.classList.add('modal__trigger--active')
# These values are used for scale the fakeDiv div to the same size as the modal
scaleX = modalProps.width / triggerProps.width
scaleY = modalProps.height / triggerProps.height
scaleX = scaleX.toFixed(3) # Round to 3 decimal places
scaleY = scaleY.toFixed(3)
# These values are used to move the button to the center of the window (to pepare the ease out effect)
transX = Math.round(xc - triggerProps.left - triggerProps.width / 2)
transY = Math.round(yc - triggerProps.top - triggerProps.height / 2)
# If the modal is aligned to the top then move the button to the center-y of the modal instead of the window
if modal.classList.contains('modal--align-top')
transY = Math.round(modalProps.height / 2 + modalProps.top - triggerProps.top - triggerProps.height / 2)
# Translate button to center of screen
trigger.style.transform = 'translate(' + transX + 'px, ' + transY + 'px)'
trigger.style.webkitTransform = 'translate(' + transX + 'px, ' + transY + 'px)'
# Expand fakeDiv to the same size as the modal
div.style.transform = 'scale(' + scaleX + ',' + scaleY + ')';
div.style.webkitTransform = 'scale(' + scaleX + ',' + scaleY + ')'
# Smart animation API used to open
window.setTimeout( ->
window.requestAnimationFrame(open(modal, div))
, contentDelay)
open = (modal, div) ->
if !isOpen
# Select the content inside the modal
content = modal.querySelector('.modal__content')
# Reveal the modal
modal.classList.add('modal--active')
# Reveal the modal content
content.classList.add('modal__content--active')
###
# When the modal content is finished transitioning, fadeout expanding
# fakeDiv so when the window resizes it isn't visible ( it doesn't
# move with the window).
###
content.addEventListener('transitionend', hidefakeDiv, false)
isOpen = true
hidefakeDiv = ->
# Fadeout fakeDiv so that it can't be seen when the window is resized
div.style.opacity = '0'
content.removeEventListener('transitionend', hidefakeDiv, false)
close = (event) ->
event.preventDefault()
event.stopImmediatePropagation()
target = event.target
div = document.getElementById('modal__temp')
###
# Make sure the modal__bg or modal__close was clicked, we don't
# want to be able to click inside the modal and have it close.
###
if isOpen and target.classList.contains('modal__bg') or target.classList.contains('modal__close')
# Make the hidden div visible again and remove the transforms so it scales back to its original size
div.style.opacity = '1'
div.removeAttribute('style')
###
# Iterate through the modals, modal contents and triggers to remove their active classes.
# Remove the inline css from the trigger to move it back into its original position.
###
for i in [0..len]
modals[i].classList.remove('modal--active')
content[i].classList.remove('modal__content--active')
trigger[i].style.transform = 'none'
trigger[i].style.webkitTransform = 'none'
trigger[i].classList.remove('modal__trigger--active')
# When fakeDiv opacity is 1 again, we want to remove it from the dom
div.addEventListener('transitionend', removeDiv, false)
isOpen = false
removeDiv = ->
setTimeout( ->
window.requestAnimationFrame(div.remove())
, contentDelay - 50)
bindActions = ->
for i in [0..len]
trigger[i].addEventListener('click', getId, false)
closers[i].addEventListener('click', close, false)
modalsbg[i].addEventListener('click', close, false)
init = ->
bindActions()
{init: init}
window.onload = Modal.init
This coffeescript file is called in jade by
script(src='javascripts/coffee-script.js')
script(src='javascripts/modal.coffee', type='text/coffeescript')
I could not use the CoffeeScript compiler logs because the of the 'window.onload = Modal.init' which returned a "window is not defined" error. But browser console returns no error, Codepen neither.
I have to confess that I began to learn these 4 languages 3 days ago. So I basically don't know anything about anything... I don't even know if my app settings are right.
Can anyone give me a hand on this?
Thanks a lot! :)

Terminator load custom configuration

i am using terminator 0.96.
When I start programming I have to open my terminator do a few splits and start programms in every split. Is it possible to do this with a script?
For example splitting terminal in 4 windows and use a command in every window.
Is something like this possible?
You can save layouts, though some of the preferences won't save in Terminator, at least not for me.
What I did was altering the default layout in preferences (right-click > preferences) to make it save the layout of the different terminals.
Then to save custom commands, I edited the configuration file directly:
~/.config/terminator/config
Here you'll have to enter a 'command' line that ends with ; bash, like so:
[[[terminal2]]]
command = cd ~/Documents/myPath; bash
...
Follow this Tutorial to set and save your layout:
http://www.linuxnov.com/the-complete-guide-to-configure-terminator-terminal-emulator-layouts/
Next right-click on any split window and choose Preferences, and in the Preferences dialog, Global Tab > Behavior section, check the checkbox called "Window geometry hints".
Edit the ~/.config/terminator/config file. "YOUR-SAVED-LAYOUT" in the config example below refers to the name you gave to you layout after following the steps on the tutorial above. Config file looks like this before you edit:
[global_config]
geometry_hinting = True
title_use_system_font = False
[keybindings]
[layouts]
[[default]]
[[[child1]]]
parent = window0
type = Terminal
[[[window0]]]
parent = ""
type = Window
[[YOUR-SAVED-LAYOUT]]
[[[child0]]]
fullscreen = False
...
...
Delete the "default" node above so only your layout is left. Example below:
[global_config]
geometry_hinting = True
title_use_system_font = False
[keybindings]
[layouts]
[[YOUR-SAVED-LAYOUT]]
[[[child0]]]
fullscreen = False
...
...
Rename "YOUR-SAVED-LAYOUT" to "default" as follows:
[global_config]
geometry_hinting = True
title_use_system_font = False
[keybindings]
[layouts]
[[default]]
[[[child0]]]
fullscreen = False
...
...
Save the config file and exit.
Close and open Terminator. Your layout should now be default layout and applied everytime you launch Terminator.
NB: There is a bug. i use version 1.90 on debian 9 and it won't launch with the panes in their right position. Close and launch again.

Trying to get the start and end point of each line within a text pane

Trying to get the start and end point of each line within a text pane:
The text pane contains (note target is the end of each line not including the blank space line):
(blank space line)
MVESMKKVAGMDVELTVEERN000TAQEGDHGSHVYTKQKEENKGGEDKLKMIREYRQMVETELKLICCDILDVLDKHDDDDDKVFYYKMKGDYHRYLAEFATGNDRKEAAENSLVAYKAASDIAMTELPPTHPIRLGLALNFSVFYYEILNSPDRACRLAKAAFDDAIAELDTLSEESYKDS00000VQVGQQRSDMQGDGKKKAAAEEQNKEALQDVEDENQtarget
MVESMKKVAGMDVELTVEERN000TAQEGDHGSHVYTKQKEENKGGEDKLKMIREYRQMVETELKLICCDILDVLDKHDDDDDDVFYYKMKGDYHRYLAEFATGNDRKEAAENSLVAYKAASDIAMTELPPTHPIRLGLALNFSVFYYEILNSPDRACRLAKAAFDDAIAELDTLSEESYKDS00000VQVGQQRSDMQGDGKKKAAAEEQNKEALQDVEDENQtarget
MVESMKKVAGMDVELTVEERN000TAQEGDHGSHVYTKQKEENKGGEDKLKMIREYRQMVETELKLICCDILDVLDKHDDDDDDDFYYKMKGDYHRYLAEFATGNDRKEAAENSLVAYKAASDIAMTELPPTHPIRLGLALNFSVFYYEILNSPDRACRLAKAAFDDAIAELDTLSEESYKDS00000VQVGQQRSDMQGDGKKKDDDDDDDEEQNKEALQDVEDENQtarget
//This is what I have
Element root = jTextPane1.getDocument().getDefaultRootElement();
Element one = root.getElement(0);
while (one !=null){
int one1 = one.getStartOffset();
int two1 = one.getEndOffset();
System.out.println(one1);
System.out.println(two1);
one = root.getElement(two1);
}
This is what I get (1st and 2nd element) and then hangs:
0
1
1
232
You mix model and view. Document is just model but amount of rows depends on view (width of content).
Use javax.swing.text.Utilities.getRowStart()/getRowEnd()
See an example of the code usage http://java-sl.com/tip_row_column.html

Resources