Idk I got crazy but mostly nyxt

This commit is contained in:
Chris Cochrun 2021-09-22 09:57:09 -05:00
parent 263d10c080
commit 1b2ce4207d
12 changed files with 198 additions and 137 deletions

@ -1 +1 @@
Subproject commit 0fb85341916b6de1c5cd6ddf3e8472292a93a303
Subproject commit 048cf41e0aa5a391948d62e6168d6e54279cf627

View file

@ -32,15 +32,17 @@
;; Handle runtime errors after startup
(do
(var in_error false)
(awesome.connect_signal "debug::error" (fn [err]
;; Make sure we don't go into an endless error loop
(when (not in_error)
(set in_error true)
(naughty.notify {:preset naughty.config.presets.critical
:title "Oops, an error happened!"
:text (tostring err)})
(set in_error false)))))
(var in_error false)
(awesome.connect_signal "debug::error" (fn [err]
;; Make sure we don't go into an endless error loop
(when (not in_error)
(set in_error true)
(naughty.notify {:preset naughty.config.presets.critical
:title "Oops, an error happened!"
:text (tostring err)})
(set in_error false)))))
;; Variable definitions
;; Themes define colours, icons, font and wallpapers.
@ -72,7 +74,7 @@
(if (= "syl\n" stdout)
(global laptop true)
(global laptop false))))
(local laptop true)
(local laptop false)
;; Table of layouts to cover with awful.layout.inc, order matters.
(set awful.layout.layouts [
@ -644,11 +646,12 @@
(awful.placement.no_offscreen c))
;; MPV wasn't centering right
(when (= c.class "mpv") (awful.placement.centered c))
(when (= c.class "mpv")
(awful.placement.centered c))
(awful.client.focus.byidx 1)
;; Rounded windows done right
(when (not c.fullscreen)
(when (and (not c.fullscreen) (not (= c.name "Display Window")))
(set c.shape (fn [cr w h]
(gears.shape.rounded_rect cr w h (dpi 15)))))
@ -692,7 +695,7 @@
(awful.spawn "bluetoothctl power on")
(awful.spawn "nextcloud --background")
(awful.spawn "rbw-agent")
;; (awful.spawn "jellyfin-mpv-shim")
(awful.spawn "jellyfin-mpv-shim")
(awful.spawn "xset r rate 220 90")
(awful.spawn "autorandr -c")

View file

@ -2,6 +2,8 @@
(local gears (require "gears"))
(local beautiful (require "beautiful"))
(local hotkeys_popup (require "awful.hotkeys_popup"))
(local xresources (require "beautiful.xresources"))
(local dpi xresources.apply_dpi)
(local bling (require "bling"))
;; (local awestore (require "awestore"))
@ -16,7 +18,7 @@
;; (local anim-y (awestore.tweened 1100 { :duration 200 :easing awestore.easing.cubic_in_out }))
;; (local anim-x (awestore.tweened 1920 { :duration 200 :easing awestore.easing.cubic_in_out }))
;; (local xcenter (screen.primary.width))
(local agenda-scratch (bling.module.scratchpad {
:command "emacsclient -e '(chris/org-agenda)'"
@ -24,7 +26,7 @@
:sticky true
:autoclose true
:floating true
:geometry {:height 1300 :width 1500 :x 377 :y 73}
:geometry {:height (dpi 950) :width (dpi 900) :x (dpi 560) :y (dpi 73)}
:reapply true
:dont_focus_before_close true
;; :awestore {:x anim-x :y anim-y}
@ -169,7 +171,7 @@
{:description "select pass" :group "apps" })
(awful.key [ modkey shift ] "w" (fn [] (awful.spawn "libreoffice --writer"))
{:description "Open Writer" :group "apps" })
(awful.key [modkey] "b" (fn [] (awful.spawn "qutebrowser"))
(awful.key [modkey] "b" (fn [] (awful.spawn "nyxt"))
{:description "launch browser" :group "apps"})
;; rofi
(awful.key [] "Menu" (fn [] (awful.spawn "/home/chris/.config/rofi/launchers-git/launcher.sh"))

View file

@ -39,6 +39,7 @@
:raise true
:height (dpi 800)
:screen (screen.count)
:sticky true
:placement (+ awful.placement.no_offscreen awful.placement.centered)
}
}

View file

@ -95,7 +95,7 @@ the close button is positioned to the far right */
margin-right: calc(0px + var(--uc-navigationbar-width));
/* Remove empty space above tabs so that tabs are clickable at very top of screen */
margin-left: 10px;
margin-top: -20px !important;
margin-top: -31px !important;
max-height: 20px !important;
font-size: 13px !important;
z-index: 10;
@ -180,7 +180,7 @@ the close button is positioned to the far right */
/*visibility: visible !important;*/
min-height: 32px !important;
max-height: 32px !important;
margin-top: 5px !important;
margin-top: 10px !important;
margin-bottom: -38px !important;
transition: all 200ms ease 0s !important;
z-index: 5 !important;
@ -190,7 +190,7 @@ the close button is positioned to the far right */
/* make urlbar rounded */
#urlbar{
margin-top: 30px !important;
margin-top: 31px !important;
padding-right: 10px !important;
padding-left: 10px !important;
}

View file

@ -4,7 +4,7 @@ set -U fish_user_paths $HOME/.local/bin $HOME/scripts $HOME/.doom-emacs/bin $HOM
set TERM "xterm-256color"
set EDITOR "emacsclient -c -a"
set VISUAL "emacsclient -c -a emacs"
set QT_QPA_PLATFORMTHEME "qt5ct"
# set QT_QPA_PLATFORMTHEME "qt5ct"
set KWIN_DRM_USE_EGL_STREAMS 1
set -Ux ANDROID_SDK_ROOT /opt/android-sdk
set -Ux JAVA_HOME /usr/lib/jvm/default

View file

@ -23,9 +23,12 @@
((default-modes (append '(vi-insert-mode
) %slot-default%))))
(define-configuration browser
((external-editor-program '("/usr/bin/emacsclient"))))
;; Create a function to launch mpv with given url
(defun mpv (url)
"MPV launches with given url using the fast profile."
"MPV launches with given url using the fast profile."
(uiop:run-program (list "mpv" "--profile=fast" url)))
;; Create a function to download videos with youtube-dl in alacritty
@ -90,70 +93,70 @@
(define-configuration buffer
((search-engines
(list
(make-instance 'search-engine
(make-instance 'search-engine
:shortcut "s"
:search-url "https://search.tfcconnection.org/?q=~a"
:fallback-url "https://search.tfcconnection.org")))))
(define-configuration status-buffer
((style
(str:concat
%slot-default%
(cl-css:css
'((body
:background "#282a36"
:color "#e2e4e5"
:line-height "1fr")
("#container"
:grid-template-columns "0px 4fr 0px 2fr 0px 0px")
("#controls"
:background-color "#282a36"
:color "#f3f99d"
:width "0px"
:padding-left "0px"
:hidden)
("#url"
:background-color "#282a36"
:color "#5af78e")
("#modes"
:background-color "#282a36"
:color "#f3f99d")
("#tabs"
:background-color "#282a36"
:color "#5af78e")
(".tab"
:background-color "#282a36"
:color "#9aedfe")
(".tab:hover"
:background-color "#282a36"
:color "#f1f1f0")
(".button"
:background-color "#282a36"
:color "#5af78e")
(".button:hover"
:background-color "#282a36"
:color "#f1f1f0")
(".arrow"
:width "0px"
:height "0px")
(".arrow-right"
:background-color "#282a36"
:color "#5af78e")
(".arrow-left"
:background-color "#282a36"
:color "#5af78e")
))))))
((style
(str:concat
%slot-default%
(cl-css:css
'((body
:background "#282a36"
:color "#e2e4e5"
:line-height "1fr")
("#container"
:grid-template-columns "0px 4fr 0px 2fr 0px 0px")
("#controls"
:background-color "#282a36"
:color "#f3f99d"
:width "0px"
:padding-left "0px"
:hidden)
("#url"
:background-color "#282a36"
:color "#5af78e")
("#modes"
:background-color "#282a36"
:color "#f3f99d")
("#tabs"
:background-color "#282a36"
:color "#5af78e")
(".tab"
:background-color "#282a36"
:color "#9aedfe")
(".tab:hover"
:background-color "#282a36"
:color "#f1f1f0")
(".button"
:background-color "#282a36"
:color "#5af78e")
(".button:hover"
:background-color "#282a36"
:color "#f1f1f0")
(".arrow"
:width "0px"
:height "0px")
(".arrow-right"
:background-color "#282a36"
:color "#5af78e")
(".arrow-left"
:background-color "#282a36"
:color "#5af78e")
))))))
(define-configuration internal-buffer
((style
(str:concat
%slot-default%
(cl-css:css
'((body
:background "#282a36"
:color "#e2e4e5")
(.button
:color "#e2e4e5")))))))
((style
(str:concat
%slot-default%
(cl-css:css
'((body
:background "#282a36"
:color "#e2e4e5")
(.button
:color "#e2e4e5")))))))
(define-configuration window
((message-buffer-style
@ -165,48 +168,67 @@
:color "#e2e4e5")))))))
(define-configuration prompt-buffer
((style
(str:concat
%slot-default%
(cl-css:css
'((body
:background-color "#282a36"
:color "#e2e4e5")
("#prompt-area"
:background-color "#282a36"
:color "#57c7ff")
("#prompt"
:background-color "#282a36"
:color "#e2e4e5")
("#input"
:background-color "#282a36"
:color "#e2e4e5")
("#suggestions"
:background-color "#282a36"
:color "#e2e4e5")
(.source
:margin-left "5px")
(.source-name
:background-color "#282a36"
:color "#e2e4e5")
(.source-content
:background-color "#282a36"
:color "#e2e4e5")
;; (".source-content td"
;; :background-color "#282a36"
;; :color "#e2e4e5")
(".source-content th"
:background-color "#43454f"
:color "#e2e4e5")
("#selection"
:background-color "#57c7ff"
:color "#34353e")
(.marked
:background-color "#5af78e"
:color "#34353e")
(.selected
:background-color "#57c7ff"
:color "#34353e")
(.button
:color "#e2e4e5")))))))
((style
(str:concat
%slot-default%
(cl-css:css
'((body
:background-color "#282a36"
:color "#e2e4e5")
("#prompt-area"
:background-color "#282a36"
:color "#57c7ff")
("#prompt"
:background-color "#282a36"
:color "#e2e4e5")
("#input"
:background-color "#282a36"
:color "#e2e4e5")
("#suggestions"
:background-color "#282a36"
:color "#e2e4e5")
(.source
:margin-left "5px")
(.source-name
:background-color "#282a36"
:color "#e2e4e5")
(.source-content
:background-color "#282a36"
:color "#e2e4e5")
;; (".source-content td"
;; :background-color "#282a36"
;; :color "#e2e4e5")
(".source-content th"
:background-color "#43454f"
:color "#e2e4e5")
("#selection"
:background-color "#57c7ff"
:color "#34353e")
(.marked
:background-color "#5af78e"
:color "#34353e")
(.selected
:background-color "#57c7ff"
:color "#34353e")
(.button
:color "#e2e4e5")))))))
(in-package #:nyxt-user) ; While implicit, this allows SLY to know which package we are in.
(load "~/quicklisp/setup.lisp")
(ql:quickload :slynk)
(define-command-global start-slynk (&optional (slynk-port *swank-port*))
"Start a Slynk server that can be connected to, for instance, in
Emacs via SLY.
Warning: This allows Nyxt to be controlled remotely, that is, to execute
arbitrary code with the privileges of the user running Nyxt. Make sure
you understand the security risks associated with this before running
this command."
(slynk:create-server :port slynk-port :dont-close t)
(echo "Slynk server started at port ~a" slynk-port))
(start-slynk)

View file

@ -1,11 +1,17 @@
(define-command start-slynk (&optional (slynk-port *swank-port*))
"Start a Slynk server that can be connected to, for instance, in
(in-package #:nyxt-user) ; While implicit, this allows SLY to know which package we are in.
(load "~/quicklisp/setup.lisp")
(ql:quickload :slynk)
(define-command-global start-slynk (&optional (slynk-port *swank-port*))
"Start a Slynk server that can be connected to, for instance, in
Emacs via SLY.
Warning: This allows Nyxt to be controlled remotely, that is, to execute
arbitrary code with the privileges of the user running Nyxt. Make sure
you understand the security risks associated with this before running
this command."
(slynk:create-server :port slynk-port :dont-close t)
(echo "Slynk server started at port ~a" slynk-port))
(slynk:create-server :port slynk-port :dont-close t)
(echo "Slynk server started at port ~a" slynk-port))
(start-slynk)

View file

@ -24,7 +24,7 @@ shadow = true;
shadow-radius = 38;
# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
shadow-opacity = .99;
shadow-opacity = 1.0;
# The left offset for shadows, in pixels. (defaults to -15)
shadow-offset-x = -20;
@ -68,6 +68,8 @@ shadow-offset-y = -20;
# shadow-exclude = []
shadow-exclude = [
"name = 'Notification'",
"name = 'Projection Window'",
"name = 'Video'",
"class_g = 'Conky'",
# "class_g = 'firefox'",
# "class_g = 'Alacritty'",
@ -107,6 +109,8 @@ fade-out-step = 0.08;
# Specify a list of conditions of windows that should not be faded.
# don't need this, we disable fading for all normal windows with wintypes: {}
fade-exclude = [
"name = 'Projection Window'",
"name = 'Video'",
"class_g = 'slop'" # maim
]
@ -124,7 +128,7 @@ fade-exclude = [
# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
# inactive-opacity = 1
inactive-opacity = 0.75;
inactive-opacity = 0.55;
# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
# frame-opacity = 1.0
@ -141,14 +145,17 @@ inactive-opacity-override = false;
active-opacity = 0.75;
# Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
# inactive-dim = 0.0
inactive-dim = 0.4
# Specify a list of conditions of windows that should always be considered focused.
# focus-exclude = []
focus-exclude = [
"class_g = 'Cairo-clock'",
"class_g = 'Bar'", # lemonbar
"class_g = 'slop'" # maim
"name = 'Projection Window'",
"class_g = 'slop'", # maim
"name = 'Video'",
"class_g = 'mpv'"
];
# Use fixed inactive dim value, instead of adjusting according to window opacity.
@ -180,6 +187,8 @@ opacity-rule = [
"100:class_g = 'dolphin'",
"100:class_g = 'mpv'",
"100:class_g = 'libreoffice'",
"100:name = 'Projection Window'",
"100:name = 'Video'",
"100:_NET_WM_STATE@[0]:32a *= '_NET_WM_STATE_FULLSCREEN'",
"0:_NET_WM_STATE@[0]:32a *= '_NET_WM_STATE_HIDDEN'",
"0:_NET_WM_STATE@[1]:32a *= '_NET_WM_STATE_HIDDEN'",
@ -251,6 +260,9 @@ blur-background-exclude = [
"class_g = 'slop'",
"_GTK_FRAME_EXTENTS@:c",
"class_g = 'soffice'",
"name = 'Display Window'",
"name = 'Video'",
"name = 'Projection Window'",
# "window_type = '_NET_WM_WINDOW_TYPE_NOTIFICATION'"
"window_type = 'notification'"
];

View file

@ -1,6 +1,6 @@
[FileDialog]
history=file:///home/chris, file:///home/chris/nextcloud/tfc/Documents
lastVisited=file:///home/chris/nextcloud/tfc/Documents
history=file:///home/chris, file:///home/chris/nextcloud/tfc/Documents, file:///home/chris/Downloads, file:///home/chris/Pictures
lastVisited=file:///home/chris/Pictures
qtVersion=5.15.2
shortcuts=file:, file:///home/chris, file:///home/chris/storage/tfc
sidebarWidth=116

12
scripts/autorun.sh Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
export QT_QPA_PLATFORMTHEME='qt5ct'
function run {
if ! pgrep -f $1 ;
then
$@&
fi
}
run jellyfin-mpv-shim

View file

@ -17,7 +17,7 @@ set searchurls.o https://www.office.com/search?auth=2&q=
set searchurls.wiki https://en.wikipedia.org/wiki/Special:Search/
set searchurls.g https://www.google.com/search?q=
set searchurls.d https://duckduckgo.com/?q=
set searchurls.s https://search.cochrun.xyz/?q=
set searchurls.s https://search.tfcconnection.org/?q=
set searchurls.ama https://smile.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=
set searchurls.google https://www.google.com/search?q=
set searchurls.googlelucky https://www.google.com/search?btnI=I'm+Feeling+Lucky&q=
@ -49,9 +49,12 @@ set quickmark od https://odysee.com/$/following
"" Org Capture
command org-capture composite get_current_url | js -p tri.excmds.exclaim_quiet('org-capture ' + JS_ARG);
" MPV
command mpv js -p tri.excmds.shellescape(JS_ARG).then(url => tri.excmds.exclaim_quiet('mpv --profile=fast ' + url))
"" Adding my own bindings
bind v hint -W mpvsafe
bind gv current_url mpvsafe
bind v hint -W mpv
bind gv current_url mpv
bind F hint -w
bind gy hint -y
bind gc org-capture