Browse Source

Add firefox start/homepage

master
SolitudeSF 8 months ago
parent
commit
88748eac3d
No known key found for this signature in database
6 changed files with 80 additions and 1 deletions
  1. 1
    0
      elvish/lib/config.elv
  2. 1
    0
      firefox/homepage.css
  3. 23
    0
      firefox/homepage.nims
  4. 1
    0
      ntr/profiles/default
  5. 51
    0
      ntr/templates/homepage.css
  6. 3
    1
      setup

+ 1
- 0
elvish/lib/config.elv View File

@@ -40,3 +40,4 @@ fn mpv { edit $conf/mpv/mpv.conf }
fn mpwc { edit $conf/mpwc/(cat ~/sns/mpwname).mpsites }
fn ncmpcpp { edit &type=ini $conf/ncmpcpp/config }
fn bedrock { edit /bedrock/etc/bedrock.conf; sudo brl apply }
fn homepage { edit $dot/firefox/homepage.nims; e:nim e $dot/firefox/homepage.nims >~/.mozilla/firefox/homepage.html }

+ 1
- 0
firefox/homepage.css View File

@@ -0,0 +1 @@
/home/solitude/dot/ntr/templates/homepage.css

+ 23
- 0
firefox/homepage.nims View File

@@ -0,0 +1,23 @@
import karax/[karaxdsl, vdom]
from ../../sns/homepageData import links

func homepage: VNode =
result = buildHtml(html(lang = "en")):
head:
meta(charset = "UTF-8")
meta(name = "viewport", content = "width=device-width, initial-scale=1")
title:
text "New Tab"
link(rel = "stylesheet", `type` = "text/css", href = "homepage.css")
body:
tdiv(class = "categories"):
for (category, items) in links:
tdiv(class = "category"):
p(class = "header"):
text category
for (l, t) in items:
tdiv(class = "item"):
a(href = l):
text t

echo "<!DOCTYPE html>", homepage()

+ 1
- 0
ntr/profiles/default View File

@@ -5,3 +5,4 @@ dunst: <{$XDG_CONFIG_HOME}>/dunst/dunstrc
zathura: <{$XDG_CONFIG_HOME}>/zathura/zathurarc
polybar: <{$XDG_CONFIG_HOME}>/polybar/config
rofi-theme: <{$XDG_CONFIG_HOME}>/rofi/theme.rasi
homepage.css: <{$HOME}>/.mozilla/firefox/homepage.css

+ 51
- 0
ntr/templates/homepage.css View File

@@ -0,0 +1,51 @@
body {
height: 100%;
background: <{color.bg}>;
color: <{color.fg}>;
}

.categories {
display: flex;
flex-direction: row;
width: 100%;
margin-top: 10%;
align-items: top;
justify-content: center;
}

.category {
display: flex;
flex-direction: column;
width: 20%;
margin: 2%;
padding: 2%;
align-items: top;
justify-content: top;
}

.header {
font-size: 32px;
font-weight: bold;
}

.item:hover {
background: <{color.fg}>;
}

.item:hover a {
color: <{color.bg}>;
}

a, p {
font-family: monospace;
color: <{color.fg}>;
}

a:link {
text-decoration: none;
font-size: 24px;
}

a:visited {
color: <{color.fg}>;
}

+ 3
- 1
setup View File

@@ -96,7 +96,9 @@ for arg; do
FF_DIR=$HOME/.mozilla/firefox/$(ls -t "$HOME/.mozilla/firefox/" | grep -v profiles.ini | head -1)
FF_CHROME=$FF_DIR/chrome
_install firefox/user.js "$FF_DIR/user.js"
_install firefox/userChrome.css "$FF_CHROME/userChrome.css";;
_install firefox/userChrome.css "$FF_CHROME/userChrome.css"
nim e firefox/homepage.nims >"$HOME/.mozilla/firefox/homepage.html"
_render homepage.css "$HOME/.mozilla/firefox/homepage.css";;
elvish)
_install elvish/rc.elv "$HOME/.elvish/rc.elv"
for i in elvish/lib/* ; do

Loading…
Cancel
Save