Disable borders from floating windows in i3wm [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I can disable borders from not floating windows by enabling hide_edge_borders both. But when I open up a floating windows like lxterminal, i got this borders to change window size.
What can i do to disable this borders, but not disabling title of a window?

hide_edge_borders hides only borders adjacent to the screen edges and only on the tiling layer. This is independent of the border settings of the affected windows.
You can set the initial border style for windows with the new_window and new_float settings:
new_window none
new_window normal|pixel [<px>]
new_float none
new_float normal|pixel [<px>]
The setting none means no border and no title bar. normal gives a title bar and borders which are two pixel wide by default. The border width can be changed with the optional <px> setting, a setting of 0 keeps the title bar but removes the borders. pixel (also with optional width) produces borders on all sides but without title bar.
new_window sets the style for windows that start on the tiling layer, which - with i3 - is almost every window. new_float sets the style for windows that start out as floating windows, which are mostly dialog windows. These settings do not affect the border style if the floating status is changed later. Later also includes settings like
for_window [class="SOMECLASS"] floating enable
as they are also done only after the window was already created.
This leaves you with a few possible solutions
If you do not need any borders the solution is quite simple. You can just set:
new_window normal 0
new_float normal 0
This removes any borders including between tiled windows. You may then also remove the hide_edge_borders setting, as it is then no longer needed.
If you want to keep the tiling layer as it is at the moment - edges between windows, but not on the screen edges - it gets trickier. As said above, the new_float setting only affects windows that are initially floating, but not those that are later - automatically or manually - set to be so. The simplest solution there probably would be to have separate commands for floating and un-floating a window (instead of just toggling) and extend any for_window settings to also remove/add borders as needed. For example:
# New tiling windows with title bar and borders
new_window normal 2
# New floating windows with title bar and without borders
new_float normal 0
# Hide borders on edges
hide_edge_borders both
# Set variables for floating and un-floating commands
set $FLOAT floating enable, border normal 0
set $UNFLOAT floating disable, border normal 2
# Key bindings
# Switch between tiling and floating layer (Super+Space)
bindcode Mod4+65 focus mode_toggle
# Put windows on floating layer and remove borders (Super+Shift+Space)
bindcode Mod4+Shift+65 $FLOAT
# Make windows on tiling layer and add borders (Super+Control+Space)
bindcode Mod4+Control+65 $UNFLOAT
# Auto-float some windows
for_window [class="SomeClass"] $FLOAT
for_window [title="ThisTitle"] $FLOAT
# Auto-un-float some other windows
for_window [class="SomeOtherClass" window_type="dialog"] $UNFLOAT
for_window [title="ThatTitle"] $UNFLOAT
Notes:
Setting variables for the float and un-float commands helps readability and maintainability. Setting variables for the border types does not make a lot of sense because variables are not evaluated recursively. So it is not possible to set a variable for a border style and reuse that in the setting of a variable for the float/un-float commands.
I used bindcode because I could not get the combination Super+Control+Space with bindsym on my system. Of course this is just an example and it may not be needed on your system anyway.
If you want to keep the current layout but also want to be able to just toggle the floating state of a window with a single shortcut, you will have to make use of i3's IPC interface. Utilizing the IPC you can check for the current status of the focused window. Then you can float/un-float the window and change the border style it.

Related

vim on iterm cannot open as full screen

I wonder about this bottom and left gap, and also wanna remove it
It occurs only when i open "vim", not Iterm itself
Is there any solution?
The general principle is that the screen of a terminal emulator is a grid where each cell has the same dimensions as the others and those dimensions are determined by the font and font size used. If the window's dimensions and the grid's dimension are incompatible, then the window can't be filled with the grid and you have that kind of gap.
In this case, the cell dimensions are 16px * 38px so the grid can only fit in a box whose dimensions are a multiple of 16 in width and a multiple of 38 in height.
Now, your screen's dimensions appear to be 1630px * 2862px, which is rather unusual. The width is not a multiple of 16 and the height is not a multiple of 38, so, with your current font settings it is impossible to fill the screen.
For that to be theoretically possible, you would need font settings that make individual cells 16.3px wide and 38.16px tall, or some other "impossible" ratio.
Note that you also have a padding, here, that effectively prevents the grid to ever fill the window anyway.
None of that is really a problem when the program you run in your terminal emulator doesn't paint the background of those cells but your Vim colorscheme does, which makes the effect described above apparent.
The only practical workarounds are:
Define the same background in Vim and in your terminal emulator.
Make Vim's background transparent.

Temporarily colour Linux Terminal foreground and background text

How can I temporarily set the colors of my Linux Terminal? I wish to add to a script, a color setting so that I remember to run the partner script a few minutes later. The color change would be set on in one script and removed in the other and would act as a visible reminder to me.
So the color change needs to be applied after the terminal is started up and needs to stay for all subsequent typing until it is removed by another equivalent command.
My terminal is GNOME Terminal 2.31.3
There's more than one way to change colors. VTE (the actual terminal within GNOME Terminal) implements these features (generally from xterm):
"ANSI color" escapes (which would be useless to you, since many programs reset those)
changing the text foreground and background using non-ANSI dynamic colors (resetters are rare)
changing the color palette (again, resetters are rare)
The latter two are documented in XTerm Control Sequences, in the section Operating System Commands:
OSC Ps ; Pt BEL
OSC Ps ; Pt ST
gives the form of the control sequence, e.g., escape]Ps;PtBEL
The dynamic colors are described here:
The 10 colors (below) which may be set or queried using 1 0
through 1 9 are denoted dynamic colors, since the correspond-
ing control sequences were the first means for setting xterm's
colors dynamically, i.e., after it was started. They are not
the same as the ANSI colors. These controls may be disabled
using the allowColorOps resource. At least one parameter is
expected for Pt. Each successive parameter changes the next
color in the list. The value of Ps tells the starting point
in the list. The colors are specified by name or RGB specifi-
cation as per XParseColor.
and other colors here:
Ps = 4 ; c; spec -> Change Color Number c to the color spec-
ified by spec. This can be a name or RGB specification as per
XParseColor. Any number of c/spec pairs may be given. The
color numbers correspond to the ANSI colors 0-7, their bright
versions 8-15, and if supported, the remainder of the 88-color
or 256-color table.

Remove terminal border colors from vim colorschemes

I want the color scheme to span completely across the terminal boundaries. I am using Color Scheme Scroller Plugin to switch between different theme. I have uploaded a .gif file so that you can clearly see what I want to get fixed. Vim colorschemes doesn't completely change the color of editor. There are some terminal color's borders left around the vim's overridden color scheme. How would I fix it.
Please check the image on this link. Stackoverflow doesn't allow uploading an image > 2Mb
You can't do that from Vim itself.
Terminal emulators use that padding to preserve readability when characters are displayed next to the borders of the window. The programs you run in your terminal have no knowledge of that padding and thus no ability to change it.
But you can read the documentation of your terminal emulator or take a look at its source code to find a way to enable/adjust/disable that padding.
FWIW, there's no way to change that in Terminal but it can be done for iTerm.
Alternatively, you could simply set the background color of your terminal to the one used in your vim colorscheme.
The image appears to depict behavior outside vim's control:
it is using a terminal emulator (could be xterm, could be some other).
the terminal emulator draws character cells on a window
those cells form a grid; the window may extend beyond the grid
the window can have a background color
the grid can have a background color
within the grid, most terminals provide some capability of drawing text with specific foreground and background colors
the grid can have a default background color which is not any of the specified colors
outside the grid, the window can also have a default background color
normally, the grid- and window-default backgrounds are the same
the window can be resized to (more or less) arbitrary sizes
the grid is constrained to exact character sizes
because of this difference, the window can have areas outside the grid which use its default color, and not match the grid's background color.
escape sequences which could affect the grid- and window-background colors are doing erases (see for example the ncurses FAQ My terminal shows some uncolored spaces).
though it is conceivable that erasures within the grid could affect those outside areas, doing that generally leads to odd visual effects.

Vim Color Scheme Problems on Ubuntu 11.04 [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
When I change my color scheme in command-line Vim on Ubuntu 11.04, stripes on the bottom and right of the terminal (xterm) refuse to change color. While I can select any color scheme that I like, the two bands of color will remain at the default set for my xterm profile. Here's a link to an image to illustrate what I describe; my best guess is that xterm is not playing well with fullscreen mode in Unity. Do you have any suggestions for things I should try in order to fix this?
Vim is applying its colors to individual character cells.
Your expanded xterm window's width and height are probably not divisible by the width and height of a single character cell.
With my own font settings, a cell is 7 px by 15 px.
My display is 1600px wide and 1200 px tall, a fullscreen xterm would cover the entire area but the available cells would only cover an area of 1594 px * 1200 px, leaving a tiny 4 px wide vertical band on the right and — luckily — fit the whole height.
I see one easy way to get rid of your "stripes": set the background color of xterm to the same color you use in your colorscheme or vice-versa.

Pyqt command line options

I cannot find any references to command line arguments for pyqt, such as:
-style windows
-background "yellow"
I've only found a couple by accident.
Hasn't helped to Google it or use Qt Assistant. (Unless it's well hidden)
Thanks,
Paul
From the PyQt4 manual entry for QApplication:
(http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qapplication.html)
All Qt programs automatically support
the following command line options:
-style= style, sets the application GUI style. Possible values are motif,
windows, and platinum. If you compiled
Qt with additional styles or have
additional styles as plugins these
will be available to the -style
command line option.
-style style, is the same as listed above.
-stylesheet= stylesheet, sets the application styleSheet. The value must
be a path to a file that contains the
Style Sheet. Note: Relative URLs in
the Style Sheet file are relative to
the Style Sheet file's path.
-stylesheet stylesheet, is the same as listed above.
-session= session, restores the application from an earlier session.
-session session, is the same as listed above.
-widgetcount, prints debug message at the end about number of widgets left
undestroyed and maximum number of
widgets existed at the same time
-reverse, sets the application's layout direction to Qt.RightToLeft
-graphicssystem, sets the backend to be used for on-screen widgets and
QPixmaps. Available options are raster
and opengl.
-qmljsdebugger=, activates the QML/JS debugger with a specified port. The
value must be of format
port:1234[,block], where block is
optional and will make the application
wait until a debugger connects to it.
The X11 version of Qt supports some
traditional X11 command line options:
-display display, sets the X display (default is $DISPLAY).
-geometry geometry, sets the client geometry of the first window that is
shown.
-fn or -font font, defines the application font. The font should be
specified using an X logical font
description. Note that this option is
ignored when Qt is built with
fontconfig support enabled.
-bg or -background color, sets the default background color and an
application palette (light and dark
shades are calculated).
-fg or -foreground color, sets the default foreground color.
-btn or -button color, sets the default button color.
-name name, sets the application name.
-title title, sets the application title.
-visual TrueColor, forces the application to use a TrueColor visual
on an 8-bit display.
-ncols count, limits the number of colors allocated in the color cube on
an 8-bit display, if the application
is using the QApplication.ManyColor
color specification. If count is 216
then a 6x6x6 color cube is used (i.e.
6 levels of red, 6 of green, and 6 of
blue); for other values, a cube
approximately proportional to a 2x3x1
cube is used.
-cmap, causes the application to install a private color map on an
8-bit display.
-im, sets the input method server (equivalent to setting the XMODIFIERS
environment variable)
-inputstyle, defines how the input is inserted into the given widget, e.g.,
onTheSpot makes the input appear
directly in the widget, while
overTheSpot makes the input appear in
a box floating over the widget and is
not inserted until the editing is
done.

Resources