u
This commit is contained in:
parent
d4e319226e
commit
740fc84d55
3
.bashrc
3
.bashrc
@ -9,7 +9,7 @@ export PATH="$JAVA_HOME/bin:$PATH"
|
|||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
[[ $- != *i* ]] && return
|
[[ $- != *i* ]] && return
|
||||||
|
|
||||||
alias ls='ls --color=auto'
|
alias ls='ls --color=auto -h'
|
||||||
alias nohup='nohup > "${TMPDIR:-/tmp}/nohup.$USER.$$.out" 2>&1'
|
alias nohup='nohup > "${TMPDIR:-/tmp}/nohup.$USER.$$.out" 2>&1'
|
||||||
alias cclear="printf '\e[3J\e[H\e[2J'" # Doesn't work in st? Should clear the terminal completely
|
alias cclear="printf '\e[3J\e[H\e[2J'" # Doesn't work in st? Should clear the terminal completely
|
||||||
alias v="nvim"
|
alias v="nvim"
|
||||||
@ -18,6 +18,7 @@ alias rms="shred -uzn8"
|
|||||||
alias ccp="xclip -selection clipboard" # stands for clipboard copy
|
alias ccp="xclip -selection clipboard" # stands for clipboard copy
|
||||||
alias du.="du -hs ./* | sort -rh"
|
alias du.="du -hs ./* | sort -rh"
|
||||||
alias cdtmp="cd \$(mktemp -d)"
|
alias cdtmp="cd \$(mktemp -d)"
|
||||||
|
# impala - iwd tui
|
||||||
|
|
||||||
# Fedora only
|
# Fedora only
|
||||||
if command -v dnf &> /dev/null; then
|
if command -v dnf &> /dev/null; then
|
||||||
|
|||||||
5
.xinitrc
5
.xinitrc
@ -11,7 +11,8 @@ export XDG_SESSION_TYPE=x11
|
|||||||
# QT apps use xdg portal settings
|
# QT apps use xdg portal settings
|
||||||
export QT_USE_PORTAL=1
|
export QT_USE_PORTAL=1
|
||||||
|
|
||||||
# xss-lock -- cinnamon-screensaver-command --lock &
|
# xss-lock -- slock &
|
||||||
redshift -l 40.7:-74.0 -t 6800:3600 &
|
redshift -l 40.7:-74.0 -t 6400:2500 &
|
||||||
|
xscreensaver --no-splash &
|
||||||
|
|
||||||
exec dbus-run-session -- /usr/local/bin/dwm
|
exec dbus-run-session -- /usr/local/bin/dwm
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
[FileDialog]
|
[FileDialog]
|
||||||
history=file:///home/c2ny, file:///home/c2ny/Documents, file:///home/c2ny/Downloads
|
history=file:///home/c2ny, file:///home/c2ny/Documents, file:///home/c2ny/Downloads, file:///home/c2ny/Videos
|
||||||
lastVisited=file:///home/c2ny/Downloads
|
lastVisited=file:///home/c2ny/Videos
|
||||||
qtVersion=6.10.0
|
qtVersion=6.10.0
|
||||||
shortcuts=file:, file:///home/c2ny
|
shortcuts=file:, file:///home/c2ny
|
||||||
sidebarWidth=98
|
sidebarWidth=111
|
||||||
treeViewHeader=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1\xec\0\0\0\x4\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x4\0\0\0\xff\0\0\0\x1\0\0\0\0\0\0\0?\0\0\0\x1\0\0\0\0\0\0\0@\0\0\0\x1\0\0\0\0\0\0\0n\0\0\0\x1\0\0\0\0\0\0\x3\xe8\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1)
|
treeViewHeader=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1\xec\0\0\0\x4\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x4\0\0\0\xff\0\0\0\x1\0\0\0\0\0\0\0?\0\0\0\x1\0\0\0\0\0\0\0@\0\0\0\x1\0\0\0\0\0\0\0n\0\0\0\x1\0\0\0\0\0\0\x3\xe8\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1)
|
||||||
viewMode=Detail
|
viewMode=Detail
|
||||||
|
|||||||
@ -33,11 +33,12 @@ sudo xbps-install -Syu void-repo-nonfree
|
|||||||
sudo xbps-install -y clang git unzip ninja cmake git rsync patch
|
sudo xbps-install -y clang git unzip ninja cmake git rsync patch
|
||||||
sudo xbps-install -y neovim firefox telegram-desktop xcompmgr xorg-minimal xorg-fonts
|
sudo xbps-install -y neovim firefox telegram-desktop xcompmgr xorg-minimal xorg-fonts
|
||||||
sudo xbps-install -y xf86-input-evdev xf86-input-libinput xtools dbus elogind
|
sudo xbps-install -y xf86-input-evdev xf86-input-libinput xtools dbus elogind
|
||||||
sudo xbps-install -y feh noto-fonts-ttf noto-fonts-emoji xdg-desktop-portal xdg-desktop-portal-gtk\
|
sudo xbps-install -y feh noto-fonts-ttf noto-fonts-emoji xdg-desktop-portal xdg-desktop-portal-gtk \
|
||||||
xclip xset pavucontrol pipewire redshift setxkbmap lldb xsetroot wget xss-lock \
|
xclip xset pavucontrol pipewire redshift setxkbmap lldb xsetroot wget xss-lock \
|
||||||
libXinerama-devel libXft-devel libX11-devel pkg-config freetype-devel \
|
libXinerama-devel libXft-devel libX11-devel pkg-config freetype-devel \
|
||||||
zip unzip flatpak pulseaudio playerctl fastfetch btop keepassxc cronie nitrogen \
|
zip unzip flatpak pulseaudio playerctl fastfetch btop keepassxc cronie nitrogen \
|
||||||
man-pages-devel man-pages-posix noto-fonts-cjk libXrandr-devel libXpm-devel imlib2-devel
|
man-pages-devel man-pages-posix noto-fonts-cjk libXrandr-devel libXpm-devel imlib2-devel \
|
||||||
|
brightnessctl
|
||||||
|
|
||||||
if [ "${is_musl:-0}" -ne 0 ]; then
|
if [ "${is_musl:-0}" -ne 0 ]; then
|
||||||
sudo xbps-install -y clang-tools-extra
|
sudo xbps-install -y clang-tools-extra
|
||||||
@ -57,15 +58,25 @@ fi
|
|||||||
|
|
||||||
if [[ is_nvidia -eq 0 ]]; then # mesa
|
if [[ is_nvidia -eq 0 ]]; then # mesa
|
||||||
sudo xbps-install -y mesa-dri
|
sudo xbps-install -y mesa-dri
|
||||||
|
sudo mkdir -p /etc/X11/xorg.conf.d
|
||||||
|
|
||||||
else # nvidia
|
else # nvidia
|
||||||
sudo xbps-install -y nvidia
|
sudo xbps-install -y nvidia
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# intel igpu
|
|
||||||
if lspci -k | grep -EA3 'VGA|3D|Display' | grep -i "Intel Corporation" > /dev/null; then
|
if lspci -k | grep -EA3 'VGA|3D|Display' | grep -i "Intel Corporation" > /dev/null; then
|
||||||
|
# intel igpu
|
||||||
sudo xbps-install -y intel-video-accel
|
sudo xbps-install -y intel-video-accel
|
||||||
elif lspci -k | grep -EA3 'VGA|3D|Display' | grep -q 'AMD'; then
|
elif lspci -k | grep -EA3 'VGA|3D|Display' | grep 'AMD' 2>/dev/null; then
|
||||||
|
# amd (i)gpu
|
||||||
sudo xbps-install -y xf86-video-amdgpu mesa-vaapi mesa-vdpau
|
sudo xbps-install -y xf86-video-amdgpu mesa-vaapi mesa-vdpau
|
||||||
|
sudo tee /etc/X11/xorg.conf.d/20-amdgpu.conf >/dev/null <<'EOF'
|
||||||
|
Section "Device"
|
||||||
|
Identifier "AMD"
|
||||||
|
Driver "amdgpu"
|
||||||
|
Option "TearFree" "true"
|
||||||
|
EndSection
|
||||||
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# session and seat manager
|
# session and seat manager
|
||||||
|
|||||||
BIN
dconf/user
BIN
dconf/user
Binary file not shown.
@ -63,10 +63,11 @@ static const char *const autostart[] = {
|
|||||||
// "nitrogen", "--set-zoom-fill", "/home/plky/.config/wallpaper/kirino.png", "--head=0", NULL,
|
// "nitrogen", "--set-zoom-fill", "/home/plky/.config/wallpaper/kirino.png", "--head=0", NULL,
|
||||||
// "nitrogen", "--set-zoom-fill", "/home/plky/.config/wallpaper/kirino_win7.png", "--head=1", NULL,
|
// "nitrogen", "--set-zoom-fill", "/home/plky/.config/wallpaper/kirino_win7.png", "--head=1", NULL,
|
||||||
"nitrogen", "--restore", NULL,
|
"nitrogen", "--restore", NULL,
|
||||||
// "/home/plky/.config/dwmstat.sh", NULL,
|
|
||||||
"slstatus", NULL,
|
"slstatus", NULL,
|
||||||
// doesnt work??
|
// "picom", "--vsync", "--backend", "glx", "--no-fading-openclose", "--daemon", NULL,
|
||||||
"xcompmgr", NULL,
|
"xcompmgr", NULL,
|
||||||
|
"xss-lock", "--", "slock", NULL,
|
||||||
|
|
||||||
// screen blank/off after 1h
|
// screen blank/off after 1h
|
||||||
"xset", "s", "3600", "3600", NULL,
|
"xset", "s", "3600", "3600", NULL,
|
||||||
@ -137,6 +138,8 @@ static const Key keys[] = {
|
|||||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
||||||
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||||
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
||||||
|
{ MODKEY, XK_Left, setmfact, {.f = -0.01} },
|
||||||
|
{ MODKEY, XK_Right, setmfact, {.f = +0.01} },
|
||||||
{ MODKEY, XK_Return, zoom, {0} },
|
{ MODKEY, XK_Return, zoom, {0} },
|
||||||
{ MODKEY, XK_Tab, view, {0} },
|
{ MODKEY, XK_Tab, view, {0} },
|
||||||
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
|
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
|
||||||
|
|||||||
BIN
dwm-6.6/drw.o
Normal file
BIN
dwm-6.6/drw.o
Normal file
Binary file not shown.
BIN
dwm-6.6/dwm
Executable file
BIN
dwm-6.6/dwm
Executable file
Binary file not shown.
BIN
dwm-6.6/dwm.o
Normal file
BIN
dwm-6.6/dwm.o
Normal file
Binary file not shown.
BIN
dwm-6.6/util.o
Normal file
BIN
dwm-6.6/util.o
Normal file
Binary file not shown.
@ -1,8 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
TZ="America/New_York"
|
|
||||||
while :; do
|
|
||||||
CLK="$(date +"%A %I:%M %p - %m/%d")"
|
|
||||||
xsetroot -name "$CLK"
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
3926
git/ca-bundle.crt
3926
git/ca-bundle.crt
File diff suppressed because it is too large
Load Diff
@ -37,3 +37,4 @@ listen_on unix:/tmp/mykitty
|
|||||||
allow_hyperlinks yes
|
allow_hyperlinks yes
|
||||||
paste_strict_mode no
|
paste_strict_mode no
|
||||||
|
|
||||||
|
confirm_os_window_close 0
|
||||||
|
|||||||
@ -30,8 +30,8 @@ x-scheme-handler/jetbrains=jetbrains-toolbox.desktop
|
|||||||
x-scheme-handler/about=helium.desktop
|
x-scheme-handler/about=helium.desktop
|
||||||
x-scheme-handler/unknown=helium.desktop
|
x-scheme-handler/unknown=helium.desktop
|
||||||
x-scheme-handler/discord-1038970224050962582=nuclear.desktop
|
x-scheme-handler/discord-1038970224050962582=nuclear.desktop
|
||||||
x-scheme-handler/tg=org.telegram.desktop._b1807ce1df22ee6402707058cb72785d.desktop
|
x-scheme-handler/tg=org.telegram.desktop.desktop
|
||||||
x-scheme-handler/tonsite=org.telegram.desktop._b1807ce1df22ee6402707058cb72785d.desktop
|
x-scheme-handler/tonsite=org.telegram.desktop.desktop
|
||||||
application/pdf=org.kde.okular.desktop
|
application/pdf=org.kde.okular.desktop
|
||||||
|
|
||||||
[Added Associations]
|
[Added Associations]
|
||||||
|
|||||||
@ -68,4 +68,4 @@ vim.opt.isfname:append("@-@")
|
|||||||
|
|
||||||
vim.o.updatetime = 50
|
vim.o.updatetime = 50
|
||||||
|
|
||||||
vim.opt.colorcolumn = "105"
|
vim.opt.colorcolumn = "80"
|
||||||
|
|||||||
10
okularrc
10
okularrc
@ -6,7 +6,9 @@ LockSidebar=true
|
|||||||
ShowSidebar=true
|
ShowSidebar=true
|
||||||
|
|
||||||
[Recent Files]
|
[Recent Files]
|
||||||
File1[$e]=$HOME/Documents/Psychology2e_WEB.pdf
|
File1[$e]=$HOME/Downloads/ARoseforEmily-WilliamFaulkner.pdf
|
||||||
File2[$e]=$HOME/Downloads/Young Goodman Brown Full Text - Young Goodman Brown - Owl Eyes.pdf
|
File2[$e]=$HOME/Documents/Psychology2e_WEB.pdf
|
||||||
Name1[$e]=Psychology2e_WEB.pdf
|
File3[$e]=$HOME/Downloads/Bouwsma - Descartes' Evil Genius.pdf
|
||||||
Name2[$e]=Young Goodman Brown Full Text - Young Goodman Brown - Owl Eyes.pdf
|
Name1[$e]=ARoseforEmily-WilliamFaulkner.pdf
|
||||||
|
Name2[$e]=Psychology2e_WEB.pdf
|
||||||
|
Name3[$e]=Bouwsma - Descartes' Evil Genius.pdf
|
||||||
|
|||||||
@ -37,6 +37,8 @@ install: all
|
|||||||
chmod u+s ${DESTDIR}${PREFIX}/bin/slock
|
chmod u+s ${DESTDIR}${PREFIX}/bin/slock
|
||||||
chmod 644 ${CURDIR}/img.jpg
|
chmod 644 ${CURDIR}/img.jpg
|
||||||
chmod u+s ${CURDIR}/img.jpg
|
chmod u+s ${CURDIR}/img.jpg
|
||||||
|
mkdir -p ${DESTDIR}${PREFIX}/share/slock
|
||||||
|
cp img.jpg ${DESTDIR}${PREFIX}/share/slock
|
||||||
mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||||
sed "s/VERSION/${VERSION}/g" <slock.1 >${DESTDIR}${MANPREFIX}/man1/slock.1
|
sed "s/VERSION/${VERSION}/g" <slock.1 >${DESTDIR}${MANPREFIX}/man1/slock.1
|
||||||
chmod 644 ${DESTDIR}${MANPREFIX}/man1/slock.1
|
chmod 644 ${DESTDIR}${MANPREFIX}/man1/slock.1
|
||||||
|
|||||||
@ -25,4 +25,4 @@ static const int shape = 1;
|
|||||||
static const int shapesize = 50;
|
static const int shapesize = 50;
|
||||||
static const int shapegap = 35;
|
static const int shapegap = 35;
|
||||||
|
|
||||||
static const char *background_image = "/home/plky/.config/slock-1.6/img.jpg";
|
static const char *background_image = "/usr/local/share/slock/img.jpg";
|
||||||
|
|||||||
@ -16,7 +16,7 @@ LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr -lImlib2
|
|||||||
|
|
||||||
# flags
|
# flags
|
||||||
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -DHAVE_SHADOW_H
|
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -DHAVE_SHADOW_H
|
||||||
CFLAGS = -std=c99 -pedantic -Wall -2s -march=native -mtune=native ${INCS} ${CPPFLAGS}
|
CFLAGS = -std=c99 -pedantic -Wall -O2 -march=native -mtune=native ${INCS} ${CPPFLAGS}
|
||||||
LDFLAGS = -s ${LIBS}
|
LDFLAGS = -s ${LIBS}
|
||||||
COMPATSRC = explicit_bzero.c
|
COMPATSRC = explicit_bzero.c
|
||||||
|
|
||||||
|
|||||||
BIN
slock-1.6/explicit_bzero.o
Normal file
BIN
slock-1.6/explicit_bzero.o
Normal file
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 9.8 MiB |
BIN
slock-1.6/slock
Executable file
BIN
slock-1.6/slock
Executable file
Binary file not shown.
BIN
slock-1.6/slock.o
Normal file
BIN
slock-1.6/slock.o
Normal file
Binary file not shown.
BIN
slock-1.6/takuji_live_show.jpg
Normal file
BIN
slock-1.6/takuji_live_show.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 88 KiB |
@ -108,13 +108,24 @@
|
|||||||
warn("socket 'AF_UNIX':");
|
warn("socket 'AF_UNIX':");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (strcmp(ifr.ifr_name, interface) != 0) {
|
// if (strcmp(ifr.ifr_name, interface) != 0) {
|
||||||
|
// strcpy(ifr.ifr_name, interface);
|
||||||
|
// if (ioctl(ifsock, SIOCGIFINDEX, &ifr) != 0) {
|
||||||
|
// warn("ioctl 'SIOCGIFINDEX':");
|
||||||
|
// return -1;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (strcmp(ifr.ifr_name, interface) != 0 || ifr.ifr_ifindex == 0) {
|
||||||
strcpy(ifr.ifr_name, interface);
|
strcpy(ifr.ifr_name, interface);
|
||||||
if (ioctl(ifsock, SIOCGIFINDEX, &ifr) != 0) {
|
if (ioctl(ifsock, SIOCGIFINDEX, &ifr) != 0) {
|
||||||
warn("ioctl 'SIOCGIFINDEX':");
|
ifr.ifr_name[0] = '\0'; /* force retry next time */
|
||||||
|
ifr.ifr_ifindex = 0;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return ifr.ifr_ifindex;
|
return ifr.ifr_ifindex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -95,8 +95,8 @@ static const char bt[] =
|
|||||||
"if ! command -v bluetoothctl >/dev/null 2>&1; then "
|
"if ! command -v bluetoothctl >/dev/null 2>&1; then "
|
||||||
"printf \" N/A\"; exit; "
|
"printf \" N/A\"; exit; "
|
||||||
"fi; "
|
"fi; "
|
||||||
// removing timeout 0.1 is worse than death
|
// removing timeout is worse than death
|
||||||
"powered=`timeout 0.1 bluetoothctl show 2>/dev/null | awk -F': ' '/Powered:/ {print $2}'`; "
|
"powered=`timeout 0.073 bluetoothctl show 2>/dev/null | awk -F': ' '/Powered:/ {print $2}'`; "
|
||||||
"if [ \"$powered\" != \"yes\" ]; then "
|
"if [ \"$powered\" != \"yes\" ]; then "
|
||||||
"printf \" OFF\"; exit; "
|
"printf \" OFF\"; exit; "
|
||||||
"fi; "
|
"fi; "
|
||||||
@ -111,13 +111,13 @@ static const char bt[] =
|
|||||||
static const struct arg args[] = {
|
static const struct arg args[] = {
|
||||||
/* function format argument */
|
/* function format argument */
|
||||||
{ wifi_essid, "%s ", "wlp3s0" },
|
{ wifi_essid, "%s ", "wlp3s0" },
|
||||||
{ wifi_perc, "%s%%", "wlp3s0" },
|
{ wifi_perc, "%s%% ", "wlp3s0" },
|
||||||
{ run_command, "| %s", bright },
|
{ run_command, "| %s ", bright },
|
||||||
{ run_command, "| %s", vol },
|
{ run_command, "| %s ", vol },
|
||||||
{ run_command, "| %s", bt },
|
{ run_command, "| %s ", bt },
|
||||||
{ battery_perc, "| %s%%", "BAT0" },
|
{ battery_perc, "| %s%%", "BAT0" },
|
||||||
{ battery_state, "(%s) ", "BAT0" },
|
{ battery_state, "(%s) ", "BAT0" },
|
||||||
{ cpu_freq, "| %sHz", NULL },
|
{ cpu_freq, "| %sHz ", NULL },
|
||||||
{ keymap, "| %s ", NULL },
|
{ keymap, "| %s ", NULL },
|
||||||
{ datetime, "| %s", "%A %I:%M %p - %m/%d" },
|
{ datetime, "| %s", "%A %I:%M %p - %m/%d" },
|
||||||
};
|
};
|
||||||
|
|||||||
BIN
surf-2.1.tar.gz
Normal file
BIN
surf-2.1.tar.gz
Normal file
Binary file not shown.
48
surf-2.1/LICENSE
Normal file
48
surf-2.1/LICENSE
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
MIT/X Consortium License
|
||||||
|
|
||||||
|
© 2009-2010 Enno Boland <tox@s01.de>
|
||||||
|
© 2009 Thomas Menari <spaceinvader@chaotika.org>
|
||||||
|
© 2009 Simon Rozet <simon@rozet.name>
|
||||||
|
© 2009 Andrew Antle <andrew.antle@gmail.com>
|
||||||
|
© 2010-2011 pancake <nopcode.org>
|
||||||
|
© 2011-2013 Anselm R Garbe <anselm@garbe.us>
|
||||||
|
© 2011-2012 Troels Henriksen <athas@sigkill.dk>
|
||||||
|
© 2011 Connor Lane Smith <cls@lubutu.com>
|
||||||
|
© 2012-2017 Christoph Lohmann <20h@r-36.net>
|
||||||
|
© 2013 Shayan Pooya <shayan@liveve.org>
|
||||||
|
© 2013 Jens Nyberg <jens.nyberg@gmail.com>
|
||||||
|
© 2013 Carlos J. Torres <vlaadbrain@gmail.com>
|
||||||
|
© 2013 Alexander Sedov <alex0player@gmail.com>
|
||||||
|
© 2013 Nick White <git@njw.me.uk>
|
||||||
|
© 2013 David Dufberg <david@dufberg.se>
|
||||||
|
© 2014-2017 Quentin Rameau <quinq@fifth.space>
|
||||||
|
© 2014-2016 Markus Teich <markus.teich@stusta.mhn.de>
|
||||||
|
© 2015 Jakukyo Friel <weakish@gmail.com>
|
||||||
|
© 2015 Ben Woolley <tautolog@gmail.com>
|
||||||
|
© 2015 Greg Reagle <greg.reagle@umbc.edu>
|
||||||
|
© 2015 GhostAV <ghostav@riseup.net>
|
||||||
|
© 2015 Ivan Tham <pickfire@riseup.net>
|
||||||
|
© 2015 Alexander Huemer <alexander.huemer@xx.vu>
|
||||||
|
© 2015 Michael Stevens <mstevens@etla.org>
|
||||||
|
© 2015 Felix Janda <felix.janda@posteo.de>
|
||||||
|
© 2016 Charles Lehner <cel@celehner.com>
|
||||||
|
© 2016 Dmitry Bogatov <KAction@gnu.org>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
76
surf-2.1/Makefile
Normal file
76
surf-2.1/Makefile
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
# surf - simple browser
|
||||||
|
# See LICENSE file for copyright and license details.
|
||||||
|
.POSIX:
|
||||||
|
|
||||||
|
include config.mk
|
||||||
|
|
||||||
|
SRC = surf.c
|
||||||
|
WSRC = webext-surf.c
|
||||||
|
OBJ = $(SRC:.c=.o)
|
||||||
|
WOBJ = $(WSRC:.c=.o)
|
||||||
|
WLIB = $(WSRC:.c=.so)
|
||||||
|
|
||||||
|
all: options surf $(WLIB)
|
||||||
|
|
||||||
|
options:
|
||||||
|
@echo surf build options:
|
||||||
|
@echo "CC = $(CC)"
|
||||||
|
@echo "CFLAGS = $(SURFCFLAGS) $(CFLAGS)"
|
||||||
|
@echo "WEBEXTCFLAGS = $(WEBEXTCFLAGS) $(CFLAGS)"
|
||||||
|
@echo "LDFLAGS = $(LDFLAGS)"
|
||||||
|
|
||||||
|
surf: $(OBJ)
|
||||||
|
$(CC) $(SURFLDFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
|
||||||
|
|
||||||
|
$(OBJ) $(WOBJ): config.h common.h config.mk
|
||||||
|
|
||||||
|
config.h:
|
||||||
|
cp config.def.h $@
|
||||||
|
|
||||||
|
$(OBJ): $(SRC)
|
||||||
|
$(CC) $(SURFCFLAGS) $(CFLAGS) -c $(SRC)
|
||||||
|
|
||||||
|
$(WLIB): $(WOBJ)
|
||||||
|
$(CC) -shared -Wl,-soname,$@ $(LDFLAGS) -o $@ $? $(WEBEXTLIBS)
|
||||||
|
|
||||||
|
$(WOBJ): $(WSRC)
|
||||||
|
$(CC) $(WEBEXTCFLAGS) $(CFLAGS) -c $(WSRC)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f surf $(OBJ)
|
||||||
|
rm -f $(WLIB) $(WOBJ)
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
rm -f config.h surf-$(VERSION).tar.gz
|
||||||
|
|
||||||
|
dist: distclean
|
||||||
|
mkdir -p surf-$(VERSION)
|
||||||
|
cp -R LICENSE Makefile config.mk config.def.h README \
|
||||||
|
surf-open.sh arg.h TODO.md surf.png \
|
||||||
|
surf.1 common.h $(SRC) $(WSRC) surf-$(VERSION)
|
||||||
|
tar -cf surf-$(VERSION).tar surf-$(VERSION)
|
||||||
|
gzip surf-$(VERSION).tar
|
||||||
|
rm -rf surf-$(VERSION)
|
||||||
|
|
||||||
|
install: all
|
||||||
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||||
|
cp -f surf $(DESTDIR)$(PREFIX)/bin
|
||||||
|
chmod 755 $(DESTDIR)$(PREFIX)/bin/surf
|
||||||
|
mkdir -p $(DESTDIR)$(LIBDIR)
|
||||||
|
cp -f $(WLIB) $(DESTDIR)$(LIBDIR)
|
||||||
|
for wlib in $(WLIB); do \
|
||||||
|
chmod 644 $(DESTDIR)$(LIBDIR)/$$wlib; \
|
||||||
|
done
|
||||||
|
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
|
||||||
|
sed "s/VERSION/$(VERSION)/g" < surf.1 > $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
||||||
|
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
rm -f $(DESTDIR)$(PREFIX)/bin/surf
|
||||||
|
rm -f $(DESTDIR)$(MANPREFIX)/man1/surf.1
|
||||||
|
for wlib in $(WLIB); do \
|
||||||
|
rm -f $(DESTDIR)$(LIBDIR)/$$wlib; \
|
||||||
|
done
|
||||||
|
- rmdir $(DESTDIR)$(LIBDIR)
|
||||||
|
|
||||||
|
.PHONY: all options distclean clean dist install uninstall
|
||||||
40
surf-2.1/README
Normal file
40
surf-2.1/README
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
surf - simple webkit-based browser
|
||||||
|
==================================
|
||||||
|
surf is a simple Web browser based on WebKit/GTK+.
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
In order to build surf you need GTK+ and Webkit/GTK+ header files.
|
||||||
|
|
||||||
|
In order to use the functionality of the url-bar, also install dmenu[0].
|
||||||
|
|
||||||
|
Installation
|
||||||
|
------------
|
||||||
|
Edit config.mk to match your local setup (surf is installed into
|
||||||
|
the /usr/local namespace by default).
|
||||||
|
|
||||||
|
Afterwards enter the following command to build and install surf (if
|
||||||
|
necessary as root):
|
||||||
|
|
||||||
|
make clean install
|
||||||
|
|
||||||
|
Running surf
|
||||||
|
------------
|
||||||
|
run
|
||||||
|
surf [URI]
|
||||||
|
|
||||||
|
See the manpage for further options.
|
||||||
|
|
||||||
|
Running surf in tabbed
|
||||||
|
----------------------
|
||||||
|
For running surf in tabbed[1] there is a script included in the distribution,
|
||||||
|
which is run like this:
|
||||||
|
|
||||||
|
surf-open.sh [URI]
|
||||||
|
|
||||||
|
Further invocations of the script will run surf with the specified URI in this
|
||||||
|
instance of tabbed.
|
||||||
|
|
||||||
|
[0] http://tools.suckless.org/dmenu
|
||||||
|
[1] http://tools.suckless.org/tabbed
|
||||||
|
|
||||||
10
surf-2.1/TODO.md
Normal file
10
surf-2.1/TODO.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# TODO
|
||||||
|
|
||||||
|
* suckless adblocking
|
||||||
|
* replace twitch() with proper gtk calls to make scrollbars reappear
|
||||||
|
* replace webkit with something sane
|
||||||
|
* add video player options
|
||||||
|
* play in plugin
|
||||||
|
* play in video player
|
||||||
|
* call command with URI (quvi + cclive)
|
||||||
|
|
||||||
48
surf-2.1/arg.h
Normal file
48
surf-2.1/arg.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copy me if you can.
|
||||||
|
* by 20h
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ARG_H__
|
||||||
|
#define ARG_H__
|
||||||
|
|
||||||
|
extern char *argv0;
|
||||||
|
|
||||||
|
/* use main(int argc, char *argv[]) */
|
||||||
|
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
|
||||||
|
argv[0] && argv[0][0] == '-'\
|
||||||
|
&& argv[0][1];\
|
||||||
|
argc--, argv++) {\
|
||||||
|
char argc_;\
|
||||||
|
char **argv_;\
|
||||||
|
int brk_;\
|
||||||
|
if (argv[0][1] == '-' && argv[0][2] == '\0') {\
|
||||||
|
argv++;\
|
||||||
|
argc--;\
|
||||||
|
break;\
|
||||||
|
}\
|
||||||
|
for (brk_ = 0, argv[0]++, argv_ = argv;\
|
||||||
|
argv[0][0] && !brk_;\
|
||||||
|
argv[0]++) {\
|
||||||
|
if (argv_ != argv)\
|
||||||
|
break;\
|
||||||
|
argc_ = argv[0][0];\
|
||||||
|
switch (argc_)
|
||||||
|
#define ARGEND }\
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ARGC() argc_
|
||||||
|
|
||||||
|
#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\
|
||||||
|
((x), abort(), (char *)0) :\
|
||||||
|
(brk_ = 1, (argv[0][1] != '\0')?\
|
||||||
|
(&argv[0][1]) :\
|
||||||
|
(argc--, argv++, argv[0])))
|
||||||
|
|
||||||
|
#define ARGF() ((argv[0][1] == '\0' && argv[1] == NULL)?\
|
||||||
|
(char *)0 :\
|
||||||
|
(brk_ = 1, (argv[0][1] != '\0')?\
|
||||||
|
(&argv[0][1]) :\
|
||||||
|
(argc--, argv++, argv[0])))
|
||||||
|
|
||||||
|
#endif
|
||||||
1
surf-2.1/common.h
Normal file
1
surf-2.1/common.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
#define MSGBUFSZ 8
|
||||||
192
surf-2.1/config.def.h
Normal file
192
surf-2.1/config.def.h
Normal file
@ -0,0 +1,192 @@
|
|||||||
|
/* modifier 0 means no modifier */
|
||||||
|
static int surfuseragent = 1; /* Append Surf version to default WebKit user agent */
|
||||||
|
static char *fulluseragent = ""; /* Or override the whole user agent string */
|
||||||
|
static char *scriptfile = "~/.surf/script.js";
|
||||||
|
static char *styledir = "~/.surf/styles/";
|
||||||
|
static char *certdir = "~/.surf/certificates/";
|
||||||
|
static char *cachedir = "~/.surf/cache/";
|
||||||
|
static char *cookiefile = "~/.surf/cookies.txt";
|
||||||
|
|
||||||
|
/* Webkit default features */
|
||||||
|
/* Highest priority value will be used.
|
||||||
|
* Default parameters are priority 0
|
||||||
|
* Per-uri parameters are priority 1
|
||||||
|
* Command parameters are priority 2
|
||||||
|
*/
|
||||||
|
static Parameter defconfig[ParameterLast] = {
|
||||||
|
/* parameter Arg value priority */
|
||||||
|
[AccessMicrophone] = { { .i = 0 }, },
|
||||||
|
[AccessWebcam] = { { .i = 0 }, },
|
||||||
|
[Certificate] = { { .i = 0 }, },
|
||||||
|
[CaretBrowsing] = { { .i = 0 }, },
|
||||||
|
[CookiePolicies] = { { .v = "@Aa" }, },
|
||||||
|
[DefaultCharset] = { { .v = "UTF-8" }, },
|
||||||
|
[DiskCache] = { { .i = 1 }, },
|
||||||
|
[DNSPrefetch] = { { .i = 0 }, },
|
||||||
|
[Ephemeral] = { { .i = 0 }, },
|
||||||
|
[FileURLsCrossAccess] = { { .i = 0 }, },
|
||||||
|
[FontSize] = { { .i = 12 }, },
|
||||||
|
[FrameFlattening] = { { .i = 0 }, },
|
||||||
|
[Geolocation] = { { .i = 0 }, },
|
||||||
|
[HideBackground] = { { .i = 0 }, },
|
||||||
|
[Inspector] = { { .i = 0 }, },
|
||||||
|
[Java] = { { .i = 1 }, },
|
||||||
|
[JavaScript] = { { .i = 1 }, },
|
||||||
|
[KioskMode] = { { .i = 0 }, },
|
||||||
|
[LoadImages] = { { .i = 1 }, },
|
||||||
|
[MediaManualPlay] = { { .i = 1 }, },
|
||||||
|
[PreferredLanguages] = { { .v = (char *[]){ NULL } }, },
|
||||||
|
[RunInFullscreen] = { { .i = 0 }, },
|
||||||
|
[ScrollBars] = { { .i = 1 }, },
|
||||||
|
[ShowIndicators] = { { .i = 1 }, },
|
||||||
|
[SiteQuirks] = { { .i = 1 }, },
|
||||||
|
[SmoothScrolling] = { { .i = 0 }, },
|
||||||
|
[SpellChecking] = { { .i = 0 }, },
|
||||||
|
[SpellLanguages] = { { .v = ((char *[]){ "en_US", NULL }) }, },
|
||||||
|
[StrictTLS] = { { .i = 1 }, },
|
||||||
|
[Style] = { { .i = 1 }, },
|
||||||
|
[WebGL] = { { .i = 0 }, },
|
||||||
|
[ZoomLevel] = { { .f = 1.0 }, },
|
||||||
|
};
|
||||||
|
|
||||||
|
static UriParameters uriparams[] = {
|
||||||
|
{ "(://|\\.)suckless\\.org(/|$)", {
|
||||||
|
[JavaScript] = { { .i = 0 }, 1 },
|
||||||
|
}, },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* default window size: width, height */
|
||||||
|
static int winsize[] = { 800, 600 };
|
||||||
|
|
||||||
|
static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
|
||||||
|
WEBKIT_FIND_OPTIONS_WRAP_AROUND;
|
||||||
|
|
||||||
|
#define PROMPT_GO "Go:"
|
||||||
|
#define PROMPT_FIND "Find:"
|
||||||
|
|
||||||
|
/* SETPROP(readprop, setprop, prompt)*/
|
||||||
|
#define SETPROP(r, s, p) { \
|
||||||
|
.v = (const char *[]){ "/bin/sh", "-c", \
|
||||||
|
"prop=\"$(printf '%b' \"$(xprop -id $1 $2 " \
|
||||||
|
"| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\")\" " \
|
||||||
|
"| dmenu -p \"$4\" -w $1)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \
|
||||||
|
"surf-setprop", winid, r, s, p, NULL \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* DOWNLOAD(URI, referer) */
|
||||||
|
#define DOWNLOAD(u, r) { \
|
||||||
|
.v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\
|
||||||
|
"curl -g -L -J -O -A \"$1\" -b \"$2\" -c \"$2\"" \
|
||||||
|
" -e \"$3\" \"$4\"; read", \
|
||||||
|
"surf-download", useragent, cookiefile, r, u, NULL \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* PLUMB(URI) */
|
||||||
|
/* This called when some URI which does not begin with "about:",
|
||||||
|
* "http://" or "https://" should be opened.
|
||||||
|
*/
|
||||||
|
#define PLUMB(u) {\
|
||||||
|
.v = (const char *[]){ "/bin/sh", "-c", \
|
||||||
|
"xdg-open \"$0\"", u, NULL \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* VIDEOPLAY(URI) */
|
||||||
|
#define VIDEOPLAY(u) {\
|
||||||
|
.v = (const char *[]){ "/bin/sh", "-c", \
|
||||||
|
"mpv --really-quiet \"$0\"", u, NULL \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* styles */
|
||||||
|
/*
|
||||||
|
* The iteration will stop at the first match, beginning at the beginning of
|
||||||
|
* the list.
|
||||||
|
*/
|
||||||
|
static SiteSpecific styles[] = {
|
||||||
|
/* regexp file in $styledir */
|
||||||
|
{ ".*", "default.css" },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* certificates */
|
||||||
|
/*
|
||||||
|
* Provide custom certificate for urls
|
||||||
|
*/
|
||||||
|
static SiteSpecific certs[] = {
|
||||||
|
/* regexp file in $certdir */
|
||||||
|
{ "://suckless\\.org/", "suckless.org.crt" },
|
||||||
|
};
|
||||||
|
|
||||||
|
#define MODKEY GDK_CONTROL_MASK
|
||||||
|
|
||||||
|
/* hotkeys */
|
||||||
|
/*
|
||||||
|
* If you use anything else but MODKEY and GDK_SHIFT_MASK, don't forget to
|
||||||
|
* edit the CLEANMASK() macro.
|
||||||
|
*/
|
||||||
|
static Key keys[] = {
|
||||||
|
/* modifier keyval function arg */
|
||||||
|
{ MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) },
|
||||||
|
{ MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
|
||||||
|
{ MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
|
||||||
|
|
||||||
|
{ 0, GDK_KEY_Escape, stop, { 0 } },
|
||||||
|
{ MODKEY, GDK_KEY_c, stop, { 0 } },
|
||||||
|
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_r, reload, { .i = 1 } },
|
||||||
|
{ MODKEY, GDK_KEY_r, reload, { .i = 0 } },
|
||||||
|
|
||||||
|
{ MODKEY, GDK_KEY_l, navigate, { .i = +1 } },
|
||||||
|
{ MODKEY, GDK_KEY_h, navigate, { .i = -1 } },
|
||||||
|
|
||||||
|
/* vertical and horizontal scrolling, in viewport percentage */
|
||||||
|
{ MODKEY, GDK_KEY_j, scrollv, { .i = +10 } },
|
||||||
|
{ MODKEY, GDK_KEY_k, scrollv, { .i = -10 } },
|
||||||
|
{ MODKEY, GDK_KEY_space, scrollv, { .i = +50 } },
|
||||||
|
{ MODKEY, GDK_KEY_b, scrollv, { .i = -50 } },
|
||||||
|
{ MODKEY, GDK_KEY_i, scrollh, { .i = +10 } },
|
||||||
|
{ MODKEY, GDK_KEY_u, scrollh, { .i = -10 } },
|
||||||
|
|
||||||
|
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_k, zoom, { .i = +1 } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_q, zoom, { .i = 0 } },
|
||||||
|
{ MODKEY, GDK_KEY_minus, zoom, { .i = -1 } },
|
||||||
|
{ MODKEY, GDK_KEY_plus, zoom, { .i = +1 } },
|
||||||
|
|
||||||
|
{ MODKEY, GDK_KEY_p, clipboard, { .i = 1 } },
|
||||||
|
{ MODKEY, GDK_KEY_y, clipboard, { .i = 0 } },
|
||||||
|
|
||||||
|
{ MODKEY, GDK_KEY_n, find, { .i = +1 } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } },
|
||||||
|
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, print, { 0 } },
|
||||||
|
{ MODKEY, GDK_KEY_t, showcert, { 0 } },
|
||||||
|
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } },
|
||||||
|
{ 0, GDK_KEY_F11, togglefullscreen, { 0 } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_o, toggleinspector, { 0 } },
|
||||||
|
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_c, toggle, { .i = CaretBrowsing } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_f, toggle, { .i = FrameFlattening } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_g, toggle, { .i = Geolocation } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_s, toggle, { .i = JavaScript } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* button definitions */
|
||||||
|
/* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */
|
||||||
|
static Button buttons[] = {
|
||||||
|
/* target event mask button function argument stop event */
|
||||||
|
{ OnLink, 0, 2, clicknewwindow, { .i = 0 }, 1 },
|
||||||
|
{ OnLink, MODKEY, 2, clicknewwindow, { .i = 1 }, 1 },
|
||||||
|
{ OnLink, MODKEY, 1, clicknewwindow, { .i = 1 }, 1 },
|
||||||
|
{ OnAny, 0, 8, clicknavigate, { .i = -1 }, 1 },
|
||||||
|
{ OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 },
|
||||||
|
{ OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 },
|
||||||
|
};
|
||||||
192
surf-2.1/config.h
Normal file
192
surf-2.1/config.h
Normal file
@ -0,0 +1,192 @@
|
|||||||
|
/* modifier 0 means no modifier */
|
||||||
|
static int surfuseragent = 1; /* Append Surf version to default WebKit user agent */
|
||||||
|
static char *fulluseragent = ""; /* Or override the whole user agent string */
|
||||||
|
static char *scriptfile = "~/.surf/script.js";
|
||||||
|
static char *styledir = "~/.surf/styles/";
|
||||||
|
static char *certdir = "~/.surf/certificates/";
|
||||||
|
static char *cachedir = "~/.surf/cache/";
|
||||||
|
static char *cookiefile = "~/.surf/cookies.txt";
|
||||||
|
|
||||||
|
/* Webkit default features */
|
||||||
|
/* Highest priority value will be used.
|
||||||
|
* Default parameters are priority 0
|
||||||
|
* Per-uri parameters are priority 1
|
||||||
|
* Command parameters are priority 2
|
||||||
|
*/
|
||||||
|
static Parameter defconfig[ParameterLast] = {
|
||||||
|
/* parameter Arg value priority */
|
||||||
|
[AccessMicrophone] = { { .i = 0 }, },
|
||||||
|
[AccessWebcam] = { { .i = 0 }, },
|
||||||
|
[Certificate] = { { .i = 0 }, },
|
||||||
|
[CaretBrowsing] = { { .i = 0 }, },
|
||||||
|
[CookiePolicies] = { { .v = "@Aa" }, },
|
||||||
|
[DefaultCharset] = { { .v = "UTF-8" }, },
|
||||||
|
[DiskCache] = { { .i = 1 }, },
|
||||||
|
[DNSPrefetch] = { { .i = 0 }, },
|
||||||
|
[Ephemeral] = { { .i = 0 }, },
|
||||||
|
[FileURLsCrossAccess] = { { .i = 0 }, },
|
||||||
|
[FontSize] = { { .i = 12 }, },
|
||||||
|
[FrameFlattening] = { { .i = 0 }, },
|
||||||
|
[Geolocation] = { { .i = 0 }, },
|
||||||
|
[HideBackground] = { { .i = 0 }, },
|
||||||
|
[Inspector] = { { .i = 0 }, },
|
||||||
|
[Java] = { { .i = 1 }, },
|
||||||
|
[JavaScript] = { { .i = 1 }, },
|
||||||
|
[KioskMode] = { { .i = 0 }, },
|
||||||
|
[LoadImages] = { { .i = 1 }, },
|
||||||
|
[MediaManualPlay] = { { .i = 1 }, },
|
||||||
|
[PreferredLanguages] = { { .v = (char *[]){ NULL } }, },
|
||||||
|
[RunInFullscreen] = { { .i = 0 }, },
|
||||||
|
[ScrollBars] = { { .i = 1 }, },
|
||||||
|
[ShowIndicators] = { { .i = 1 }, },
|
||||||
|
[SiteQuirks] = { { .i = 1 }, },
|
||||||
|
[SmoothScrolling] = { { .i = 0 }, },
|
||||||
|
[SpellChecking] = { { .i = 0 }, },
|
||||||
|
[SpellLanguages] = { { .v = ((char *[]){ "en_US", NULL }) }, },
|
||||||
|
[StrictTLS] = { { .i = 1 }, },
|
||||||
|
[Style] = { { .i = 1 }, },
|
||||||
|
[WebGL] = { { .i = 0 }, },
|
||||||
|
[ZoomLevel] = { { .f = 1.0 }, },
|
||||||
|
};
|
||||||
|
|
||||||
|
static UriParameters uriparams[] = {
|
||||||
|
{ "(://|\\.)suckless\\.org(/|$)", {
|
||||||
|
[JavaScript] = { { .i = 0 }, 1 },
|
||||||
|
}, },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* default window size: width, height */
|
||||||
|
static int winsize[] = { 800, 600 };
|
||||||
|
|
||||||
|
static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
|
||||||
|
WEBKIT_FIND_OPTIONS_WRAP_AROUND;
|
||||||
|
|
||||||
|
#define PROMPT_GO "Go:"
|
||||||
|
#define PROMPT_FIND "Find:"
|
||||||
|
|
||||||
|
/* SETPROP(readprop, setprop, prompt)*/
|
||||||
|
#define SETPROP(r, s, p) { \
|
||||||
|
.v = (const char *[]){ "/bin/sh", "-c", \
|
||||||
|
"prop=\"$(printf '%b' \"$(xprop -id $1 $2 " \
|
||||||
|
"| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\")\" " \
|
||||||
|
"| dmenu -p \"$4\" -w $1)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \
|
||||||
|
"surf-setprop", winid, r, s, p, NULL \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* DOWNLOAD(URI, referer) */
|
||||||
|
#define DOWNLOAD(u, r) { \
|
||||||
|
.v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\
|
||||||
|
"curl -g -L -J -O -A \"$1\" -b \"$2\" -c \"$2\"" \
|
||||||
|
" -e \"$3\" \"$4\"; read", \
|
||||||
|
"surf-download", useragent, cookiefile, r, u, NULL \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* PLUMB(URI) */
|
||||||
|
/* This called when some URI which does not begin with "about:",
|
||||||
|
* "http://" or "https://" should be opened.
|
||||||
|
*/
|
||||||
|
#define PLUMB(u) {\
|
||||||
|
.v = (const char *[]){ "/bin/sh", "-c", \
|
||||||
|
"xdg-open \"$0\"", u, NULL \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* VIDEOPLAY(URI) */
|
||||||
|
#define VIDEOPLAY(u) {\
|
||||||
|
.v = (const char *[]){ "/bin/sh", "-c", \
|
||||||
|
"mpv --really-quiet \"$0\"", u, NULL \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* styles */
|
||||||
|
/*
|
||||||
|
* The iteration will stop at the first match, beginning at the beginning of
|
||||||
|
* the list.
|
||||||
|
*/
|
||||||
|
static SiteSpecific styles[] = {
|
||||||
|
/* regexp file in $styledir */
|
||||||
|
{ ".*", "default.css" },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* certificates */
|
||||||
|
/*
|
||||||
|
* Provide custom certificate for urls
|
||||||
|
*/
|
||||||
|
static SiteSpecific certs[] = {
|
||||||
|
/* regexp file in $certdir */
|
||||||
|
{ "://suckless\\.org/", "suckless.org.crt" },
|
||||||
|
};
|
||||||
|
|
||||||
|
#define MODKEY GDK_CONTROL_MASK
|
||||||
|
|
||||||
|
/* hotkeys */
|
||||||
|
/*
|
||||||
|
* If you use anything else but MODKEY and GDK_SHIFT_MASK, don't forget to
|
||||||
|
* edit the CLEANMASK() macro.
|
||||||
|
*/
|
||||||
|
static Key keys[] = {
|
||||||
|
/* modifier keyval function arg */
|
||||||
|
{ MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) },
|
||||||
|
{ MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
|
||||||
|
{ MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
|
||||||
|
|
||||||
|
{ 0, GDK_KEY_Escape, stop, { 0 } },
|
||||||
|
{ MODKEY, GDK_KEY_c, stop, { 0 } },
|
||||||
|
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_r, reload, { .i = 1 } },
|
||||||
|
{ MODKEY, GDK_KEY_r, reload, { .i = 0 } },
|
||||||
|
|
||||||
|
{ MODKEY, GDK_KEY_l, navigate, { .i = +1 } },
|
||||||
|
{ MODKEY, GDK_KEY_h, navigate, { .i = -1 } },
|
||||||
|
|
||||||
|
/* vertical and horizontal scrolling, in viewport percentage */
|
||||||
|
{ MODKEY, GDK_KEY_j, scrollv, { .i = +10 } },
|
||||||
|
{ MODKEY, GDK_KEY_k, scrollv, { .i = -10 } },
|
||||||
|
{ MODKEY, GDK_KEY_space, scrollv, { .i = +50 } },
|
||||||
|
{ MODKEY, GDK_KEY_b, scrollv, { .i = -50 } },
|
||||||
|
{ MODKEY, GDK_KEY_i, scrollh, { .i = +10 } },
|
||||||
|
{ MODKEY, GDK_KEY_u, scrollh, { .i = -10 } },
|
||||||
|
|
||||||
|
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_k, zoom, { .i = +1 } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_q, zoom, { .i = 0 } },
|
||||||
|
{ MODKEY, GDK_KEY_minus, zoom, { .i = -1 } },
|
||||||
|
{ MODKEY, GDK_KEY_plus, zoom, { .i = +1 } },
|
||||||
|
|
||||||
|
{ MODKEY, GDK_KEY_p, clipboard, { .i = 1 } },
|
||||||
|
{ MODKEY, GDK_KEY_y, clipboard, { .i = 0 } },
|
||||||
|
|
||||||
|
{ MODKEY, GDK_KEY_n, find, { .i = +1 } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } },
|
||||||
|
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, print, { 0 } },
|
||||||
|
{ MODKEY, GDK_KEY_t, showcert, { 0 } },
|
||||||
|
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } },
|
||||||
|
{ 0, GDK_KEY_F11, togglefullscreen, { 0 } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_o, toggleinspector, { 0 } },
|
||||||
|
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_c, toggle, { .i = CaretBrowsing } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_f, toggle, { .i = FrameFlattening } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_g, toggle, { .i = Geolocation } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_s, toggle, { .i = JavaScript } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } },
|
||||||
|
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* button definitions */
|
||||||
|
/* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */
|
||||||
|
static Button buttons[] = {
|
||||||
|
/* target event mask button function argument stop event */
|
||||||
|
{ OnLink, 0, 2, clicknewwindow, { .i = 0 }, 1 },
|
||||||
|
{ OnLink, MODKEY, 2, clicknewwindow, { .i = 1 }, 1 },
|
||||||
|
{ OnLink, MODKEY, 1, clicknewwindow, { .i = 1 }, 1 },
|
||||||
|
{ OnAny, 0, 8, clicknavigate, { .i = -1 }, 1 },
|
||||||
|
{ OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 },
|
||||||
|
{ OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 },
|
||||||
|
};
|
||||||
32
surf-2.1/config.mk
Normal file
32
surf-2.1/config.mk
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# surf version
|
||||||
|
VERSION = 2.1
|
||||||
|
|
||||||
|
# Customize below to fit your system
|
||||||
|
|
||||||
|
# paths
|
||||||
|
PREFIX = /usr/local
|
||||||
|
MANPREFIX = $(PREFIX)/share/man
|
||||||
|
LIBPREFIX = $(PREFIX)/lib
|
||||||
|
LIBDIR = $(LIBPREFIX)/surf
|
||||||
|
|
||||||
|
X11INC = `pkg-config --cflags x11`
|
||||||
|
X11LIB = `pkg-config --libs x11`
|
||||||
|
|
||||||
|
GTKINC = `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.1`
|
||||||
|
GTKLIB = `pkg-config --libs gtk+-3.0 gcr-3 webkit2gtk-4.1`
|
||||||
|
WEBEXTINC = `pkg-config --cflags webkit2gtk-4.1 webkit2gtk-web-extension-4.1 gio-2.0`
|
||||||
|
WEBEXTLIBS = `pkg-config --libs webkit2gtk-4.1 webkit2gtk-web-extension-4.1 gio-2.0`
|
||||||
|
|
||||||
|
# includes and libs
|
||||||
|
INCS = $(X11INC) $(GTKINC)
|
||||||
|
LIBS = $(X11LIB) $(GTKLIB) -lgthread-2.0
|
||||||
|
|
||||||
|
# flags
|
||||||
|
CPPFLAGS = -DVERSION=\"$(VERSION)\" -DGCR_API_SUBJECT_TO_CHANGE \
|
||||||
|
-DLIBPREFIX=\"$(LIBPREFIX)\" -DWEBEXTDIR=\"$(LIBDIR)\" \
|
||||||
|
-D_DEFAULT_SOURCE
|
||||||
|
SURFCFLAGS = -fPIC $(INCS) $(CPPFLAGS)
|
||||||
|
WEBEXTCFLAGS = -fPIC $(WEBEXTINC)
|
||||||
|
|
||||||
|
# compiler
|
||||||
|
#CC = c99
|
||||||
21
surf-2.1/patches/libwebkit2gtk41.patch
Normal file
21
surf-2.1/patches/libwebkit2gtk41.patch
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
Source: https://gitlab.alpinelinux.org/alpine/aports/-/blob/c915c16061cdb0d2390a3683c704625ebddaa045/testing/surf/webkit2gtk-4.1.patch
|
||||||
|
|
||||||
|
diff --git a/config.mk b/config.mk
|
||||||
|
index 2eb9fb0..544e123 100644
|
||||||
|
--- a/config.mk
|
||||||
|
+++ b/config.mk
|
||||||
|
@@ -12,10 +12,10 @@ LIBDIR = $(LIBPREFIX)/surf
|
||||||
|
X11INC = `pkg-config --cflags x11`
|
||||||
|
X11LIB = `pkg-config --libs x11`
|
||||||
|
|
||||||
|
-GTKINC = `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0`
|
||||||
|
-GTKLIB = `pkg-config --libs gtk+-3.0 gcr-3 webkit2gtk-4.0`
|
||||||
|
-WEBEXTINC = `pkg-config --cflags webkit2gtk-4.0 webkit2gtk-web-extension-4.0 gio-2.0`
|
||||||
|
-WEBEXTLIBS = `pkg-config --libs webkit2gtk-4.0 webkit2gtk-web-extension-4.0 gio-2.0`
|
||||||
|
+GTKINC = `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.1`
|
||||||
|
+GTKLIB = `pkg-config --libs gtk+-3.0 gcr-3 webkit2gtk-4.1`
|
||||||
|
+WEBEXTINC = `pkg-config --cflags webkit2gtk-4.1 webkit2gtk-web-extension-4.1 gio-2.0`
|
||||||
|
+WEBEXTLIBS = `pkg-config --libs webkit2gtk-4.1 webkit2gtk-web-extension-4.1 gio-2.0`
|
||||||
|
|
||||||
|
# includes and libs
|
||||||
|
INCS = $(X11INC) $(GTKINC)
|
||||||
BIN
surf-2.1/surf
Executable file
BIN
surf-2.1/surf
Executable file
Binary file not shown.
32
surf-2.1/surf-open.sh
Executable file
32
surf-2.1/surf-open.sh
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# See the LICENSE file for copyright and license details.
|
||||||
|
#
|
||||||
|
|
||||||
|
xidfile="$HOME/tmp/tabbed-surf.xid"
|
||||||
|
uri=""
|
||||||
|
|
||||||
|
if [ "$#" -gt 0 ];
|
||||||
|
then
|
||||||
|
uri="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
runtabbed() {
|
||||||
|
tabbed -dn tabbed-surf -r 2 surf -e '' "$uri" >"$xidfile" \
|
||||||
|
2>/dev/null &
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ ! -r "$xidfile" ];
|
||||||
|
then
|
||||||
|
runtabbed
|
||||||
|
else
|
||||||
|
xid=$(cat "$xidfile")
|
||||||
|
xprop -id "$xid" >/dev/null 2>&1
|
||||||
|
if [ $? -gt 0 ];
|
||||||
|
then
|
||||||
|
runtabbed
|
||||||
|
else
|
||||||
|
surf -e "$xid" "$uri" >/dev/null 2>&1 &
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
305
surf-2.1/surf.1
Normal file
305
surf-2.1/surf.1
Normal file
@ -0,0 +1,305 @@
|
|||||||
|
.TH SURF 1 surf\-VERSION
|
||||||
|
.SH NAME
|
||||||
|
surf \- simple webkit-based browser
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B surf
|
||||||
|
.RB [-bBdDfFgGiIkKmMnNpPsStTvwxX]
|
||||||
|
.RB [-a\ cookiepolicies]
|
||||||
|
.RB [-c\ cookiefile]
|
||||||
|
.RB [-C\ stylefile]
|
||||||
|
.RB [-e\ xid]
|
||||||
|
.RB [-r\ scriptfile]
|
||||||
|
.RB [-u\ useragent]
|
||||||
|
.RB [-z\ zoomlevel]
|
||||||
|
.RB [URI]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
surf is a simple Web browser based on WebKit/GTK+. It is able
|
||||||
|
to display websites and follow links. It supports the XEmbed protocol
|
||||||
|
which makes it possible to embed it in another application. Furthermore,
|
||||||
|
one can point surf to another URI by setting its XProperties.
|
||||||
|
.SH OPTIONS
|
||||||
|
.TP
|
||||||
|
.B \-a cookiepolicies
|
||||||
|
Define the order of
|
||||||
|
.I cookie policies\fR.
|
||||||
|
The default is "@Aa" but could be
|
||||||
|
redefined in the
|
||||||
|
.IR config.h ,
|
||||||
|
with "A" meaning to
|
||||||
|
accept all cookies, "a" to deny all cookies and "@", which tells surf to
|
||||||
|
accept no third party cookies.
|
||||||
|
.TP
|
||||||
|
.B \-b
|
||||||
|
Disable Scrollbars.
|
||||||
|
.TP
|
||||||
|
.B \-B
|
||||||
|
Enable Scrollbars.
|
||||||
|
.TP
|
||||||
|
.B \-c cookiefile
|
||||||
|
Specify the
|
||||||
|
.I cookiefile
|
||||||
|
to use.
|
||||||
|
.TP
|
||||||
|
.B \-C stylefile
|
||||||
|
Specify the user
|
||||||
|
.IR stylefile .
|
||||||
|
This does disable the site-specific styles.
|
||||||
|
.TP
|
||||||
|
.B \-d
|
||||||
|
Disable the disk cache.
|
||||||
|
.TP
|
||||||
|
.B \-D
|
||||||
|
Enable the disk cache.
|
||||||
|
.TP
|
||||||
|
.B \-e xid
|
||||||
|
Reparents to window specified by
|
||||||
|
.IR xid .
|
||||||
|
.TP
|
||||||
|
.B \-f
|
||||||
|
Start surf in windowed mode (not fullscreen).
|
||||||
|
.TP
|
||||||
|
.B \-F
|
||||||
|
Start surf in fullscreen mode.
|
||||||
|
.TP
|
||||||
|
.B \-g
|
||||||
|
Disable giving the geolocation to websites.
|
||||||
|
.TP
|
||||||
|
.B \-G
|
||||||
|
Enable giving the geolocation to websites.
|
||||||
|
.TP
|
||||||
|
.B \-i
|
||||||
|
Disable Images.
|
||||||
|
.TP
|
||||||
|
.B \-I
|
||||||
|
Enable Images.
|
||||||
|
.TP
|
||||||
|
.B \-k
|
||||||
|
Disable kiosk mode (disable key strokes and right click).
|
||||||
|
.TP
|
||||||
|
.B \-K
|
||||||
|
Enable kiosk mode (disable key strokes and right click).
|
||||||
|
.TP
|
||||||
|
.B \-m
|
||||||
|
Disable application of user style sheets.
|
||||||
|
.TP
|
||||||
|
.B \-M
|
||||||
|
Enable application of user style sheets.
|
||||||
|
.TP
|
||||||
|
.B \-n
|
||||||
|
Disable the Web Inspector (Developer Tools).
|
||||||
|
.TP
|
||||||
|
.B \-N
|
||||||
|
Enable the Web Inspector (Developer Tools).
|
||||||
|
.TP
|
||||||
|
.B \-r scriptfile
|
||||||
|
Specify the user
|
||||||
|
.IR scriptfile .
|
||||||
|
.TP
|
||||||
|
.B \-s
|
||||||
|
Disable Javascript.
|
||||||
|
.TP
|
||||||
|
.B \-S
|
||||||
|
Enable Javascript.
|
||||||
|
.TP
|
||||||
|
.B \-t
|
||||||
|
Disable strict TLS check.
|
||||||
|
.TP
|
||||||
|
.B \-T
|
||||||
|
Enable strict TLS check.
|
||||||
|
.TP
|
||||||
|
.B \-u useragent
|
||||||
|
Specify the
|
||||||
|
.I useragent
|
||||||
|
which surf should use.
|
||||||
|
.TP
|
||||||
|
.B \-v
|
||||||
|
Prints version information to standard output, then exits.
|
||||||
|
.TP
|
||||||
|
.B \-w
|
||||||
|
Prints xid to standard output. This can be used to script the browser in for
|
||||||
|
example
|
||||||
|
.BR xdotool(1) .
|
||||||
|
.TP
|
||||||
|
.B -x
|
||||||
|
Disable custom certificates.
|
||||||
|
.TP
|
||||||
|
.B -X
|
||||||
|
Enable custom certificates.
|
||||||
|
.TP
|
||||||
|
.B \-z zoomlevel
|
||||||
|
Specify the
|
||||||
|
.I zoomlevel
|
||||||
|
which surf should use.
|
||||||
|
.SH USAGE
|
||||||
|
.B Escape
|
||||||
|
Stops loading current page or stops download.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-h
|
||||||
|
Walks back the history.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-l
|
||||||
|
Walks forward the history.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-k
|
||||||
|
Scrolls page upwards.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-j
|
||||||
|
Scrolls page downwards.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-b
|
||||||
|
Scroll up one whole page view.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Space
|
||||||
|
Scroll down one whole page view.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-i
|
||||||
|
Scroll horizontally to the right.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-u
|
||||||
|
Scroll horizontally to the left.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Shift\-k or Ctrl\-+
|
||||||
|
Zooms page in.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Shift\-j or Ctrl\--
|
||||||
|
Zooms page out.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Shift\-q
|
||||||
|
Resets Zoom.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-f and Ctrl\-/
|
||||||
|
Opens the search-bar.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-n
|
||||||
|
Go to next search result.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Shift\-n
|
||||||
|
Go to previous search result.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-g
|
||||||
|
Opens the URL-bar (requires dmenu installed).
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-p
|
||||||
|
Loads URI from primary selection.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Shift\-p
|
||||||
|
Calls Printpage Dialog.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-r
|
||||||
|
Reloads the website.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Shift\-r
|
||||||
|
Reloads the website without using the cache.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-y
|
||||||
|
Copies current URI to primary selection.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-t
|
||||||
|
Display the current TLS certificate in a popup window.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Shift\-a
|
||||||
|
Toggle through the the
|
||||||
|
.I cookie policies\fR.
|
||||||
|
This will not reload the page.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Shift\-b
|
||||||
|
Toggle scrollbars. This will reload the page.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Shift\-c
|
||||||
|
Toggle caret browsing. This will reload the page.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Shift\-i
|
||||||
|
Toggle auto-loading of images. This will reload the page.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Shift\-m
|
||||||
|
Toggle if the
|
||||||
|
.I stylefile
|
||||||
|
file should be loaded. This will reload the page.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Shift\-o
|
||||||
|
Open the Web Inspector (Developer Tools) window for the current page.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Shift\-s
|
||||||
|
Toggle script execution. This will reload the page.
|
||||||
|
.TP
|
||||||
|
.B Ctrl\-Shift\-t
|
||||||
|
Toggle strict TLS check. This will reload the page.
|
||||||
|
.TP
|
||||||
|
.B F11
|
||||||
|
Toggle fullscreen mode.
|
||||||
|
.SH INDICATORS OF OPERATION
|
||||||
|
Surf is showing indicators of operation in front of the site title.
|
||||||
|
For all indicators, unless otherwise specified, a lower case letter means disabled and an upper case letter means enabled.
|
||||||
|
.TP
|
||||||
|
.B A
|
||||||
|
all cookies accepted
|
||||||
|
.TP
|
||||||
|
.B a
|
||||||
|
no cookies accepted
|
||||||
|
.TP
|
||||||
|
.B @
|
||||||
|
all except third-party cookies accepted
|
||||||
|
.TP
|
||||||
|
.B c C
|
||||||
|
caret browsing
|
||||||
|
.TP
|
||||||
|
.B g G
|
||||||
|
geolocation
|
||||||
|
.TP
|
||||||
|
.B d D
|
||||||
|
disk cache
|
||||||
|
.TP
|
||||||
|
.B i I
|
||||||
|
images
|
||||||
|
.TP
|
||||||
|
.B s S
|
||||||
|
scripts
|
||||||
|
.TP
|
||||||
|
.B m M
|
||||||
|
styles
|
||||||
|
.TP
|
||||||
|
.B f F
|
||||||
|
frame flattening
|
||||||
|
.TP
|
||||||
|
.B x X
|
||||||
|
custom certificates
|
||||||
|
.TP
|
||||||
|
.B t T
|
||||||
|
strict TLS
|
||||||
|
.SH INDICATORS OF WEB PAGE
|
||||||
|
The second part of the indicators specifies modes of the web page itself.
|
||||||
|
.SS First character: encryption
|
||||||
|
.TP
|
||||||
|
.B -
|
||||||
|
unencrypted
|
||||||
|
.TP
|
||||||
|
.B T
|
||||||
|
encrypted (TLS)
|
||||||
|
.TP
|
||||||
|
.B U
|
||||||
|
attempted encryption but failed
|
||||||
|
.SS Second character: proxying
|
||||||
|
.TP
|
||||||
|
.B -
|
||||||
|
no proxy
|
||||||
|
.TP
|
||||||
|
.B P
|
||||||
|
using proxy
|
||||||
|
.SH ENVIRONMENT
|
||||||
|
.B SURF_USERAGENT
|
||||||
|
If this variable is set upon startup, surf will use it as the
|
||||||
|
.I useragent
|
||||||
|
string.
|
||||||
|
.TP
|
||||||
|
.B http_proxy
|
||||||
|
If this variable is set and not empty upon startup, surf will use it as the http proxy.
|
||||||
|
.SH SIGNALS
|
||||||
|
Surf will reload the current page on
|
||||||
|
.BR SIGHUP .
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR dmenu(1),
|
||||||
|
.BR xprop(1),
|
||||||
|
.BR tabbed(1),
|
||||||
|
.BR xdotool(1)
|
||||||
|
.SH BUGS
|
||||||
|
Please report them!
|
||||||
2134
surf-2.1/surf.c
Normal file
2134
surf-2.1/surf.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
surf-2.1/surf.o
Normal file
BIN
surf-2.1/surf.o
Normal file
Binary file not shown.
BIN
surf-2.1/surf.png
Normal file
BIN
surf-2.1/surf.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 240 B |
106
surf-2.1/webext-surf.c
Normal file
106
surf-2.1/webext-surf.c
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
#include <sys/socket.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <gio/gio.h>
|
||||||
|
#include <webkit2/webkit-web-extension.h>
|
||||||
|
#include <webkitdom/webkitdom.h>
|
||||||
|
#include <webkitdom/WebKitDOMDOMWindowUnstable.h>
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
#define LENGTH(x) (sizeof(x) / sizeof(x[0]))
|
||||||
|
|
||||||
|
static WebKitWebExtension *webext;
|
||||||
|
static int sock;
|
||||||
|
|
||||||
|
static void
|
||||||
|
msgsurf(guint64 pageid, const char *s)
|
||||||
|
{
|
||||||
|
static char msg[MSGBUFSZ];
|
||||||
|
size_t sln = strlen(s);
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if ((ret = snprintf(msg, sizeof(msg), "%c%s", pageid, s))
|
||||||
|
>= sizeof(msg)) {
|
||||||
|
fprintf(stderr, "webext: msg: message too long: %d\n", ret);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (send(sock, msg, ret, 0) < 0)
|
||||||
|
fprintf(stderr, "webext: error sending: %s\n", msg+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
readsock(GIOChannel *s, GIOCondition c, gpointer unused)
|
||||||
|
{
|
||||||
|
static char js[48], msg[MSGBUFSZ];
|
||||||
|
WebKitWebPage *page;
|
||||||
|
JSCContext *jsc;
|
||||||
|
GError *gerr = NULL;
|
||||||
|
gsize msgsz;
|
||||||
|
|
||||||
|
if (g_io_channel_read_chars(s, msg, sizeof(msg), &msgsz, &gerr) !=
|
||||||
|
G_IO_STATUS_NORMAL) {
|
||||||
|
if (gerr) {
|
||||||
|
fprintf(stderr, "webext: error reading socket: %s\n",
|
||||||
|
gerr->message);
|
||||||
|
g_error_free(gerr);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msgsz < 2) {
|
||||||
|
fprintf(stderr, "webext: readsock: message too short: %d\n",
|
||||||
|
msgsz);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(page = webkit_web_extension_get_page(webext, msg[0])))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
jsc = webkit_frame_get_js_context(webkit_web_page_get_main_frame(page));
|
||||||
|
|
||||||
|
switch (msg[1]) {
|
||||||
|
case 'h':
|
||||||
|
if (msgsz != 3)
|
||||||
|
return TRUE;
|
||||||
|
snprintf(js, sizeof(js),
|
||||||
|
"window.scrollBy(window.innerWidth/100*%d,0);",
|
||||||
|
msg[2]);
|
||||||
|
jsc_context_evaluate(jsc, js, -1);
|
||||||
|
break;
|
||||||
|
case 'v':
|
||||||
|
if (msgsz != 3)
|
||||||
|
return TRUE;
|
||||||
|
snprintf(js, sizeof(js),
|
||||||
|
"window.scrollBy(0,window.innerHeight/100*%d);",
|
||||||
|
msg[2]);
|
||||||
|
jsc_context_evaluate(jsc, js, -1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
G_MODULE_EXPORT void
|
||||||
|
webkit_web_extension_initialize_with_user_data(WebKitWebExtension *e,
|
||||||
|
const GVariant *gv)
|
||||||
|
{
|
||||||
|
GIOChannel *gchansock;
|
||||||
|
|
||||||
|
webext = e;
|
||||||
|
|
||||||
|
g_variant_get(gv, "i", &sock);
|
||||||
|
|
||||||
|
gchansock = g_io_channel_unix_new(sock);
|
||||||
|
g_io_channel_set_encoding(gchansock, NULL, NULL);
|
||||||
|
g_io_channel_set_flags(gchansock, g_io_channel_get_flags(gchansock)
|
||||||
|
| G_IO_FLAG_NONBLOCK, NULL);
|
||||||
|
g_io_channel_set_close_on_unref(gchansock, TRUE);
|
||||||
|
g_io_add_watch(gchansock, G_IO_IN, readsock, NULL);
|
||||||
|
}
|
||||||
BIN
surf-2.1/webext-surf.o
Normal file
BIN
surf-2.1/webext-surf.o
Normal file
Binary file not shown.
BIN
surf-2.1/webext-surf.so
Executable file
BIN
surf-2.1/webext-surf.so
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user