make nyxt sleeker

This commit is contained in:
Chris Cochrun 2021-09-25 06:59:26 -05:00
parent 72b6c49e94
commit c5d884ccb5
10 changed files with 247 additions and 109 deletions

View file

@ -318,7 +318,7 @@ colors:
# #
# Window opacity as a floating point number from `0.0` to `1.0`. # Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque. # The value `0.0` is completely transparent and `1.0` is opaque.
background_opacity: 1.0 background_opacity: 0.75
#selection: #selection:
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t" #semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"

View file

@ -0,0 +1,17 @@
function sway-getwindowinfo
slurp -p -f "%x %y" | read x_sel y_sel
or return 1
# TODO: this returns everything when there is only one container open in the workspace
# need to fix the logic
for rect in (swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x) \(.width) \(.y) \(.height)"')
echo $rect | read x1 w y1 h
set x2 (math $x1 + $w)
set y2 (math $y1 + $h)
if test \( $x_sel -ge $x1 \) -a \( $x_sel -le $x2 \)
and test \( $y_sel -ge $y1 \) -a \( $y_sel -le $y2 \)
#swaymsg --type get_tree | jq ".. | objects | select(.rect.x == $x1 and .rect.y == $y1 and .rect.width == $w and .rect.height == $h) | .id, .name, .pid, .title, .app_id, .marks, .type"
swaymsg --type get_tree | jq ".. | objects | select(.rect.x == $x1 and .rect.y == $y1 and .rect.width == $w and .rect.height == $h)"
end
end
end

View file

@ -10,3 +10,5 @@
((VISIBLE-IN-STATUS-P NIL))) ((VISIBLE-IN-STATUS-P NIL)))
(DEFINE-CONFIGURATION NYXT/WEB-MODE:WEB-MODE (DEFINE-CONFIGURATION NYXT/WEB-MODE:WEB-MODE
((VISIBLE-IN-STATUS-P NIL))) ((VISIBLE-IN-STATUS-P NIL)))
(DEFINE-CONFIGURATION NYXT/VI-MODE:USER-VI-NORMAL-MODE
((VISIBLE-IN-STATUS-P NIL)))

View file

@ -71,7 +71,7 @@
"J" 'switch-buffer-previous "J" 'switch-buffer-previous
"b" 'switch-buffer "b" 'switch-buffer
"v" 'hint-mpv "v" 'hint-mpv
"C-v v" 'hint-ytdl "V" 'hint-ytdl
"d" 'delete-current-buffer "d" 'delete-current-buffer
"D" 'delete-buffer "D" 'delete-buffer
"r" 'reload-current-buffer "r" 'reload-current-buffer
@ -92,61 +92,67 @@
%slot-default%)))) %slot-default%))))
(define-configuration buffer (define-configuration buffer
((search-engines ((search-engines
(list (list
(make-instance 'search-engine (make-instance 'search-engine
:shortcut "s" :shortcut "s"
:search-url "https://search.tfcconnection.org/?q=~a" :search-url "https://search.tfcconnection.org/?q=~a"
:fallback-url "https://search.tfcconnection.org"))))) :fallback-url "https://search.tfcconnection.org")))))
(define-configuration nyxt/vi-mode:vi-normal-mode
((visible-in-status-p nil)))
(define-configuration nyxt/vi-mode:vi-insert-mode
((visible-in-status-p nil)))
(define-configuration status-buffer (define-configuration status-buffer
((style ((style
(str:concat (str:concat
%slot-default% %slot-default%
(cl-css:css (cl-css:css
'((body '((body
:background "#282a36" :background "#282a36"
:color "#e2e4e5" :color "#e2e4e5"
:line-height "1fr") :line-height "1fr")
("#container-vi" ("#container-vi"
:grid-template-columns "0px 30px 2fr 0px 240px") :grid-template-columns "0px 30px 2fr 0px 240px")
("#controls" ("#controls"
:background-color "#282a36" :background-color "#282a36"
:color "#f3f99d" :color "#f3f99d"
:width "0px" :width "0px"
:padding-left "0px" :padding-left "0px"
:hidden) :hidden)
("#url" ("#url"
:background-color "#282a36" :background-color "#282a36"
:color "#5af78e") :color "#5af78e")
("#modes" ("#modes"
:background-color "#282a36" :background-color "#282a36"
:color "#f3f99d") :color "#f3f99d")
("#tabs" ("#tabs"
:background-color "#282a36" :background-color "#282a36"
:color "#5af78e") :color "#5af78e")
(".tab" (".tab"
:background-color "#282a36" :background-color "#282a36"
:color "#9aedfe") :color "#9aedfe")
(".tab:hover" (".tab:hover"
:background-color "#282a36" :background-color "#282a36"
:color "#f1f1f0") :color "#f1f1f0")
(".button" (".button"
:background-color "#282a36" :background-color "#282a36"
:color "#5af78e") :color "#5af78e")
(".button:hover" (".button:hover"
:background-color "#282a36" :background-color "#282a36"
:color "#f1f1f0") :color "#f1f1f0")
(".arrow" (".arrow"
:width "0px" :width "0px"
:height "0px") :height "0px")
(".arrow-right" (".arrow-right"
:background-color "#282a36" :background-color "#282a36"
:color "#5af78e") :color "#5af78e")
(".arrow-left" (".arrow-left"
:background-color "#282a36" :background-color "#282a36"
:color "#5af78e") :color "#5af78e")
)))))) ))))))
(define-configuration internal-buffer (define-configuration internal-buffer
((style ((style
@ -169,50 +175,54 @@
:color "#e2e4e5"))))))) :color "#e2e4e5")))))))
(define-configuration prompt-buffer (define-configuration prompt-buffer
((style ((style
(str:concat (str:concat
%slot-default% %slot-default%
(cl-css:css (cl-css:css
'((body '((body
:background-color "#282a36" :background-color "#282a36"
:color "#e2e4e5") :color "#e2e4e5")
("#prompt-area" ("#prompt-area-vi"
:background-color "#282a36" :background-color "#282a36"
:color "#57c7ff") :color "#57c7ff")
("#prompt" ("#prompt"
:background-color "#282a36" :background-color "#282a36"
:color "#e2e4e5") :color "#e2e4e5")
("#input" ("#input"
:background-color "#282a36" :background-color "#282a36"
:color "#e2e4e5") :color "#e2e4e5")
("#suggestions" ("#suggestions"
:background-color "#282a36" :background-color "#282a36"
:color "#e2e4e5") :color "#e2e4e5")
(.source (.vi-insert-mode
:margin-left "5px") :background-color "#282a36")
(.source-name (.vi-normal-mode
:background-color "#282a36" :background-color "#282a36")
:color "#e2e4e5") (.source
(.source-content :margin-left "5px")
:background-color "#282a36" (.source-name
:color "#e2e4e5") :background-color "#282a36"
;; (".source-content td" :color "#e2e4e5")
;; :background-color "#282a36" (.source-content
;; :color "#e2e4e5") :background-color "#282a36"
(".source-content th" :color "#e2e4e5")
:background-color "#43454f" ;; (".source-content td"
:color "#e2e4e5") ;; :background-color "#282a36"
("#selection" ;; :color "#e2e4e5")
:background-color "#57c7ff" (".source-content th"
:color "#34353e") :background-color "#43454f"
(.marked :color "#e2e4e5")
:background-color "#5af78e" ("#selection"
:color "#34353e") :background-color "#57c7ff"
(.selected :color "#34353e")
:background-color "#57c7ff" (.marked
:color "#34353e") :background-color "#5af78e"
(.button :color "#34353e")
:color "#e2e4e5"))))))) (.selected
:background-color "#57c7ff"
:color "#34353e")
(.button
:color "#e2e4e5")))))))

View file

@ -2,7 +2,7 @@
configuration { configuration {
font: "VictorMono Nerd Font 22.0"; font: "VictorMono Nerd Font 12.0";
show-icons: false; show-icons: false;
} }
@import "/home/chris/.config/rofi/config.rasi" @import "/home/chris/.config/rofi/config.rasi"

View file

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/bash
# Check to see if nyxt is running # Check to see if nyxt is running
if [ -n $(pgrep -c nyxt) ]; then if pgrep -x nyxt > /dev/null; then
echo running echo running
if [ $XDG_SESSION_TYPE = "x11" ]; then if [ $XDG_SESSION_TYPE = "x11" ]; then

71
scripts/plasma-rofi-rbw.sh Executable file
View file

@ -0,0 +1,71 @@
#!/usr/bin/env bash
# Very basic interface for rbw using rofi
if [ $(hostname) = "syl" ]; then
style="laptop-rbw"
#echo "this is hidpi"
else
style="desktop-rbw"
#echo "this is not hidpi"
fi
# Get all password files and create an array
root=~/.password-store
CACHE=~/.local/tmp/pass_rofi
seat=seat0
rbw sync
rbw list
list_passwords() {
rbw list
}
passwords=$(rbw list)
prompt='search for passwords...'
SECRET=$(list_passwords | rofi -i -p="${prompt}" -dmenu -theme ~/.config/rofi/launchers-git/$style.rasi)
# Ask whether pass, user or both are required
options=("Password" \
"User" \
"User and password" \
"QR-Code" \
"OTP")
option=$(printf '%s\n' "${options[@]%}" | rofi -i -dmenu -width 400 -lines 4 -prompt="..." -theme ~/.config/rofi/launchers-git/$style.rasi)
echo $option
case ${option} in
Password )
echo "${SECRET}"
ydotool type $(rbw get "${SECRET}")
;;
User )
ydotool type $(rbw get --full "${SECRET}" | rg Username: | awk '{$1 = ""; print $0}')
;;
"User and password" )
ydotool type $(rbw get --full "${SECRET}" | rg Username: | awk '{$1 = ""; print $0}')
ydotool key Tab
ydotool type $(rbw get "${SECRET}")
;;
"QR-Code" )
if [[ $SECRET =~ wifi$ ]]; then
# Produce a valid wifi QR-code
WIFISSID=$(pass get_user ${SECRET})
WIFIPASS=$(pass get_pass ${SECRET})
WIFIQR="WIFI:T:WPA;S:${WIFISSID};P:${WIFIPASS};;"
qrencode -s 8 -o - $WIFIQR | feh --title "pass: QR-WIFI" -
else
# Only password
pass show -q1 ${SECRET}
fi
;;
"OTP" )
ydotool type $(rbw code ${SECRET})
;;
esac
# wl-copy -o -s ${seat} ${PASSWD_PASS}

32
scripts/swayprop Executable file
View file

@ -0,0 +1,32 @@
#!/bin/bash
ALL_NODES='recurse(.nodes[]?, .floating_nodes[]?) | select(.pid and .visible)'
WINDOW_NAME='(.app_id // .window_properties.class)'
ID_PREFIX='"\(.id):"'
WINDOW_PROTOCOL='(if .shell == "xwayland" then "X11" else "wayland" end)'
WINDOW_GEOMETRY='(.rect | "\(.x),\(.y) \(.width)x\(.height) ")'
WINDOW_PID='(.pid | tostring)'
# Output format, e.g. "1234 - 12:firefox (wayland)" or "5678 - 17:discord (X11)"
FORMAT="$WINDOW_PID + \" - \" + $ID_PREFIX + $WINDOW_NAME + \" (\" + $WINDOW_PROTOCOL + \")\""
FILT="$ALL_NODES | $WINDOW_GEOMETRY + $FORMAT"
function getprop() {
typeset -A views
local selected
while read POS GEOM INFO; do
views["$POS $GEOM"]="$INFO"
done
selected="$(printf "%s\n" "${!views[@]}" | slurp)"
if [[ -n "$selected" ]]; then
printf '%s\n' "${views[${selected}]}"
fi
}
if [[ "$1" == "wait" ]]; then
swaymsg -t subscribe '["workspace"]' | jq -r ".current | $FILT" | getprop
else
swaymsg -t get_tree | jq -r "$FILT" | getprop
fi

View file

@ -54,10 +54,10 @@ gaps inner 10
default_border none default_border none
# border_images.focused /home/chris/.config/sway/rounded_and_shadows_custom.png border_images.focused /home/chris/.config/sway/rounded_and_shadows_custom.png
# border_images.focused_inactive /home/chris/.config/sway/rounded_and_shadows_custom.png border_images.focused_inactive /home/chris/.config/sway/rounded_and_shadows_custom.png
# border_images.unfocused /home/chris/.config/sway/rounded_and_shadows_custom.png border_images.unfocused /home/chris/.config/sway/rounded_and_shadows_custom.png
# border_images.urgent /home/chris/.config/sway/rounded_and_shadows_custom.png border_images.urgent /home/chris/.config/sway/rounded_and_shadows_custom.png
font pango: VictorMono Nerd Font 10 font pango: VictorMono Nerd Font 10
show_marks yes show_marks yes
@ -253,6 +253,8 @@ bar {
workspace_buttons yes workspace_buttons yes
} }
workspace 9 output DP-4
workspace 3 output eDP-1
for_window [title="org-agenda"] floating enable, move scratchpad for_window [title="org-agenda"] floating enable, move scratchpad
for_window [app_id="mpv"] floating enable for_window [app_id="mpv"] floating enable
@ -262,9 +264,13 @@ for_window [app_id="pulsemixer"] floating enable
for_window [app_id="__focused__"] opacity set 1 for_window [app_id="__focused__"] opacity set 1
for_window [app_id="qutebrowser"] move container to workspace number 2, opacity set 1 for_window [app_id="qutebrowser"] move container to workspace number 2, opacity set 1
for_window [app_id="nyxt"] move container to workspace number 2, opacity set 1 for_window [app_id="nyxt"] move container to workspace number 2, opacity set 1
for_window [title="Display Window"] move container to workspace number 9, fullscreen enable, move workspace to output right for_window [title="Display Window"] move window to workspace number 9, fullscreen enable
for_window [title="OpenLP"] move window to workspace number 9, floating enable
for_window [title="VLC media player"] move window to workspace number 9, fullscreen enable
# for_window [app_id="emacs"] opacity set 0.90 # for_window [app_id="emacs"] opacity set 0.90
focus_follows_mouse no
### Locking screen ### Locking screen
bindsym $mod+Ctrl+l exec swaylock-blur --blur-sigma 80 bindsym $mod+Ctrl+l exec swaylock-blur --blur-sigma 80

View file

@ -4,7 +4,7 @@
"height": 30, // Waybar height (to be removed for auto height) "height": 30, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width // "width": 1280, // Waybar width
// Choose the order of the modules "custom/wintitle", // Choose the order of the modules "custom/wintitle",
"modules-left": ["sway/workspaces", "river/tags", "custom/wintitle", "sway/mode", "sway/window"], "modules-left": ["sway/workspaces", "river/tags", "sway/mode", "sway/window"],
"modules-center": ["clock"], "modules-center": ["clock"],
"modules-right": ["pulseaudio", "network", "memory", "cpu", "battery", "battery#bat2", "tray"], "modules-right": ["pulseaudio", "network", "memory", "cpu", "battery", "battery#bat2", "tray"],
"margin-top": 0, "margin-top": 0,