Introduce new Dracula-based fluorescence theme

This commit is contained in:
Henrik Lissner 2020-02-09 03:03:58 -05:00
parent a33c346afc
commit f044edddb6
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
42 changed files with 1292 additions and 121 deletions

View file

@ -1,44 +0,0 @@
#!/usr/bin/env bash
# bspc-focus
# Jump to the next window in a direction. If -m is supplied, jump to the next
# monitor in that direction.
#
# Makes switching nodes more intuitive.
#
# Usage: bspc-focus [-m] (west|south|north|east)
# Example:
# + bspc-focus south
# + bspc-focus -m west
set -e
leap=
if [[ $1 == -m ]]; then
leap=1; shift
fi
dir=$1
opposite=
case $dir in
west) opposite=east ;;
east) opposite=west ;;
north) opposite=north ;;
south) opposite=south ;;
*) >&2 echo "Not a valid direction: $dir"
exit 1
esac
if [[ -n $leap ]]; then
# jump to monitor in direction
bspc monitor -f "$dir"
else
# jump to window in direction (unless at edge of last monitor)
if ! bspc node -f "$dir.local"; then
if [[ $(bspc query -M -m "$dir") ]]; then
bspc monitor -f "$dir"
# Ensure we start at the edge of the window we arrived from
while bspc node -f "$opposite.local"; do :; done
fi
fi
fi

47
bin/bspwm/focus Executable file
View file

@ -0,0 +1,47 @@
#!/usr/bin/env bash
# Script: bspc-focus
# Author: Henrik Lissner
# Usage:
# bspc-focus [-m] (west|south|north|east)
# bspc-focus south
# bspc-focus -m west
#
# Focus the next window in direction. If -m is supplied, jump to the next
# monitor in that direction.
#
# The behavior of the base 'bspc node -f' is odd when crossing screens. It will
# focus the last selected window on that screen, rather than the window on the
# connecting edge, which is unintuitive.
set -e
leap=
if [[ $1 == -m ]]; then
leap=1; shift
fi
dir=$1
opposite=
case $dir in
west) opposite=east ;;
east) opposite=west ;;
north) opposite=north ;;
south) opposite=south ;;
*) >&2 echo "Not a valid direction: $dir"
exit 1
esac
if [[ -n $leap ]]; then
# jump to monitor in direction
bspc monitor -f "$dir"
else
# jump to window in direction (unless at edge of last monitor)
if ! bspc node -f "$dir.local"; then
if [[ $(bspc query -M -m "$dir") ]]; then
bspc monitor -f "$dir"
# Ensure we start at the edge of the window we arrived from
while bspc node -f "$opposite.local"; do :; done
fi
fi
fi

22
bin/bspwm/presel Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env cached-nix-shell
#! nix-shell -i zsh -p jshon
# Script: bspc-presel
# Author: Henrik Lissner
# Usage:
# bspc-presel RATIO
# bspc-presel 0.2
#
# Wrote this to invert the ratio on east/south-bound preselections. In English
# that means bspc node -p 0.2 should resize the preselection to 20%, whether or
# not it's on the west or east side of the window (or north or south side),
# which isn't the case by default.
#
# NOTE: We use zsh for this because bash chokes on float arithmetic.
shift # nix-shell passes script path as $1
ratio="$1"
case "$(bspc query -T -n focused | jshon -e presel -e splitDir | tr -d \")" in
west|north) bspc node -o $ratio ;;
east|south) bspc node -o $(( 1.0 - ratio )) ;;
esac

101
bin/bspwm/subtract-presel Executable file
View file

@ -0,0 +1,101 @@
#!/usr/bin/env cached-nix-shell
#! nix-shell -i zsh -p jshon wmutils-core
# Script: bspc-subtract-presel
# Author: Henrik Lissner (w/ credit to @Chrysostomus)
# Usage:
# bspc-resize-to-presel
#
# (Adapted from Chrysostomus/bspwm-scripts/bin/resizetopresel.sh)
#
# This script resizes the current window by "subtracting" the bspwm preselection
# on the current node. In English, that means this will reduce the window's
# width by 20%:
#
# bspc node -p east -o 0.2 && bspc-subtract-presel
#
# NOTE: We use zsh for this because bash chokes on float arithmetic.
# Check if the brother node is a receptacle
if [[ $(bspc query -T -n @brother/ | jshon -e client) = null ]]; then
# Yep, it's a receptacle. Get the real dimensions
eval $(grep "window_gap" ~/.config/bspwm/rc.d/theme | tr -cd [0-9])
# Get orientation
wattr xywh $(pfw) | read focused_x focused_y focused_width focused_height
receptacle_y=$(bspc query -T -n @brother/ | jshon -e rectangle -e y)
if [[ "$focused_y" -eq "$receptacle_y" ]]; then
receptacle_width=$(bspc query -T -n @brother/ | jshon -e rectangle -e width)
receptacle_x=$(bspc query -T -n @brother/ | jshon -e rectangle -e x)
# receptacle and window have the same height, so they are side by side
if [[ receptacle_x -gt focused_x ]]; then
echo "receptacle is right of the window"
# get the true window dimension
true_dim=$(( receptacle_width + gap ))
# kill the repectacle
for i in $(bspc query -N -n .leaf.!window.local); do bspc node $i -k; done
# resize the window
bspc node @east -r -$true_dim || bspc node @west -r +$true_dim
else
echo "receptacle is left of the window"
# get the true window dimension
true_dim=$(( receptacle_width + gap ))
# kill the repectacle
for i in $(bspc query -N -n .leaf.!window.local); do bspc node $i -k; done
# resize the window
bspc node @west -r +$true_dim || bspc node @east -r -$true_dim
fi
else
receptacle_height=$(bspc query -T -n @brother/ | jshon -e rectangle -e height)
# width is necessarily equal if height is not, because the nodes are
# brothers Window are on the top of each other
if [[ receptacle_y -gt focused_y ]]; then
echo "receptacle is below the window"
# get the true window dimension
true_dim=$(( receptacle_height + gap))
# kill the repectacle
for i in $(bspc query -N -n .leaf.!window.local); do bspc node $i -k; done
# resize the window
bspc node @south -r -$true_dim || bspc node @north -r +$true_dim
else
echo "receptacle is above the window"
# get the true window dimension
true_dim=$(( receptacle_height + gap))
# kill the repectacle
for i in $(bspc query -N -n .leaf.!window.local); do bspc node $i -k; done
# resize the window
bspc node @north -r +$true_dim || bspc node @south -r -$true_dim
fi
fi
echo $true_dim
exit 0
fi
# If the focused window is not preselected, do nothing
[[ "$(bspc query -T -n focused | jshon -e presel)" == null ]] && exit 0
dir=$(bspc query -T -n focused | jshon -e presel -e splitDir | tr -d \")
ratio=$(bspc query -T -n focused | jshon -e presel -e splitRatio)
case "$dir" in
west)
cur=$(bspc query -T -n focused | jshon -e rectangle -e width)
bspc node @west -r +$((${cur}*${ratio})) || \
bspc node @east -r -$((${cur}*${ratio}))
;;
east)
cur=$(bspc query -T -n focused | jshon -e rectangle -e width)
bspc node @east -r -$((${cur}*(1.0-${ratio}))) || \
bspc node @west -r +$((${cur}*${ratio}))
;;
north)
cur=$(bspc query -T -n focused | jshon -e rectangle -e height)
bspc node @north -r +$((${cur}*${ratio})) || \
bspc node @south -r -$((${cur}*${ratio}))
;;
south)
cur=$(bspc query -T -n focused | jshon -e rectangle -e height)
bspc node @south -r -$(( ${cur} * (1.0 - ${ratio}) )) || \
bspc node @north -r +$(( ${cur} * ${ratio} ))
esac
bspc node -p cancel

View file

@ -1,15 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# bspc-swap # Script: bspc-swap
# swaps current window with the next window in a direction. If -m is set, moves # Author: Henrik Lissner
# window to the next monitor in that direction. # Usage:
# bspc-swap [-m] (west|south|north|east)
# bspc-swap south
# bspc-swap -m west
# #
# Makes swapping nodes more intuitive. # Swaps current window with the window in a direction. If -m is set, move window
# to the next monitor in that direction.
# #
# Usage: bspc-swap (west|south|north|east) (1|0) # The behavior of the base 'bspc node -s' is odd when crossing screens. It will
# Example: # swaps with the last selected window on that screen, rather than the window on
# + bspc-swap south # the connecting edge, which is unintuitive.
# + bspc-swap -m west
set -e set -e

View file

@ -1,6 +1,5 @@
#!/usr/bin/env sh #!/usr/bin/env sh
rofi -show drun \ rofi -show drun \
-modi drun,run \ -modi drun,run \
-display-drun apps \
-show-icons \ -show-icons \
-theme theme/appmenu.rasi -theme theme/appmenu.rasi

View file

@ -5,7 +5,7 @@
# #
# requires: sqlite3 # requires: sqlite3
ROFI_CMD='rofi -dmenu -theme theme/browsermenu.rasi -columns 1 -markup-rows -multi-select -p browser -i' ROFI_CMD='rofi -dmenu -theme theme/bookmarkmenu.rasi -columns 1 -markup-rows -multi-select -p browser -i'
SEP=${1:-'{{::}}'} SEP=${1:-'{{::}}'}
_do_rofi() { _do_rofi() {
@ -28,20 +28,20 @@ case ${BROWSER:-firefox} in
# The db can be locked from time to time. This is inefficient, but # The db can be locked from time to time. This is inefficient, but
# places.sqlite is usually under 30mb so this should be instant, and # places.sqlite is usually under 30mb so this should be instant, and
# /tmp is cleared at boot so... # /tmp is cleared at boot so...
# if ! find /tmp/rofi-browsermenu -mmin +60 2>&1 >/dev/null; then # if ! find /tmp/rofi-bookmarkmenu -mmin +60 2>&1 >/dev/null; then
cp "$dir/places.sqlite" "/tmp/places.sqlite" cp "$dir/places.sqlite" "/tmp/places.sqlite"
sqlite3 -separator $SEP "/tmp/places.sqlite" \ # sqlite3 -separator $SEP "/tmp/places.sqlite" \
"SELECT DISTINCT title, url FROM moz_places \ # "SELECT DISTINCT title, url FROM moz_places \
WHERE title IS NOT NULL \ # WHERE title IS NOT NULL \
ORDER BY last_visit_date DESC" >/tmp/rofi-browsermenu # ORDER BY last_visit_date DESC" >/tmp/rofi-bookmarkmenu
sqlite3 -separator $SEP "/tmp/places.sqlite" \ sqlite3 -separator $SEP "/tmp/places.sqlite" \
"SELECT DISTINCT mb.title, mp.url FROM moz_bookmarks mb \ "SELECT DISTINCT mb.title, mp.url FROM moz_bookmarks mb \
INNER JOIN moz_places mp ON mp.id = mb.fk \ INNER JOIN moz_places mp ON mp.id = mb.fk \
WHERE mb.type = 1 AND mb.title IS NOT NULL \ WHERE mb.type = 1 AND mb.title IS NOT NULL \
ORDER BY mp.frecency DESC \ ORDER BY mp.frecency DESC \
LIMIT 200" >>/tmp/rofi-browsermenu LIMIT 200" >>/tmp/rofi-bookmarkmenu
# fi # fi
cat /tmp/rofi-browsermenu | sed -e 's#&#&amp;#g' -e 's#<#&lt;#g' -e 's#>#&gt;#g' | _do_rofi cat /tmp/rofi-bookmarkmenu | sed -e 's#&#&amp;#g' -e 's#<#&lt;#g' -e 's#>#&gt;#g' | _do_rofi
break break
fi fi
done done
@ -49,11 +49,11 @@ case ${BROWSER:-firefox} in
qutebrowser) qutebrowser)
{ {
sed -e 's/ /{{::}}/' urls | awk -F'{{::}}' '{printf "%s{{::}}%s\n", $2, $1}' sed -e 's/ /{{::}}/' urls | awk -F'{{::}}' '{printf "%s{{::}}%s\n", $2, $1}'
sqlite3 -separator $SEP "$XDG_DATA_HOME/qutebrowser/history.sqlite" \ # sqlite3 -separator $SEP "$XDG_DATA_HOME/qutebrowser/history.sqlite" \
"SELECT title, url FROM History \ # "SELECT title, url FROM History \
WHERE title != '' \ # WHERE title != '' \
GROUP BY url \ # GROUP BY url \
ORDER BY atime DESC" # ORDER BY atime DESC"
} | _do_rofi } | _do_rofi
;; ;;
*) rofi -e "No known browser" ;; *) rofi -e "No known browser" ;;

View file

@ -1,5 +1,6 @@
#!/usr/bin/env sh #!/usr/bin/env sh
DIR="$(fd -L --type d . $HOME | rofi -dmenu -i -p files -columns 1 -theme theme/appmenu.rasi)" cd $HOME
DIR="$(fd -L -d 4 --type d . | rofi -dmenu -i -p "~/" -theme theme/filemenu.rasi)"
if [ -d "$DIR" ]; then if [ -d "$DIR" ]; then
cd "$DIR" cd "$DIR"
if [[ $1 == "-x" ]]; then if [[ $1 == "-x" ]]; then

0
bin/rofi/networkmenu Normal file
View file

View file

@ -6,10 +6,11 @@
# Example: passmenu [RESUME] # Example: passmenu [RESUME]
ROFI_CMD='rofi -dmenu -theme theme/passmenu.rasi' ROFI_CMD='rofi -dmenu -theme theme/passmenu.rasi'
ROFI_MSG_CMD='rofi -theme theme/passmenu.rasi -markup -e'
set -e set -e
shopt -s nullglob globstar shopt -s nullglob globstar
for prog in xclip notify-send pass; do for prog in xclip pass; do
if ! command -v "$prog" >/dev/null; then if ! command -v "$prog" >/dev/null; then
>&2 echo "$prog not installed, aborting" >&2 echo "$prog not installed, aborting"
exit 1 exit 1
@ -42,11 +43,11 @@ else
password_files=( "$prefix"/**/*.gpg ) password_files=( "$prefix"/**/*.gpg )
password_files=( "${password_files[@]#"$prefix"/}" ) password_files=( "${password_files[@]#"$prefix"/}" )
password_files=( "${password_files[@]%.gpg}" ) password_files=( "${password_files[@]%.gpg}" )
entry=$(printf "%s\n" "${password_files[@]}" | $ROFI_CMD -p pass -filter "$url") entry=$(printf "%s\n" "${password_files[@]}" | $ROFI_CMD -p "..." -filter "$url")
fi fi
if [[ -z $entry ]]; then if [[ -z $entry ]]; then
notify-send --urgency=critical "Failed to select $entry" $ROFI_MSG_CMD "<span foreground="red">Failed to select $entry</span>"
exit 1 exit 1
fi fi
@ -54,14 +55,14 @@ echo "$entry" >/tmp/_upm
secrets="$(pass show "$entry")" secrets="$(pass show "$entry")"
if [[ -n $secrets ]]; then if [[ -n $secrets ]]; then
fields=$(awk -F': ' 'NR>1 && !/^otpauth:/ {print $1}' <<<"$secrets") fields=$(awk -F': ' 'NR>1 && !/^otpauth:/ {print $1}' <<<"$secrets")
field=$(printf "password\n%s\notp\n" "${fields[@]}" | $ROFI_CMD -p "pass ($entry) > ") field=$(printf "password\n%s\notp\n" "${fields[@]}" | $ROFI_CMD -p "$entry")
case $field in case $field in
password) pass -c "$entry" ;; password) pass -c "$entry" ;;
otp) printf "%s" "$(pass otp -c "$entry")" ;; otp) printf "%s" "$(pass otp -c "$entry")" ;;
*) printf "%s" "$(awk -v "key=$field:" '$1 == key {print $2}' <<<"$secrets")" | xclip -selection clipboard -in ;; *) printf "%s" "$(awk -v "key=$field:" '$1 == key {print $2}' <<<"$secrets")" | xclip -selection clipboard -in ;;
esac esac
notify-send --urgency=low "<b>$entry/$field</b>" "Copied to clipboard for 45s" $ROFI_MSG_CMD "Copied <b>$entry/$field</b> to clipboard for 45s"
else else
notify-send --urgency=critical "Failed to retrieve $entry" $ROFI_MSG_CMD "<span foreground="red">Failed to retrieve $entry</span>"
exit 2 exit 2
fi fi

31
bin/rofi/powermenu Executable file
View file

@ -0,0 +1,31 @@
#!/usr/bin/env sh
rofi_command="rofi -theme theme/powermenu.rasi"
### Options ###
power_off="\tShutdown"
reboot="\tReboot"
lock="\tLock"
suspend="鈴\tSleep"
log_out="\tLogout"
# Variable passed to rofi
options="$power_off\n$reboot\n$lock\n$suspend\n$log_out"
case "$(echo -e "$options" | $rofi_command -dmenu -selected-row 2)" in
$power_off)
systemctl poweroff
;;
$reboot)
systemctl reboot
;;
$lock)
zzz
;;
$suspend)
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause
systemctl suspend
;;
$log_out)
bspc quit
;;
esac

View file

@ -1,2 +0,0 @@
#!/usr/bin/env sh
rofi -show window -show-icons -theme theme/windowmenu.rasi

0
bin/rofi/spotifymenu Normal file
View file

4
bin/rofi/windowmenu Executable file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env sh
rofi -show window \
-show-icons \
-theme theme/windowmenu.rasi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
SCRID=scratch SCRID=scratch
CMD='tmux new-session -A -s scratch -n scratch' CMD=${1:-'tmux new-session -A -s scratch -n scratch'}
focused=$(xdotool getactivewindow) focused=$(xdotool getactivewindow)
scratch=$(xdotool search --onlyvisible --classname $SCRID) scratch=$(xdotool search --onlyvisible --classname $SCRID)
if [[ -n $scratch ]]; then if [[ -n $scratch ]]; then
@ -12,16 +12,13 @@ if [[ -n $scratch ]]; then
fi fi
elif command -v alacritty >/dev/null; then elif command -v alacritty >/dev/null; then
alacritty --class $SCRID \ alacritty --class $SCRID \
-d 90 26 \
-e $SHELL -c "$CMD" -e $SHELL -c "$CMD"
elif command -v urxvt >/dev/null; then elif command -v urxvt >/dev/null; then
urxvt -name $SCRID \ urxvt -name $SCRID \
-geometry 100x26 \
-e $SHELL -c "$CMD" -e $SHELL -c "$CMD"
elif command -v xst >/dev/null; then elif command -v xst >/dev/null; then
xst -t $SCRID -n $SCRID -c $SCRID \ xst -t $SCRID -n $SCRID -c $SCRID \
-f "$(xrdb -query | grep 'scratch\.font' | cut -f2)" \ -f "$(xrdb -query | grep 'scratch\.font' | cut -f2)" \
-g 100x26 \
-e $SHELL -c "$CMD" -e $SHELL -c "$CMD"
else else
>&2 echo "No shell to launch the scratch terminal with" >&2 echo "No shell to launch the scratch terminal with"

View file

@ -1,11 +1,11 @@
#!/bin/sh #!/usr/bin/env bash
export MONITOR=$(xrandr -q | grep primary | cut -d' ' -f1) export MONITOR=$(xrandr -q | grep primary | cut -d' ' -f1)
export MONITORS=( $(xrandr -q | grep ' connected' | cut -d' ' -f1) ) export MONITORS=( $(xrandr -q | grep ' connected' | cut -d' ' -f1) )
MONITOR=${MONITOR:-${MONITORS[0]}} MONITOR=${MONITOR:-${MONITORS[0]}}
# Only have workspaces for primary monitor # Only have workspaces for primary monitor
bspc monitor $MONITOR -d {1,2,3,4,5} bspc monitor $MONITOR -d {1,2,3,4,5,6}
bspc config remove_disabled_monitors true bspc config remove_disabled_monitors true
bspc config remove_unplugged_monitors true bspc config remove_unplugged_monitors true
@ -15,14 +15,12 @@ bspc config remove_unplugged_monitors true
bspc rule -r '*' bspc rule -r '*'
bspc rule -a Pinentry state=floating center=on bspc rule -a Pinentry state=floating center=on
bspc rule -a Emacs split_ratio=0.28 state=fullscreen border=off bspc rule -a Emacs split_ratio=0.28 state=tiled
bspc rule -a xst-256color border=off
bspc rule -a Firefox split_ratio=0.32 bspc rule -a Firefox split_ratio=0.32
bspc rule -a feh state=fullscreen bspc rule -a feh state=fullscreen
bspc rule -a 'Emacs:org*' state=floating bspc rule -a 'Emacs:org*' state=floating
bspc rule -a 'Emacs:scratch' state=floating bspc rule -a 'Emacs:scratch' state=floating
bspc rule -a '*:scratch' state=floating sticky=on center=on bspc rule -a '*:scratch' state=floating sticky=on center=on border=off rectangle=1000x600+0+0
# #
for file in $XDG_CONFIG_HOME/bspwm/rc.d/*; do for file in $XDG_CONFIG_HOME/bspwm/rc.d/*; do

View file

@ -10,19 +10,12 @@ super + t
super + apostrophe super + apostrophe
bspc window -s last bspc window -s last
# focus/swap the node in the given direction
super + {_,ctrl +}{h,j,k,l}
bspc-focus {_,-m }{west,south,north,east}
super + shift + {_,ctrl +}{h,j,k,l}
bspc-swap {_,-m }{west,south,north,east}
super + {_,shift +}{1-9,0}
bspc {desktop -f,node -d} {1-9,10}
super + Return super + Return
xst -e bash -c "tmux new || tmux attach" xst -e bash -c "tmux new || tmux attach"
ctrl + super + Return
xst
super + grave super + grave
scratch scratch
@ -30,13 +23,16 @@ super + shift + grave
emacsclient -e '(open-scratch-frame)' emacsclient -e '(open-scratch-frame)'
super + space super + space
rofi-appmenu ~/.dotfiles/bin/rofi/appmenu
super + Tab super + Tab
rofi-windowmenu ~/.dotfiles/bin/rofi/windowmenu
super + backslash super + backslash
rofi-passmenu ~/.dotfiles/bin/rofi/passmenu
super + slash
~/.dotfiles/bin/rofi/filemenu -x
super + Escape super + Escape
pkill -USR1 -x sxhkd pkill -USR1 -x sxhkd
@ -48,11 +44,47 @@ super + Escape
# #
## ##
# Toggle floating/fullscreen ## Toggle floating/fullscreen
super + {_,ctrl + }f super + {_,ctrl + }f
bspc node -t ~{floating,fullscreen} bspc node -t ~{floating,fullscreen}
super + {_,ctrl +}{h,j,k,l}
~/.dotfiles/bin/bspwm/focus {_,-m }{west,south,north,east}
super + shift + {_,ctrl +}{h,j,k,l}
~/.dotfiles/bin/bspwm/swap {_,-m }{west,south,north,east}
## Resize by preselection
super + alt + {1-9}
~/.dotfiles/bin/bspwm/presel 0.{1-9}
super + alt + {h,j,k,l}
bspc node -p {west,south,north,east}
super + alt + Return
~/.dotfiles/bin/bspwm/subtract-presel
super + alt + Delete
bspc node -p cancel
super + {_,shift +}{1-9,0}
bspc {desktop -f,node -d} {1-9,10};
# expand a window by moving one of its side outward
super + {Left,Down,Up,Right}
bspc node -z {left -40 0,bottom 0 40,top 0 -40,right 40 0}
# contract a window by moving one of its side inward
super + ctrl + {Left,Down,Up,Right}
bspc node -z {right -40 0,top 0 40,bottom 0 -40,left 40 0}
# move a floating window
super + shift + {Left,Down,Up,Right}
bspc node -v {-40 0,0 40,0 -40,40 0}
# #
## Media keys ## Media keys
@ -61,10 +93,10 @@ Print
scrcap scrcap
# screencast region to mp4 # screencast region to mp4
super + Print super + Print
scrrec -s ~/shared/$(date +%F-%T).mp4 scrrec -s ~/recordings/$(date +%F-%T).mp4
# screencast region to gif # screencast region to gif
super + ctrl + Print super + ctrl + Print
scrrec -s ~/shared/$(date +%F-%T).gif scrrec -s ~/recordings/$(date +%F-%T).gif
XF86MonBrightnessUp XF86MonBrightnessUp
light -A 5 light -A 5

View file

@ -32,7 +32,7 @@
## Services ## Services
<modules/services/syncthing.nix> <modules/services/syncthing.nix>
## Theme ## Theme
<modules/themes/aquanaut> <modules/themes/fluorescence>
]; ];
networking.networkmanager.enable = true; networking.networkmanager.enable = true;

View file

@ -2,7 +2,6 @@
{ {
my = { my = {
env.PATH = [ <bin/rofi> ];
# link recursively so other modules can link files in its folder # link recursively so other modules can link files in its folder
home.xdg.configFile."rofi" = { home.xdg.configFile."rofi" = {
source = <config/rofi>; source = <config/rofi>;
@ -17,22 +16,22 @@
# Fake rofi dmenu entries # Fake rofi dmenu entries
(makeDesktopItem { (makeDesktopItem {
name = "rofi-browsermenu"; name = "rofi-bookmarkmenu";
desktopName = "Open Bookmark in Browser"; desktopName = "Open Bookmark in Browser";
icon = "bookmark-new-symbolic"; icon = "bookmark-new-symbolic";
exec = "${<config/rofi>}/bin/rofi-browsermenu"; exec = "${<bin/rofi/bookmarkmenu>}";
}) })
(makeDesktopItem { (makeDesktopItem {
name = "rofi-filemenu"; name = "rofi-filemenu";
desktopName = "Open Directory in Terminal"; desktopName = "Open Directory in Terminal";
icon = "folder"; icon = "folder";
exec = "${<config/rofi>}/bin/rofi-filemenu"; exec = "${<bin/rofi/filemenu>}";
}) })
(makeDesktopItem { (makeDesktopItem {
name = "rofi-filemenu-scratch"; name = "rofi-filemenu-scratch";
desktopName = "Open Directory in Scratch Terminal"; desktopName = "Open Directory in Scratch Terminal";
icon = "folder"; icon = "folder";
exec = "${<config/rofi>}/bin/rofi-filemenu -x"; exec = "${<bin/rofi/filemenu>} -x";
}) })
(makeDesktopItem { (makeDesktopItem {

View file

@ -25,15 +25,12 @@
}; };
}; };
my = { my.home.xdg.configFile = {
env.PATH = [ <bin/bspwm> ]; "sxhkd".source = <config/sxhkd>;
home.xdg.configFile = { # link recursively so other modules can link files in their folders
"sxhkd".source = <config/sxhkd>; "bspwm" = {
# link recursively so other modules can link files in their folders source = <config/bspwm>;
"bspwm" = { recursive = true;
source = <config/bspwm>;
recursive = true;
};
}; };
}; };
} }

View file

@ -5,8 +5,11 @@
## Desktop apps ## Desktop apps
./apps/redshift.nix ./apps/redshift.nix
./apps/rofi.nix # My launcher ./apps/rofi.nix # My launcher
./apps/thunar.nix # I often need a thumbnail browser to show off, peruse
# or organize photos, design work, or digital art. # I often need a thumbnail browser to show off, peruse or organize photos,
# design work, or digital art.
# ./apps/nautilus.nix
./apps/thunar.nix
## Terminal ## Terminal
# ./apps/alacritty.nix # ./apps/alacritty.nix
@ -28,6 +31,13 @@
xclip xclip
xdotool xdotool
libqalculate # calculator cli w/ currency conversion libqalculate # calculator cli w/ currency conversion
(makeDesktopItem {
name = "scratch-calc";
desktopName = "Calculator";
icon = "calc";
exec = "scratch '${tmux}/bin/tmux new-session -s calc -n calc qalc'";
categories = "Development";
})
]; ];
## Sound ## Sound
@ -59,8 +69,8 @@
backend = "glx"; backend = "glx";
vSync = true; vSync = true;
opacityRules = [ opacityRules = [
"100:class_g = 'Firefox'" # "100:class_g = 'Firefox'"
"100:class_g = 'Vivaldi-stable'" # "100:class_g = 'Vivaldi-stable'"
"100:class_g = 'VirtualBox Machine'" "100:class_g = 'VirtualBox Machine'"
# Art/image programs where we need fidelity # Art/image programs where we need fidelity
"100:class_g = 'Gimp'" "100:class_g = 'Gimp'"
@ -69,10 +79,18 @@
"100:class_g = 'krita'" "100:class_g = 'krita'"
"100:class_g = 'feh'" "100:class_g = 'feh'"
"100:class_g = 'mpv'" "100:class_g = 'mpv'"
"100:class_g = 'Rofi'"
"100:class_g = 'Peek'"
"99:_NET_WM_STATE@:32a = '_NET_WM_STATE_FULLSCREEN'"
];
shadowExclude = [
# Put shadows on notifications, the scratch popup and rofi only
"! name~='(scratch|Dunst)$'"
]; ];
settings.blur-background-exclude = [ settings.blur-background-exclude = [
"window_type = 'dock'" "window_type = 'dock'"
"window_type = 'desktop'" "window_type = 'desktop'"
"class_g = 'Rofi'"
"_GTK_FRAME_EXTENTS@:c" "_GTK_FRAME_EXTENTS@:c"
]; ];
}; };

View file

View file

@ -0,0 +1,79 @@
!! Colors
#define blk #1E2029
#define bblk #282a36
#define red #ffb86c
#define bred #de935f
#define grn #50fa7b
#define bgrn #0189cc
#define ylw #f0c674
#define bylw #f9a03f
#define blu #61bfff
#define bblu #8be9fd
#define mag #bd93f9
#define bmag #ff79c6
#define cyn #8be9fd
#define bcyn #0189cc
#define wht #f8f8f2
#define bwht #e2e2dc
#define bg blk
#define fg wht
*.foreground: fg
*.background: bg
*.cursorColor: mag
*.color0: blk
*.color8: bblk
*.color1: red
*.color9: bred
*.color2: grn
*.color10: bgrn
*.color3: ylw
*.color11: bylw
*.color4: blu
*.color12: bblu
*.color5: mag
*.color13: bmag
*.color6: cyn
*.color14: bcyn
*.color7: wht
*.color15: bwht
! greys
*.color234: #1E2029
*.color235: #282a36
*.color236: #373844
*.color237: #44475a
*.color239: #565761
*.color240: #6272a4
*.color241: #b6b6b2
!! general
scratch.font: Fira Code:pixelsize=16
!! xst
st.font: Fira Code:pixelsize=12
!! urxvt
URxvt*depth: 32
URxvt*.background: blk
URxvt*.borderless: 1
URxvt*.buffered: true
URxvt*.cursorBlink: true
URxvt*.font: xft:Fira Code:pixelsize=12
URxvt*.internalBorder: 10
URxvt*.letterSpace: 0
URxvt*.lineSpace: 0
URxvt*.loginShell: false
URxvt*.matcher.button: 1
URxvt*.matcher.rend.0: Uline Bold fg5
URxvt*.saveLines: 5000
URxvt*.scrollBar: false
URxvt*.underlineColor: grey
URxvt.clipboard.autocopy: true
URxvt.iso14755: false
URxvt.iso14755_52: false
URxvt.perl-ext-common: default,matcher

View file

@ -0,0 +1,16 @@
#!/usr/bin/env sh
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config border_width 1
bspc config window_gap 0
bspc config normal_border_color "#181a23"
bspc config active_border_color "#181a23"
bspc config focused_border_color "#bd93f9"
bspc config presel_feedback_color "#bd93f9"
# Extra padding for polybar
bspc config -m primary top_padding 0
bspc config -m primary bottom_padding 34

View file

@ -0,0 +1,75 @@
# modules/themes/aquanaut/default.nix --- a sea-blue linux theme
{ config, lib, pkgs, ... }:
{
imports = [ ../. ]; # Load framework for themes
theme.wallpaper = ./wallpaper.png;
services.compton = {
fade = true;
fadeDelta = 1;
fadeSteps = [ "0.01" "0.012" ];
shadow = true;
shadowOffsets = [ (-10) (-10) ];
shadowOpacity = "0.22";
# activeOpacity = "1.00";
# inactiveOpacity = "0.92";
settings = {
shadow-radius = 12;
# blur-background = true;
# blur-background-frame = true;
# blur-background-fixed = true;
blur-kern = "7x7box";
blur-strength = 320;
};
};
services.xserver.displayManager.lightdm = {
greeters.mini.extraConfig = ''
text-color = "#ff79c6"
password-background-color = "#1E2029"
window-color = "#181a23"
border-color = "#181a23"
'';
};
fonts.fonts = [ pkgs.nerdfonts ];
my.packages = with pkgs; [
my.ant-dracula
paper-icon-theme # for rofi
];
my.zsh.rc = lib.readFile ./zsh/prompt.zsh;
my.home.xdg.configFile = {
"bspwm/rc.d/polybar".source = ./polybar/run.sh;
"bspwm/rc.d/theme".source = ./bspwmrc;
"dunst/dunstrc".source = ./dunstrc;
"polybar" = { source = ./polybar; recursive = true; };
"rofi/theme" = { source = ./rofi; recursive = true; };
"tmux/theme".source = ./tmux.conf;
"xtheme/90-theme".source = ./Xresources;
# GTK
"gtk-3.0/settings.ini".text = ''
[Settings]
gtk-theme-name=Ant-Dracula
gtk-icon-theme-name=Paper
gtk-fallback-icon-theme=gnome
gtk-application-prefer-dark-theme=true
gtk-cursor-theme-name=Paper
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull
gtk-xft-rgba=none
'';
# GTK2 global theme (widget and icon theme)
"gtk-2.0/gtkrc".text = ''
gtk-theme-name="Ant-Dracula"
gtk-icon-theme-name="Paper-Mono-Dark"
gtk-font-name="Sans 10"
'';
# QT4/5 global theme
"Trolltech.conf".text = ''
[Qt]
style=Ant-Dracula
'';
};
}

View file

@ -0,0 +1,49 @@
[global]
alignment = left
bounce_freq = 0
browser = firefox -new-tab
corner_radius = 2
dmenu = rofi -dmenu -p dunst:
follow = none
font = Fira Sans 11
format = "<b>%s</b>\n%b"
frame_color = "#1a1c25"
frame_width = 1
# geometry [{width}]x{height}][+/-{x}+/-{y}]
geometry = "440x15-22+58"
history_length = 20
horizontal_padding = 16
icon_position = right
idle_threshold = 120
ignore_newline = no
indicate_hidden = yes
line_height = 0
markup = full
max_icon_size = 64
monitor = 0
padding = 20
separator_color = auto
separator_height = 4
show_age_threshold = 60
show_indicators = yes
shrink = no
sort = yes
startup_notification = false
sticky_history = yes
transparency = 5
word_wrap = yes
[urgency_low]
background = "#1E2029"
foreground = "#bbc2cf"
timeout = 8
[urgency_normal]
background = "#2a2d39"
foreground = "#bbc2cf"
timeout = 14
[urgency_critical]
background = "#cc6666"
foreground = "#1E2029"
timeout = 0

View file

@ -0,0 +1,327 @@
[colors]
black = ${xrdb:color0}
bblack = ${xrdb:color8}
red = ${xrdb:color1}
bred = ${xrdb:color9}
green = ${xrdb:color2}
bgreen = ${xrdb:color10}
yellow = ${xrdb:color3}
byellow = ${xrdb:color11}
blue = ${xrdb:color4}
bblue = ${xrdb:color12}
magenta = ${xrdb:color5}
bmagenta = ${xrdb:color13}
cyan = ${xrdb:color6}
bcyan = ${xrdb:color14}
white = ${xrdb:color7}
bwhite = ${xrdb:color15}
bg = ${xrdb:background}
fg = ${colors.magenta}
bg-alt = #1E2029
fg-alt = #373844
bg-dark = #181a23
alert = ${colors.yellow}
accent = #604c7e
[global/wm]
margin-top = 0
margin-bottom = 34
[bar/main]
monitor = ${env:MONITOR}
monitor-strict = true
enable-ipc = true
wm-restack = bspwm
# REQUIRED to move the window with hideit.sh
override-redirect = true
fixed-center = true
background = ${colors.bg}
foreground = ${colors.fg}
width = 100%
height = 34
offset-x = 0
offset-y = 0
bottom = true
overline-size = 0
overline-color = #f00
underline-size = 0
underline-color = #00f
border-bottom-size = 0
border-top-size = 1
border-color = ${colors.bg-dark}
padding-left = 2
padding-right = 2
module-margin-left = 0
module-margin-right = 0
font-0 = "Fira Code:pixelsize=9;2"
font-1 = "Wuncon Siji:pixelsize=12;2"
font-2 = "Siji:pixelsize=10;2"
; modules-left = volume pad cpu memory pad pkg mail
modules-left = pulseaudio pad cpu memory
modules-center = bspwm
modules-right = battery wlan syncthing redshift pad date
;tray-position = center
;tray-padding = 2
;tray-transparent = true
;tray-background = #0063ff
[module/bspwm]
type = internal/bspwm
pin-workspaces = true
enable-click = true
ws-icon-0 = 1;
ws-icon-1 = 2;
ws-icon-2 = 3;
ws-icon-3 = 4;
ws-icon-4 = 5;
ws-icon-5 = 6;
ws-icon-default = x
format = <label-state> <label-mode>
label-padding = 1
label-focused = %icon%
label-focused-background = ${colors.bg-dark}
label-focused-foreground = ${colors.fg}
# label-focused-underline = ${colors.magenta}
; label-focused-foreground = ${xrdb:color2}
label-focused-padding = 1
label-occupied = %icon%
label-occupied-foreground = ${colors.accent}
label-occupied-padding = 1
; label-urgent = %icon%
label-urgent-foreground = ${colors.alert}
; label-urgent-background = ${colors.alert}
label-urgent-padding = 1
label-empty = %icon%
label-empty-foreground = ${colors.fg-alt}
label-empty-padding = 1
[module/date]
type = internal/date
interval = 5
label = %date% %time%
date = %A, %h %d
date-alt = %Y-%m-%d
time = %I:%M %p
time-alt = %H:%M:%S
format-prefix = ""
format-prefix-padding = 1
; format-prefix-background = ${colors.bg-alt}
format-prefix-foreground = ${colors.accent}
; format-underline = ${xrdb:color4}
[module/xwindow]
type = internal/xwindow
label = %title:0:80:...%
label-padding-left = 2
; [module/mpd]
; type = internal/mpd
; host = /home/hlissner/.config/mpd/mpd.sock
;
; format-online = <label-song> <toggle>
; format-padding = 5
;
; label-song-maxlen = 45
; label-song-ellipsis = true
;
; icon-prev = 
; icon-seekb = 
; icon-stop = 
; icon-play = 
; icon-pause = 
; icon-next = 
; icon-seekf = 
;
; icon-random = 
; icon-repeat = 
;
; toggle-on-foreground = ${colors.fg}
; toggle-off-foreground = #66
[module/cpu]
type = internal/cpu
interval = 2
format = <bar-load>
format-prefix = ""
format-foreground = ${colors.accent}
; format-underline = #f90000
; label = %percentage%%
format-padding = 1
bar-load-indicator =
bar-load-width = 6
bar-load-foreground-0 = ${colors.fg}
bar-load-foreground-1 = ${colors.fg}
bar-load-foreground-2 = ${colors.yellow}
bar-load-foreground-3 = ${colors.alert}
bar-load-foreground-4 = ${colors.alert}
bar-load-fill = |
bar-load-empty = ¦
bar-load-empty-foreground = ${colors.fg-alt}
[module/memory]
type = internal/memory
interval = 3
format = <bar-used>
format-prefix = ""
format-prefix-foreground = ${colors.accent}
; format-underline = #4bffdc
; label = %percentage_used%%
format-padding-left = 1
; Only applies if <bar-used> is used
bar-used-indicator =
bar-used-width = 6
bar-used-foreground-0 = ${colors.fg}
bar-used-foreground-1 = ${colors.fg}
bar-used-foreground-2 = ${colors.yellow}
bar-used-foreground-3 = ${colors.alert}
bar-used-foreground-4 = ${colors.alert}
bar-used-fill = |
bar-used-empty = ¦
bar-used-empty-foreground = ${colors.fg-alt}
[module/wlan]
type = internal/network
interface = ${env:WLP:wlp3s0}
interval = 3.0
format-connected = <ramp-signal>
format-disconnected = !
format-disconnected-foreground = ${colors.red}
; label-connected =
; label-disconnected = !
; label-disconnected-foreground = ${colors.red}
ramp-signal-0 = 
ramp-signal-0-foreground = ${colors.yellow}
ramp-signal-1 = 
ramp-signal-1-foreground = ${colors.yellow}
ramp-signal-2 = 
ramp-signal-2-foreground = ${colors.yellow}
ramp-signal-3 = 
ramp-signal-3-foreground = ${colors.accent}
ramp-signal-4 = 
ramp-signal-4-foreground = ${colors.fg}
; [module/eth]
; type = internal/network
; interface = ${env:ETH:enp2s0}
; interval = 4.0
;
; ; format-connected-underline = #55aa55
; ; format-connected-prefix = " "
; format-connected-foreground-foreground = ${colors.fg-alt}
; label-connected = %local_ip%
;
; format-disconnected-underline = ${self.format-connected-underline}
; label-disconnected = %ifname% disconnected
; label-disconnected-foreground = ${colors.fg-alt}
[module/pulseaudio]
type = internal/pulseaudio
; format-volume = <label-volume> <bar-volume>
format-volume = <ramp-volume> <bar-volume>
; label-volume = " "
label-volume-foreground = ${colors.accent}
; format-muted-prefix = " "
format-muted-foreground = ${colors.alert}
label-muted = 
bar-volume-width = 8
# bar-volume-foreground-0 = ${colors.magenta}
# bar-volume-foreground-1 = ${colors.magenta}
# bar-volume-foreground-2 = ${colors.magenta}
# bar-volume-foreground-3 = ${colors.magenta}
# bar-volume-foreground-4 = ${colors.magenta}
# bar-volume-foreground-5 = ${colors.magenta}
# bar-volume-foreground-6 = ${colors.magenta}
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 1
bar-volume-indicator-foreground = #ff
bar-volume-fill = ─
bar-volume-fill-font = 1
bar-volume-empty = ─
bar-volume-empty-font = 1
bar-volume-empty-foreground = ${colors.fg-alt}
; Only applies if <ramp-volume> is used
ramp-volume-0 = 
ramp-volume-1 = 
ramp-volume-2 = 
[module/battery]
type = internal/battery
battery = BAT0
adapter = ADP1
full-at = 98
format-charging = <animation-charging> <label-charging>
format-charging-underline = #ffb52a
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
format-full-prefix = " "
format-full-prefix-foreground = ${colors.fg-alt}
format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-foreground = ${colors.fg-alt}
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-foreground = ${colors.fg-alt}
animation-charging-framerate = 750
;=====================================================
; Custom scripts
;=====================================================
[module/pad]
type = custom/text
content = " "
content-foreground = ${colors.fg-alt}
[module/redshift]
type = custom/script
exec = ~/.config/polybar/modules/redshift
exec-if = pgrep -x redshift
interval = 60
format-padding = 1
[module/syncthing]
type = custom/script
exec = echo 1
exec-if = systemctl is-active syncthing
format = ""
format-foreground = ${colors.fg}
interval = 30
; vim:ft=dosini

View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Specifying the icon(s) in the script
# This allows us to change its appearance conditionally
pgrep -x redshift &> /dev/null
if [[ $? -eq 0 ]]; then
temp=$(redshift -p 2>/dev/null | grep temp | cut -d' ' -f3)
temp=${temp//K/}
fi
# OPTIONAL: Append ' ${temp}K' after $icon
if [[ -z $temp ]]; then
echo "%{F#65737E}$icon" # Greyed out (not running)
elif [[ $temp -ge 5000 ]]; then
echo "%{F#8FA1B3}$icon" # Blue
elif [[ $temp -ge 4000 ]]; then
echo "%{F#EBCB8B}$icon" # Yellow
else
echo "%{F#D08770}$icon" # Orange
fi

View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
killall -q polybar
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
polybar main >>$XDG_DATA_HOME/polybar.log 2>&1 &
echo 'Polybar launched...'

View file

@ -0,0 +1,10 @@
/* -*- mode: css; -*- */
@import "config.rasi"
textbox-icon {
str: "  ";
}
prompt {
enabled: false;
}

View file

@ -0,0 +1,21 @@
/* -*- mode: css; -*- */
@import "config.rasi"
window {
y-offset: 0;
children: [ listview ];
width: 500px;
}
listview {
scrollbar: false;
}
element {
padding: 30px;
background-color: @bg-light;
}
element.selected {
background-color: @accent;
text-color: @bg;
}

View file

@ -0,0 +1,14 @@
/* -*- mode: css; -*- */
@import "config.rasi"
window {
width: 44%;
}
textbox-icon {
str: " 爵 ";
}
prompt {
enabled: false;
}

View file

@ -0,0 +1,114 @@
/* -*- mode: css; -*- */
configuration {
icon-theme: "Paper";
cycle: true;
disable-history: false;
monitor: "-4";
}
* {
accent: #bd93f9;
bg: #1E2029FA;
bg-light: #1c1c1c;
bg-focus: #282a36;
bg-dark: #181a23;
fg: #bbc2cf;
fg-list: #bbc2cf;
on: #8BD49C;
off: #cc6666;
magenta: #bd93f9;
blue: #61bfff;
text-font: "Fira Sans 16";
text-mono-font: "Fira Code 14";
icon-font: "Hurmit Nerd Font Mono 26";
background-color: transparent;
text-color: @fg-list;
font: @text-font;
border-color: @bg-dark;
}
/**** Layout ****/
window {
width: 34%;
y-offset: -25%;
anchor: north;
location: center;
border: 1px;
border-radius: 6px;
children: [ inputbar, listview ];
}
listview {
lines: 16;
fixed-height: false;
/* reverse: true; */
margin: -2px 0 0;
columns: 1;
scrollbar: true;
spacing: 1px;
}
scrollbar {
handle-width: 1px;
}
inputbar {
children: [ textbox-icon, prompt, entry ];
border: 0 0 1px;
}
textbox-icon, prompt {
padding: 11px;
expand: false;
border: 0 1px 0 0;
margin: 0 -2px 0 0;
}
textbox-icon {
padding: 7px -6px 0;
}
entry, element {
padding: 11px 14px;
}
textbox {
padding: 24px;
margin: 20px;
}
/**** Looks ****/
scrollbar {
background-color: @bg-dark;
handle-color: @accent;
border-color: @bg-dark;
}
listview, inputbar {
background-color: @bg-dark;
}
textbox-icon, prompt, entry {
text-color: @accent;
}
prompt, entry {
background-color: @bg-focus;
}
textbox-icon, prompt {
background-color: #2f313d;
}
prompt {
background-color: @bg-focus;
}
textbox-icon {
font: @icon-font;
}
entry {
font: @text-font-mono;
text-color: @fg;
}
element {
background-color: @bg;
text-color: @fg;
}
element selected {
background-color: @bg-dark;
text-color: @accent;
}

View file

@ -0,0 +1,11 @@
/* -*- mode: css; -*- */
@import "config.rasi"
textbox-icon {
str: "  ";
}
prompt {
enabled: true;
}

View file

@ -0,0 +1,6 @@
/* -*- mode: css; -*- */
@import "config.rasi"
textbox-icon {
str: "  ";
}

View file

@ -0,0 +1,23 @@
/** -*- mode: css; -*-
* This theme is intended for a 5 items wide menu on a 1920x1080 pixels resolution.
* You may have to tweak values such as the window padding if you have a different resolution.
*/
@import "appmenu.rasi"
window {
children: [ listview ];
width: 500px;
}
listview {
scrollbar: false;
}
element {
padding: 30px;
background-color: @bg-light;
}
element.selected {
background-color: @accent;
text-color: @bg;
}

View file

@ -0,0 +1,19 @@
/* -*- mode: css; -*- */
@import "config.rasi"
inputbar {
width: 25%;
}
textbox-icon {
str: " 缾 ";
}
prompt {
enabled: false;
}
element {
font: "Fira Code 12";
}

View file

@ -0,0 +1,64 @@
# -- THEME -------------------------------
# The statusbar
set -g status-position bottom
set -g status-justify centre
set -g status-bg default
set -g status-fg colour15
set -g status-interval 10
# set -g status-attr dim
# set -g status-left '#[fg=colour236]_________________________'
set -g status-left '#{prefix_highlight}#[fg=colour236]|―――――――――――――――――――|'
# set -g status-left "#[fg=colour236]#{prefix_highlight} #[fg=colour5] #S #[fg=colour236]──"
# set -g status-right '#[fg=colour236]_________________________'
set -g status-right '#[fg=colour236]|―――――――――――――――――――――――――|'
set -g status-right-length 30
set -g status-left-length 30
# The messages
set -g message-style fg=magenta,bg=colour236
set -g message-command-style fg=blue,bg=black
# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity on
set-option -g bell-action none
# The modes
setw -g clock-mode-colour colour135
# setw -g mode-attr bold
# setw -g mode-fg colour196
# setw -g mode-bg colour238
# The panes
set -g pane-border-style fg=colour235
set -g pane-active-border-style fg=colour5
# setw -g window-status-current-fg colour2
# setw -g window-status-current-bg default
# setw -g window-status-current-attr none
# setw -g window-status-current-format ' #W '
# setw -g window-status-fg colour236
# setw -g window-status-bg default
# setw -g window-status-attr none
# setw -g window-status-format '#[fg=colour8] #I #[fg=default]#W '
setw -g window-status-format ' #W '
# setw -g window-status-activity-bg default
# setw -g window-status-activity-fg colour240
# setw -g window-status-activity-attr none
# setw -g window-status-bell-attr bold
# setw -g window-status-bell-fg colour255
# setw -g window-status-bell-bg colour1
# -- PLUGINS -----------------------------
# tmux-prefix-highlight
set -g @prefix_highlight_empty_prompt '-----'
set -g @prefix_highlight_prefix_prompt ' C^c #[bg=colour8]'
set -g @prefix_highlight_show_copy_mode 'on'

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View file

@ -0,0 +1,71 @@
# Loosely based off Pure <https://github.com/sindresorhus/pure>
_strlen() { echo ${#${(S%%)1//$~%([BSUbfksu]|([FB]|){*})/}}; }
# fastest possible way to check if repo is dirty
prompt_git_dirty() {
command -v git >/dev/null || return
# check if we're in a git repo
[[ "$(command git rev-parse --is-inside-work-tree 2>/dev/null)" == "true" ]] || return
# check if it's dirty
command test -n "$(git status --porcelain --ignore-submodules -unormal)" || return
local r=$(command git rev-list --right-only --count HEAD...@'{u}' 2>/dev/null)
local l=$(command git rev-list --left-only --count HEAD...@'{u}' 2>/dev/null)
(( ${r:-0} > 0 )) && echo -n " %F{red}${r}-"
(( ${l:-0} > 0 )) && echo -n " %F{green}${l}+"
echo -n '%f'
}
## Hooks ###############################
prompt_hook_precmd() {
vcs_info # get git info
# Newline before prompt, except on init
[[ -n $PROMPT_DONE ]] && print ""; PROMPT_DONE=1
}
## Initialization ######################
prompt_init() {
# prevent percentage showing up
# if output doesn't end with a newline
export PROMPT_EOL_MARK=
# prompt_opts=(cr subst percent)
setopt promptsubst
autoload -Uz add-zsh-hook
autoload -Uz vcs_info
add-zsh-hook precmd prompt_hook_precmd
# Updates cursor shape and prompt symbol based on vim mode
zle-keymap-select() {
case $KEYMAP in
vicmd) PROMPT_SYMBOL="%F{green}« " ;;
main|viins) PROMPT_SYMBOL="%(?.%F{magenta}.%F{yellow})λ " ;;
esac
zle reset-prompt
zle -R
}
zle -N zle-keymap-select
zle -A zle-keymap-select zle-line-init
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' use-simple true
zstyle ':vcs_info:*' max-exports 2
zstyle ':vcs_info:git*' formats ' %b'
zstyle ':vcs_info:git*' actionformats ' %b (%a)'
# show username@host if logged in through SSH
if [[ -n $SSH_CONNECTION ]]; then
prompt_username='%m '
if [[ $(whoami) != hlissner ]]; then
prompt_username="%n.$prompt_username"
fi
fi
RPROMPT='%F{blue}%~%F{magenta}${vcs_info_msg_0_}$(prompt_git_dirty)%f'
PROMPT='%F{magenta}${prompt_username}%f${PROMPT_SYMBOL:-$ }'
}
prompt_init "$@"

View file

@ -8,6 +8,7 @@
(callPackage (callPackage
(builtins.fetchTarball (builtins.fetchTarball
https://github.com/xzfc/cached-nix-shell/archive/master.tar.gz) {}); https://github.com/xzfc/cached-nix-shell/archive/master.tar.gz) {});
ant-dracula = (callPackage ./packages/ant-dracula.nix {});
}; };
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
@ -16,7 +17,7 @@
# Occasionally, "stable" packages are broken or incomplete, so access to the # Occasionally, "stable" packages are broken or incomplete, so access to the
# bleeding edge is necessary, as a last resort. # bleeding edge is necessary, as a last resort.
unstable = import <nixpkgs-unstable> { inherit config; }; unstable = import <nixos-unstable> { inherit config; };
}) })
# emacsGit # emacsGit

39
packages/ant-dracula.nix Normal file
View file

@ -0,0 +1,39 @@
{ stdenv, fetchurl, gtk-engine-murrine }:
stdenv.mkDerivation rec {
pname = "ant-dracula-theme";
version = "1.3.0";
src = fetchurl {
url = "https://github.com/EliverLara/Ant-Dracula/releases/download/v${version}/Ant-Dracula.tar";
sha256 = "00b8w69xapqy8kc7zqwlfz1xpld6hibbh35djvhcnd905gzzymkd";
};
propagatedUserEnvPkgs = [
gtk-engine-murrine
];
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/share/themes/Ant-Dracula
cp -a * $out/share/themes/Ant-Dracula
rm -r $out/share/themes/Ant-Dracula/{Art,LICENSE,README.md,gtk-2.0/render-assets.sh}
runHook postInstall
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "1ns00y1haxm20jak26gjv53yisaw9vsr2dbsgj10zz65rglr1h18";
meta = with stdenv.lib; {
description = "A flat and light theme with a modern look";
homepage = https://github.com/EliverLara/Ant-Dracula;
license = licenses.gpl3;
platforms = platforms.all;
maintainers = [
maintainers.pbogdan
];
};
}