Skip to content

aichingm/porthole

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Porthole

​ A minimalistic frameless text-driven window to the world 🌍 wide web!

icon

Installing

Archlinux

The repository contains a PKGBUILD (which is currently not published in the aur)

mkdir /tmp/porthole
cd /tmp/porthole
wget https://raw.githubusercontent.com/aichingm/porthole/master/PKGBUILD
makepkg
pacman -U porthole-git-*

Linux

Other Linux 🐧 distributions should use the command below:

git clone https://github.com/aichingm/porthole
cd porthole
sudo python3 setup.py install

Running

Running porthole from the shell:

porthole

To interact with porthole hit ctrl + shift + enter which opens a menu in form of a python shell. The text entered has to be valid python which will be executed.

Available Methods

  • go loads a web site, if no schema is specified the url will be perpended with https://

    go("netflix.com")

  • back moves back in time

    back()

  • forward move forward in history ⏩

    forward()

  • reload reloads the current page πŸ”ƒ

    reload()

  • dim sets the dimensions of the window

    dim(800, 400) dim(width, height)

  • pos sets the position of the window

    pos(0, 0) pos(left, top)

  • border() toggles the window border

    border()

    • border(True) adds the window border

      border(True)

    • border(False) removes the window border

      border(False)

  • onbottom() toggles the onbottomness of the window

    onbottom()

    • onbottom(True) puts the window below all other windows

      onbottom(True)

    • onbottom(False) sets the onbottomness of the window back to normal

      onbottom(False)

  • ontop() toggles the ontopness of the window

    ontop()

    • ontop(True) puts the window on top of all other windows

      ontop(True)

    • ontop(False) sets the ontopness of the window back to normal

      ontop(False)

  • taskbar() toggles the taskbar indicator

    taskbar()

    • taskbar(True) adds a taskbar indicator for the window

      taskbar(True)

    • taskbar(False) removes the taskbar indicator for the window

      taskbar(False)

  • fs() toggles the fullscreen mode of the window

    fs()

    • fs(True) shows the window in fullscreen mode

      fs(True)

    • fs(False) shows the window in normal mode

      fs(False)

  • exit quits porthole πŸ’€

    exit()

  • nop does nothing 😴

    nop()

  • settaccess sets the access key sequence to open dmenu

    setaccess("Ctrl+Shift+d")

Stacking Methods

You can execute multiple commands like this:

go("youtube.com").dim(880,480).pos(1000,100)

Run Methods On Startup

Execute methods right after the start of porthole:

porthole --init "go(\"youtube.com\").dim(880,480).pos(1000,100)"

--init can be passed multipe times

porthole --init "setaccess(\"Ctrl+Shift+d\")" --init "go(\"youtube.com\").dim(880,480).pos(1000,100)"

This is useful for bash aliases (~/.bashrc):

....
# This will set the access key for youtube and netflix too!
alias porthole='porthole --init "setacces(\"Ctrl+Shift+d\")"'

alias youtube='porthole --init "go(\"youtube.com\").dim(880,480).pos(1000,100)"'
alias netflix='porthole --init "go(\"netflix.com\").dim(440,240).pos(1150,200)"'
....

Messing With Porthole

Hack all the things πŸ’» :

nop() and print("fuck this I'm out") or sys.exit()

Adding Custom Methods

Copy the file https://raw.githubusercontent.com/aichingm/porthole/master/Porthole/res/phuserproxy.py to ~/.phuserproxy.py which should look something like this:

from PortholeProxy import PortholeInstance
from PortholeProxy import PortholeProxy

class MyPortholeProxy(PortholeProxy):
    
    def __init__(self, porthole):
      	super().__init__(porthole)
  
    #add more methods here for example a shortcut for youtube
    def yt():
      	self.go("youtube.com")
        return self

#force your proxy onto Porthole (important!)
PortholeInstance.instance.setProxy(MyPortholeProxy(PortholeInstance.instance))

About

​ A minimalistic frameless text-driven window to the world 🌍 wide web!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published