add everything

This commit is contained in:
speedie 2022-11-02 16:31:07 +01:00
parent fa04e5dae0
commit 9d74ac5651
6 changed files with 227 additions and 2 deletions

View file

@ -1,3 +1,28 @@
# startpage
# Usage with qutebrowser
Clone the repository into ~/.config/qutebrowser and add these two lines to config.py.
Minimal JS/PHP free start page for qutebrowser with Pywal and dynamic image support.
config.set('url.start_pages','~/.config/qutebrowser/startpage/index.html')
config.set('url.default_page','~/.config/qutebrowser/startpage/index.html')
You don't need to edit script.sh if you're using qutebrowser as it is default.
# Usage for other browsers
Clone the repository and edit script.sh and change PREFIX.
Check the wiki on how to set a start page for your specific browser.
# To copy in the wallpaper
If you're using speedwm-extras, you can copy the script to ~/.config/speedwm/swal/postrun.sh.
Note that you need to be using speedwm-swal newer than 1.2 for this.
Otherwise find some other method to copy the wallpaper to img/wallpaper.
# Pywal
If you're using Pywal, this script also allows you to override font colors with pywal colors.
Simply run the script and make sure Pywal works.
# License
License for the shell script is GNU GPLv3.
License for the HTML and this README is Creative Commons Attribution-ShareAlike 4.0 International.
# Credit
- Me - Wrote the main page
- emilyd - Help with search bar

5
colors Normal file
View file

@ -0,0 +1,5 @@
LINKCOLOR="#e0ffff"
HEADCOLOR="#ffffff"
PARACOLOR="#bbbbbb"
TXSXCOLOR="#e0ffff"
BGSXCOLOR="#222222"

BIN
font.ttf Normal file

Binary file not shown.

BIN
img/wallpaper Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

161
index.html Normal file
View file

@ -0,0 +1,161 @@
<!DOCTYPE html>
<html>
<head>
<title>home://</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body, html {
height: 100%;
margin: 0;
}
@font-face {
font-family: selfont;
src: url(font.ttf);
}
* {
font-family: selfont, sans-serif;
font-weight: normal;
margin: 0;
box-sizing: border-box;
}
a {
color: #e0ffff;
}
h1 {
color: #ffffff;
}
p {
color: #bbbbbb;
}
.image {
/* the image used. this file should be created by speedwm-swal or similar. */
background-image: url("img/wallpaper");
/* blur the page */
filter: blur(8px);
-webkit-filter: blur(8px);
/* height = full image */
height: 100%;
/* center the image */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
/* position header text in the middle */
.header {
background-color: rgba(0,0,0, 0.4); /* background color */
color: white; /* text color */
font-weight: bold; /* use bold text */
border: 0px; /* no border */
position: absolute;
border-radius: 25px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2;
width: 80%;
padding: 20px;
text-align: center;
}
/* left text stack */
.leftstack {
text-align: left;
display: inline-block;
padding-left: 20px;
padding-right: 20px;
padding-top: 20px;
}
/* middle text stack */
.midstack {
text-align: center;
display: inline-block;
padding-left: 20px;
padding-right: 20px;
padding-top: 20px;
}
/* right text stack */
.rightstack {
text-align: right;
display: inline-block;
padding-left: 20px;
padding-right: 20px;
padding-top: 20px;
}
/* search bar */
input[type=search] {
-webkit-box-shadow: 0 0 0px 1000px #222222 inset;
-webkit-text-fill-color: #e0ffff !important;
box-sizing: border-box;
border: 0px;
border-radius: 20px;
width: 50%;
font-size: 15px;
transition: width 0.4s ease-in-out;
}
/* search div */
.search {
padding-top: 20px;
}
</style>
<link rel="stylesheet" href="fontcol.css">
</head>
<body>
<div class="image"></div>
<div class="header">
<h1 style="font-size:50px">home://</h1>
<div class="leftstack">
<p>web://</p>
<p><a href="https://searx.org">searx</a></p>
<p><a href="https://piped.kavin.rocks">piped</a></p>
<p><a href="https://discord.com/channels/@me">discord</a></p>
<p><a href="https://gmail.com">gmail</a></p>
<p><a href="https://knaben.eu">knaben</a></p>
<p><a href="https://lulz.com">lulz</a></p>
<p><a href="https://4chan.org/g/">/g/</a></p>
</div>
<div class="midstack">
<p>code://</p>
<p><a href="https://codeberg.org">codeberg</a></p>
<p><a href="https://github.com">github</a></p>
<p><a href="https://codeberg.org/speedie/speedwm">speedwm</a></p>
<p><a href="https://codeberg.org/speedie/iron">iron</a></p>
<p><a href="https://codeberg.org/speedie/fontctrl">fontctrl</a></p>
<p><a href="https://codeberg.org/speedie/dotfiles">dotfiles</a></p>
<p><a href="https://codeberg.org/speedie/scripts">scripts</a></p>
</div>
<div class="rightstack">
<p>wiki://</p>
<p><a href="https://gentoo.org">gentoo home</a></p>
<p><a href="https://packages.gentoo.org">gentoo pkgs</a></p>
<p><a href="https://wiki.gentoo.org">gentoo wiki</a></p>
<p><a href="https://archlinux.org">arch home</a></p>
<p><a href="https://wiki.archlinux.org">arch wiki</a></p>
<p><a href="https://wiki.voidlinux.org/voidlinux_en_all_2021-04/A/Main_Page">void wiki</a></p>
<p><a href="https://voidlinux.org/packages/">void pkgs</a></p>
</div>
<div class="search">
<form method="POST" action="https://searx.donut.gq/search">
<input type="search" autofocus="" name="q" placeholder="search with searx..." aria-label="" autocomplete="off" value="" accesskey="s">
</form>
</div>
</div>
</body>
</html>

34
script.sh Executable file
View file

@ -0,0 +1,34 @@
#!/bin/sh
# Simple script for speedwm-swal which copies the current wallpaper to img/wallpaper and sets colors.
# Licensed under GNU GPLv3.
PREFIX="$HOME/.config/qutebrowser" # Prefix
CWAL="$HOME/.config/speedwm/swal/CurrentWallpaper" # Symlink to the current wallpaper
# Real path for current wallpaper
command -v speedwm-swal > /dev/null && \
IPATH="$(readlink "$CWAL")"
# Copy current wallpaper to img/wallpaper
if [ -e "$IPATH" ]; then
/bin/cp "$IPATH" "$PREFIX/startpage/img/wallpaper"
else
printf "Wallpaper is not available, skipping.\n"
fi
# Color for links
. "$PREFIX/startpage/colors"
# Set colors based on wal/colors
if [ -e "$HOME/.cache/wal/colors" ]; then
LINKCOLOR="$(sed -n 7,7p $HOME/.cache/wal/colors)"
PARACOLOR="$(sed -n 2,2p $HOME/.cache/wal/colors)"
HEADCOLOR="$(sed -n 4,4p $HOME/.cache/wal/colors)"
TXSXCOLOR="$(sed -n 8,8p $HOME/.cache/wal/colors)"
BGSXCOLOR="$(sed -n 13,13p $HOME/.cache/wal/colors)"
fi
printf "a {\n color: ${LINKCOLOR};\n}\n" > "$PREFIX/startpage/fontcol.css"
printf "h1 {\n color: ${HEADCOLOR};\n}\n" >> "$PREFIX/startpage/fontcol.css"
printf "p {\n color: ${PARACOLOR};\n}\n" >> "$PREFIX/startpage/fontcol.css"
printf "input[type=search] {\n -webkit-box-shadow: 0 0 0px 1000px ${BGSXCOLOR} inset;\n -webkit-text-fill-color: ${TXSXCOLOR} !important;\n}\n" >> $PREFIX/startpage/fontcol.css