Comments (15)
This could be a variable that uzbl-tabbed pays attention to.
from uzbl.
Is there a way to prevent closing the window when closing the last tab?
I was very accustomed to that too, but that was due to "firefox bias" :)
Now I don't actually see any reason for a feature like that - what do you need an empty browser for? You'll most likely want to navigate to another site anyway, so why bother about what's currently open?
from uzbl.
I don't like to keep open any page if I don't need it. Reasons mainly: resource usage, privacy. I also have my own customized home page and I'd like to see that if my browser is "empty". I also don't like to relaunch the browser every time, so this is why I need a solution for this.
from uzbl.
The best place to implement this would be inside tabbed. UzblTabbed.tab_closed
has some very simple logic that calls quit()
when there is no more open pages. Configurable by some setting this should instead by calling new_tab()
from uzbl.
Today I wrote a little "workaround". Can be used as a temporary solution until uzbl gets a proper option/setting for this:
exit_keep_last_tab.sh
#!/bin/sh
count_tabs=$(pgrep uzbl | wc -l)
if [ "$count_tabs" -gt 1 ]; then
echo "exit" > "$UZBL_FIFO"
else
echo "set uri = file://@config_home/uzbl/newtab.html" > "$UZBL_FIFO"
fi
Then I set the key binding for this in the config:
# close tabs (keep the last tab open)
@cbind d = spawn @scripts_dir/exit_keep_last_tab.sh
from uzbl.
Just an FYI, that will fail for any number of reasons because the pgrep uzbl
(and the wc -l
is better replaced with the -c
flag to pgrep
) will false-positive for instances outside of the uzbl-tabbed
, other users running uzbl
, and probably others.
from uzbl.
Yeah, you are right, pgrep -c
is better. For the instance part: I use the uzbl-tabbed
once, I don't use other tabbed or single window instances, so it's okay for me at the moment.
But a proper config setting or something would be better of course. :)
from uzbl.
I figured, but before others go and run with this script, the caveats might be useful to know :) .
from uzbl.
Unfortunately my script is not working well with the git version of uzbl. It was okay with the quite old Arch Linux package, but today I installed the git version (tabbed-next) from the AUR and the tab closing is "hanging" for seconds with the script I wrote. I added a notification for the script to check the execution time, it was okay (instant), but for some reason the tab didn't get closed until a few seconds.
The interesting thing is if I hit any key after the close, then it closes instantly. I can hit the d
key twice and it closes instantly. It isn't a key binding conflict, I tried with different keys.
I tried with the FIFO and the socket too, I tried the git master branch too, the results are all the same.
from uzbl.
There's some buffering happening in the I/O system :/ . Thought that was finally fixed.
from uzbl.
Reasons mainly: resource usage, privacy.
Given you mention "resource usage", I realized that your process of opening an entirely new window may be (unneccesarily?) complicated.
Otherwise you could just close the window altogether.
I use Mod4+[SOMEKEY]
to fire up the browser, so I don't worry about accidently closing my instance and then having to navigate to some icon to click.
Also, I always made heavy use of tabs. After switching to dwm I realized that I was just solving a problem I wouldn't need to have in the first place.
Tabs leave you guessing about their contents until you switch (back) to them. A proper WM let's you preview contents of all windows and switch quickly.
Also, tabs cause additional headache:
When you rotate through them and any of the websites sets the focus to a form field, uzbl, by default, goes into insert mode. So you have to press Esc
to continue rotating.
Now I exclusively use uzbl-browser
. In my opinion, uzbl-tabbed
could be dropped altogether. Actually it should be dropped in order to free up the limited developer time available for more important parts of uzbl.
The browser surf, for example, implements the Xembed specification so it can be "tabbed" using an according tool like http://tools.suckless.org/tabbed
=> Unix philosophy
from uzbl.
Ah, and why not just start your browser with this command:
while 1 ; do uzbl-tabbed ; done
=> Whenever you close the last tab, you get a fresh uzbl.
from uzbl.
With some tiling WMs you can live without tabbed, but if someone uses for example Openbox, it won't be a nice user experience. Also, every modern browser have tabs, even w3m (which is a CLI/TUI browser) has this feature. And it's a preference. I prefer tabs.
When you rotate through them and any of the websites sets the focus to a form field, uzbl, by default, goes into insert mode. So you have to press Esc to continue rotating.
With the older version of uzbl this worked for me (mostly):
@on_event LOAD_FINISH event ESCAPE
@on_event FOCUS_GAINED event ESCAPE
Seems like it doesn't work anymore. But maybe it can be fixed somehow.
For the while loop
part: it works, but it's slower than redirecting the last page to a custom home page (local file) or a blank page, because it always restarts the whole browser. Maybe it's not a problem if you have a SSD, but with a HDD (especially when it's under load) it could be relatively slow.
I know this tab thing isn't the biggest problem, we can use a "workaround" like the script I wrote above. That I/O buffering issue which was mentioned before is more of a problem now (but it's another topic/issue I think).
from uzbl.
Just to clear a few things up.
uzbl-core also implements xembed and should in theory work with suckless tabbed or some similiar tool. In fact uzbl-tabbed works exactly the same way by launching a full uzbl for each tab and it turns out to not be a big deal performance wise.
autofocus is implemented in the config, you could simply drop that line if you don't want it
from uzbl.
from uzbl.
Related Issues (20)
- Javascript in binding not getting executed HOT 19
- uzbl-tabbed shows empty window HOT 3
- event manager doesn't "connect"(?) unless uzbl-browser is being verbose HOT 8
- event-manager NEVER connects, verbose option or not HOT 3
- pb with uzbl scripting (load_url_from_surfraw.sh) HOT 1
- global problem which my explain the symptoms (last issues posted by me) HOT 2
- No website displays after compiling in current environment HOT 15
- blank page, couldn't set ssl credentials, PROP_TIMELINE_PROFILING_ENABLED... ??? HOT 3
- Fonts imported from the web don't load HOT 1
- Example files are installed using cp and do not have the right permissions HOT 16
- Which commit should currently be considered "stable"? HOT 4
- CJK input (e.g. mozc, anthy) via X input methods (e.g. uim, fcitx, ibus) doesn't work in the status bar
- alerta.io is not displayed correctly HOT 6
- ReactJs doesn't work
- What is the official status of this project? HOT 5
- Directory "= " created in current directory HOT 2
- www.uzbl.org web site is down HOT 6
- Github isn't shown correctly
- Keyboards scrolling not working HOT 4
- Web feed not working at uzbl.org HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uzbl.