Shift browser contents to the left while viewing in wide screen - firefox

I use a widescreen laptop. Many websites have their content centre aligned. On wider screens this means lot of empty space on left and right. As such this is not a botheration.
Many a times, I read some instructions on the web page and type them out on the command prompt. I prefer to overlay the command prompt window on top of the browser and if the browser contents are left aligned (or right aligned), then I need not Alt-tab across these windows.
I use Firefox on Ubuntu. I use the command line (konsole) heavily. I know compiz (and similar) tools provides transparent windows so that the content beneath is visible. But I don't want to install compiz or its equivalent because my graphics driver is not all that good.
Any addon or simple trick that would shift the page content to the left (or right) would be very helpful (read productive).

The path of least resistance is: Don't maximise the window - leave it as a floating window and move it over so it is side-by-side with your command prompt.
If you really want to be funky, override the stylesheet using a user defined stylesheet that has a fixed margin on either the left or right, so the space is never used by the web page.

Related

How to scroll completely to the top of large terminal text buffers w/o adding additional dependencies?

I have a couple shell scripts which output git diffs which can get very long. When this happens, the terminal is left scrolled to the bottom of that text.
Ideally I'd like to programmatically scroll to the very top of the text buffer in a way which is as platform independent as possible, without requiring additional software installation.
The following works to move cursor to top of the currently visible text, but not to the top of the entire text buffer:
printf '\e[H'
This does basically the same thing:
printf '\e[0;d'
But neither of these scroll completely to the top, they just move the cursor to the top of the visible text.
My platform dependent (macOS) workaround is here:
https://github.com/montehurd/gitshorts/blob/main/utility#L3
Any pointers for how to scroll to the very start of the text buffer?

InteliJ IDE 2021.2: How to adjust the header vertical space usage?

Is it possible to adjust the header rendering in InteliJ. Currently almost a centimeter of vertical is completely wasted to emptiness (Which is significant when working on the 15 inch mac laptop).
Going 'Full Screen' isn't acceptable option right now since then then it adds transition delay when going to another window like the terminal.
Try Distraction Free mode: https://www.jetbrains.com/help/idea/ide-viewing-modes.html
In Distraction-free mode, the editor occupies the entire main window with the source code centered. All other elements of the UI are hidden (tool windows, toolbars, and editor tabs)

Text width does not adjust for console width and code is not visible anymore in Spyder4

I just downloaded Spyder 4. The IDE's look and feel are nice.
However, there is one thing that I don't like about it. When adjusting the width of the right-side panel (variable explorer and the console), the code in my text editor on the left doesn't adjust accordingly.
This causes my code to not be visible anymore whenever the right side is pulled over it (my picture below makes it clearer what I mean).
Is there a setting in Python to change this?

Can I make emacs grep windows just use the other window to open files in?

I've got emacs in front of me.
I've run a find-grep, and it's got many hits, which are displayed in a window. The file names are displayed in green as hyperlinks.
I make that the only window, with C-x 1.
If I click on a file name, the window splits vertically, and the file with the found text is displayed in the other window.
If I click on further filenames, then the new file replaces the old file, which is what I want to happen.
So far, so good...
However if I resize the windows, then emacs will periodically (when I click) split one of the two windows again, rendering the display difficult to read. It will then cycle opening new files between the two new windows. Occasionally it will open more windows and make the situation worse. If I close any of these new windows they just get reopened again.
In fact sometimes this perverse behaviour happens even if I don't resize anything. It just seems to happen more often if I do.
I would like emacs to stop buggering around and just have one find-grep window and one 'display' window, and always replace the display window with the new file. I would also like to be able to set these windows to the sizes that seem most convenient.
Is there any way to achieve this?
Or can anyone point me to an essay on how the whole (replace the contents of this window/replace the contents of a different window/create another window by splitting) thing works, so I can go and hack it sane.
Short fix:
Try doing this
(setq split-height-threshold nil
split-width-threshold nil)
This will prevent Emacs from splitting windows automatically (horizontally or vertically). This might be undesirable in other situations, but this should do the job. Try it for a week or so and see if it disrupts your flow.
Also, I found that if the point was in one of the windows, and I clicked on a link, the file opened up in the next window (if any).
So, if you want to make the file open in the right window (when you have more than one window), you can ensure that the point is in the window before the window you want.
Longer answer:
OK. I was able to reproduce the problem. The thing is the window showing the files is pretty big (wide or tall) because you resized it and Emacs sees that the width or height is greater than the respective threshold and splits it likewise. So, we have to either make the threshold higher or disallow the behaviour completely.
And, just to answer the last few questions:
To get current window - (selected-window)
To get next window - (next-window)
To select a window - (select-window foo-window)
To get the buffer of the current window - (current-buffer)
To get the buffer of some window - (window-buffer foo-window)
To set a buffer for a window - (set-window-buffer foo-window bar-buffer)
I'm sure you can hack together decent window/buffer management functions using these functions.
You can use C-h f to get more details on each of these functions.
Also check out the Elisp manual - http://www.chemie.fu-berlin.de/chemnet/use/info/elisp/elisp_26.html

Adding informative statusbar to fullscreen terminal window

Briefly:
I would love to add a status bar that sticks to either the bottom or top of my terminal window that provides glancible information (e.g. battery life, signal strength, email count, $PROMT_COMMAND, etc.). Essentially, this will allow the terminal to be opened up to fullscreen and have all the information I could possibly want easily glancible while letting me continue all of my necessary terminal work as normal. I use a mac primarily, but would prefer a *nix compatible solution.
More detail (and what I already tried):
I am a big terminal user and only recently (within a day or two) started using tmux, so I understand that many of you may suggest that I try to use a multiplexer like screen or tmux. While tmux is starting to get very useful to me, it has it's limitations such as a limit to a single-row status bar, which is not ideal since I would want to keep the tab's bar clean without half of it being eaten up by information. Also, I would want to add $PROMPT_COMMAND which displays the current directory, and that could easily eat up most of the status bar depending on where I am in the system.
Also, I tried screen for a bit, which let's you have a hardstatus and a caption which is close to what I want, but it's development seems to have halted. Furthermore, the patch for vertical split panes messes up the graphics of a two-row status bar (very ugly).
Therefore, I think it would be preferable to have a background process running that updates a status bar on part of the screen above my multiplexer ... unless of course tmux has a multi-row status bar implementation that I haven't figured out yet.
I would love to hear about any of your possible solutions, or even your own personal setups if you think it works well for you. Thank you all for any possible help.
A couple of options:
You could run tmux inside tmux (with different configurations; you can use -f to specify a configuration file.)
You could use the tab title, though that's probably not wide enough to include everything you want. (Even if there's only one tab, you can show the tab bar in fullscreen mode). You need to tell tmux to pass the title through; see set set-titles and set set-titles-string.
I'd suggest you use both - put the current directory in the tab title and all the other status info in a separate line maintained by tmux, that way you can just skip the second part when you're not using a full-screen terminal.
I have battery info in mine,
You can get copies of the files you'll need at
https://github.com/richo/dotfiles/blob/master/tmux.conf
and
https://github.com/richo/dotfiles/blob/master/bin/battery
(Make sure that battery is executable and in your PATH)
It'll show you battery percentage in blue (charging), red (discharging) or not at all (fully charged)

Resources