Compare commits

...

No commits in common. "main" and "arch" have entirely different histories.
main ... arch

77 changed files with 2404 additions and 2126 deletions

19
README.md Normal file
View File

@ -0,0 +1,19 @@
# Dot Files
This repository contains the configuration files for some of the programs I use. There is also a handy setup script that should configure everything for you.
## Usage
This is quite outdated and might not be completely accurate anymore.
To use these configuration files you first have to make sure you have the following programs installed:
- fish
- neovim
Once you have these programs installed you can clone the repository into a place you like and run the setup script. The setup script will detect existing configuration files and leave them alone. This means that if you are replacing an old configuration you need to delete it first.
```bash
# Clone the repository into the folder .dots in your home directory.
git clone https://git.kallestruik.nl/kalle/dotfiles.git ~/.dots
# Execute the install script.
cd ~/.dots
bash setup.sh
```

View File

@ -0,0 +1,6 @@
[Desktop Entry]
Name=Latex document
Comment=A blank latex document
Type=Link
URL=src/Latex document.tex
Icon=text-x-bibtex

View File

@ -0,0 +1,6 @@
[Desktop Entry]
Name=Shell script
Comment=A blank shell script
Type=Link
URL=src/Shell script.sh
Icon=text-x-script

View File

@ -0,0 +1,9 @@
\documentclass{article} % This command is used to set the type of document you are working on such as an article, book, or presenation
\usepackage{geometry} % This package allows the editing of the page layout
\usepackage{amsmath} % This package allows the use of a large range of mathematical formula, commands, and symbols
\usepackage{graphicx} % This package allows the importing of images
\begin{document}
\end{document}

1
Templates/src/Shell script.sh Executable file
View File

@ -0,0 +1 @@
#!/usr/bin/env bash

143
bash/.bashrc Normal file
View File

@ -0,0 +1,143 @@
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Ansible defaults
export ANSIBLE_BECOME_ASK_PASS=yes
# Add ~/bin and ~/bin/scripts to my path
export PATH=$PATH:$HOME/bin/:$HOME/bin/scripts/:$HOME/.cargo/bin
# Set editor to neovim.
alias edit=nvim
export EDITOR="nvim"
# Prompt stuff
#
# LINEAGE:
#
# Based on work by woods and sundeepgupta
#
# https://gist.github.com/31967
# https://gist.github.com/sundeepgupta/b099c31ee2cc1eb31b6d
# The various escape codes that we can use to color our prompt.
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[1;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
CYAN="\[\033[0;36m\]"
PURPLE="\[\033[0;35m\]"
COLOR_NONE="\[\e[0m\]"
# Detect whether the current directory is a git repository.
function is_git_repository {
git branch > /dev/null 2>&1
}
# Determine the branch/state information for this git repository.
function set_git_branch {
# Capture the output of the "git status" command.
git_status="$(git status 2> /dev/null)"
# Set color based on clean/staged/dirty.
if [[ ${git_status} =~ "working tree clean" ]]; then
state="${GREEN}"
elif [[ ${git_status} =~ "Changes to be committed" ]]; then
state="${YELLOW}"
else
state="${RED}"
fi
# Set arrow icon based on status against remote.
remote_pattern="Your branch is (.*) of"
if [[ ${git_status} =~ ${remote_pattern} ]]; then
if [[ ${BASH_REMATCH[1]} == "ahead" ]]; then
remote="↑"
else
remote="↓"
fi
else
remote=""
fi
diverge_pattern="Your branch and (.*) have diverged"
if [[ ${git_status} =~ ${diverge_pattern} ]]; then
remote="↕"
fi
# Get the name of the branch.
branch_pattern="^(# )?On branch ([^${IFS}]*)"
if [[ ${git_status} =~ ${branch_pattern} ]]; then
branch=${BASH_REMATCH[2]}
fi
# Set the final branch string.
BRANCH="${state}(${branch})${remote}${COLOR_NONE} "
}
# Return the prompt symbol to use, colorized based on the return value of the
# previous command.
function set_prompt_symbol () {
if test $1 -eq 0 ; then
PROMPT_SYMBOL="\$"
else
PROMPT_SYMBOL="${LIGHT_RED}\$${COLOR_NONE}"
fi
}
# Set the full bash prompt.
function set_bash_prompt () {
# Set the PROMPT_SYMBOL variable. We do this first so we don't lose the
# return value of the last command.
set_prompt_symbol $?
# Set the BRANCH variable.
if is_git_repository ; then
set_git_branch
else
BRANCH=''
fi
# Set the bash prompt variable.
PS1="
${BLUE}[\t] ${CYAN}\w ${COLOR_NONE}${BRANCH}
${PROMPT_SYMBOL} "
}
# Tell bash to execute this function just before displaying its prompt.
PROMPT_COMMAND=set_bash_prompt
# fzf is love, fzf is life.
source /usr/share/fzf/key-bindings.bash
function cdl() {
cd $@
ls
}
# Functions
function cd-projects {
project_name=`project list | fzf --preview="proj_preview {}"`
cd "`project path "$project_name"`"
}
# Aliases
alias gg="git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an (%ae)%C(reset)' --all"
alias gca="git add -A; git commit -a --amend --no-edit"
alias gs="git status"
alias proj="cd-projects"
# Use the kitty kitten for ssh so sessions can be cached and remote editing/session cloning is possible.
alias ssh="kitty +kitten ssh"
alias paru="paru --bottomup"
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"

459
dunst/dunstrc Normal file
View File

@ -0,0 +1,459 @@
# See dunst(5) for all configuration options
[global]
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = none
### Geometry ###
# dynamic width from 0 to 300
# width = (0, 300)
# constant width of 300
width = 300
# The maximum height of a single notification, excluding the frame.
height = 300
# Position the notification in the top right corner
origin = top-left
# Offset from the origin
offset = 10x10
# Scale factor. It is auto-detected if value is 0.
scale = 0
# Maximum number of notification (0 means no limit)
notification_limit = 20
### Progress bar ###
# Turn on the progess bar. It appears when a progress hint is passed with
# for example dunstify -h int:value:12
progress_bar = true
# Set the progress bar height. This includes the frame, so make sure
# it's at least twice as big as the frame width.
progress_bar_height = 10
# Set the frame width of the progress bar
progress_bar_frame_width = 0
# Set the minimum width for the progress bar
progress_bar_min_width = 150
# Set the maximum width for the progress bar
progress_bar_max_width = 300
# Corner radius for the progress bar. 0 disables rounded corners.
progress_bar_corner_radius = 0
# Corner radius for the icon image.
icon_corner_radius = 0
# Show how many messages are currently hidden (because of
# notification_limit).
indicate_hidden = yes
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.). (X11 only)
transparency = 0.3
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
# If gap_size is greater than 0, this setting will be ignored.
separator_height = 2
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 8
# Padding between text and icon.
text_icon_padding = 0
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 0
# Defines color of the frame around the notification window.
frame_color = "#aaaaaa"
# Size of gap to display between notifications - requires a compositor.
# If value is greater than 0, separator_height will be ignored and a border
# of size frame_width will be drawn around each notification instead.
# Click events on gaps do not currently propagate to applications below.
gap_size = 10
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = frame
# Sort messages by urgency.
sort = yes
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# A client can set the 'transient' hint to bypass this. See the rules
# section for how to disable this if necessary
# idle_threshold = 120
### Text ###
font = Monospace 8
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
# Possible values are:
# full: Allow a small subset of html markup in notifications:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <https://docs.gtk.org/Pango/pango_markup.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
# server. Dunst will try to strip the markup but the parsing is
# simplistic so using this option outside of matching rules for
# specific applications *IS GREATLY DISCOURAGED*.
#
# no: Disable markup parsing, incoming notifications will be treated as
# plain text. Dunst will not advertise that it has the body-markup
# capability if this is set as a global setting.
#
# It's important to note that markup inside the format option will be parsed
# regardless of what this is set to.
markup = full
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%s</b>\n%b"
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# Vertical alignment of message text and icon.
# Possible values are "top", "center" and "bottom".
vertical_alignment = center
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Specify where to make an ellipsis in long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Stack together notifications with the same content
stack_duplicates = true
# Hide the count of stacked notifications with the same content
hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
### Icons ###
# Recursive icon lookup. You can set a single theme, instead of having to
# define all lookup paths.
enable_recursive_icon_lookup = true
# Set icon theme (only used for recursive icon lookup)
icon_theme = Adwaita
# You can also set multiple icon themes, with the leftmost one being used first.
# icon_theme = "Adwaita, breeze"
# Align icons left/right/top/off
icon_position = left
# Scale small icons up to this size, set to 0 to disable. Helpful
# for e.g. small files or high-dpi screens. In case of conflict,
# max_icon_size takes precedence over this.
min_icon_size = 32
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 128
# Paths to default icons (only neccesary when not using recursive icon lookup)
icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
### History ###
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 20
### Misc/Advanced ###
# dmenu path.
dmenu = /usr/bin/dmenu -p dunst:
# Browser for opening urls in context menu.
browser = /usr/bin/xdg-open
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst
title = Dunst
# Define the class of the windows spawned by dunst
class = Dunst
# Define the corner radius of the notification window
# in pixel size. If the radius is 0, you have no rounded
# corners.
# The radius will be automatically lowered if it exceeds half of the
# notification height to avoid clipping text and/or icons.
corner_radius = 0
# Ignore the dbus closeNotification message.
# Useful to enforce the timeout set by dunst configuration. Without this
# parameter, an application may close the notification sent before the
# user defined timeout.
ignore_dbusclose = false
### Wayland ###
# These settings are Wayland-specific. They have no effect when using X11
# Uncomment this if you want to let notications appear under fullscreen
# applications (default: overlay)
# layer = top
# Set this to true to use X11 output on Wayland.
force_xwayland = false
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.
# This setting is provided for compatibility with older nVidia drivers that
# do not support RandR and using it on systems that support RandR is highly
# discouraged.
#
# By enabling this setting dunst will not be able to detect when a monitor
# is connected or disconnected which might break follow mode if the screen
# layout changes.
force_xinerama = false
### mouse
# Defines list of actions for each mouse event
# Possible values are:
# * none: Don't do anything.
# * do_action: Invoke the action determined by the action_name rule. If there is no
# such action, open the context menu.
# * open_url: If the notification has exactly one url, open it. If there are multiple
# ones, open the context menu.
# * close_current: Close current notification.
# * close_all: Close all notifications.
# * context: Open context menu for the notification.
# * context_all: Open context menu for all notifications.
# These values can be strung together for each mouse event, and
# will be executed in sequence.
mouse_left_click = close_current
mouse_middle_click = do_action, close_current
mouse_right_click = close_all
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = false
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#222222"
foreground = "#888888"
timeout = 10
# Icon for notifications with low urgency, uncomment to enable
#default_icon = /path/to/icon
[urgency_normal]
background = "#285577"
foreground = "#ffffff"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
#default_icon = /path/to/icon
[urgency_critical]
background = "#900000"
foreground = "#ffffff"
frame_color = "#ff0000"
timeout = 0
# Icon for notifications with critical urgency, uncomment to enable
#default_icon = /path/to/icon
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
#
# Messages can be matched by
# appname (discouraged, see desktop_entry)
# body
# category
# desktop_entry
# icon
# match_transient
# msg_urgency
# stack_tag
# summary
#
# and you can override the
# background
# foreground
# format
# frame_color
# fullscreen
# new_icon
# set_stack_tag
# set_transient
# set_category
# timeout
# urgency
# icon_position
# skip_display
# history_ignore
# action_name
# word_wrap
# ellipsize
# alignment
# hide_text
#
# Shell-like globbing will get expanded.
#
# Instead of the appname filter, it's recommended to use the desktop_entry filter.
# GLib based applications export their desktop-entry name. In comparison to the appname,
# the desktop-entry won't get localized.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
# Disable the transient hint so that idle_threshold cannot be bypassed from the
# client
#[transient_disable]
# match_transient = yes
# set_transient = no
#
# Make the handling of transient notifications more strict by making them not
# be placed in history.
#[transient_history_ignore]
# match_transient = yes
# history_ignore = yes
# fullscreen values
# show: show the notifications, regardless if there is a fullscreen window opened
# delay: displays the new notification, if there is no fullscreen window active
# If the notification is already drawn, it won't get undrawn.
# pushback: same as delay, but when switching into fullscreen, the notification will get
# withdrawn from screen again and will get delayed like a new notification
#[fullscreen_delay_everything]
# fullscreen = delay
#[fullscreen_show_critical]
# msg_urgency = critical
# fullscreen = show
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# skip_display = true
#[history-ignore]
# # This notification will not be saved in history
# summary = "foobar"
# history_ignore = yes
#[skip-display]
# # This notification will not be displayed, but will be included in the history
# summary = "foobar"
# skip_display = yes
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
#[stack-volumes]
# appname = "some_volume_notifiers"
# set_stack_tag = "volume"
#
# vim: ft=cfg

33
eww/_variables.yuck Normal file
View File

@ -0,0 +1,33 @@
(defpoll time :interval "10s" "date '+%H:%M'")
(defpoll year :interval "10h" "date '+%Y'")
(defpoll date :interval "30m" "date '+%m-%d'")
(defpoll audio_sink_default
:interval "10s"
`pactl get-default-sink`)
(defpoll audio_source_default
:interval "10s"
`pactl get-default-source`)
(deflisten media-player_status
:initial "paused"
"playerctl --player plasma-browser-integration --follow status")
(deflisten media-player_metadata
:initial "{\"title\": \"Nothing playing\", \"album\": \"\", \"artist\": \"\", \"art_url\": \"\"}"
"playerctl --player plasma-browser-integration --follow metadata --format '{\"title\": \"{{title}}\", \"album\": \"{{album}}\", \"artist\": \"{{artist}}\", \"art_url\": \"{{mpris:artUrl}}\"}'")
(deflisten media-player_metadata_image
:initial "/tmp/mpris-thumb"
"playerctl --follow --player plasma-browser-integration --follow metadata --format {{mpris:artUrl}} | /home/kalle/bin/scripts/eww-playerctl-download-image")
(defpoll audio-sinks
:initial "[]"
:interval "10s"
"pactl -f json list sinks | jq '[.[]|{\"id\": .name, \"name\":.description, \"volume\": .volume.\"front-left\".value_percent | rtrimstr(\"%\"), \"muted\": .mute}]'")
(defpoll audio-sources
:initial "[]"
:interval "10s"
"pactl -f json list sources | jq '[.[] | select(.monitor_source == \"\") | {\"id\": .name, \"name\":.description, \"volume\": .volume.\"front-left\".value_percent | rtrimstr(\"%\"), \"muted\": .mute}]'")

43
eww/audio.yuck Normal file
View File

@ -0,0 +1,43 @@
(defwidget audio-sink [sink]
(box
:orientation "v"
(box :space-evenly false :spacing 15
(box "${sink.id == audio_sink_default ? "x " : ""}${sink.name}")
(box :hexpand true)
(button :onclick "pactl set-sink-mute \"${sink.id}\" toggle"
"M")
(button :onclick "pactl set-default-sink ${sink.id}"
"D")
)
(box :space-evenly false
(box :width 50
{sink.muted ? "Muted" : "${sink.volume}%"})
(scale :hexpand true
:value {sink.volume}
:onchange "pactl set-sink-volume ${sink.id} {}%"
)
)
)
)
(defwidget audio-source [source]
(box
:orientation "v"
(box :space-evenly false :spacing 15
(box "${source.id == audio_source_default ? "x " : ""}${source.name}")
(box :hexpand true)
(button :onclick "pactl set-source-mute \"${source.id}\" toggle"
"M")
(button :onclick "pactl set-default-source ${source.id}"
"D")
)
(box :space-evenly false
(box :width 50
{source.muted ? "Muted" : "${source.volume}%"})
(scale :hexpand true
:value {source.volume}
:onchange "pactl set-source-volume ${source.id} {}%"
)
)
)
)

View File

@ -16,29 +16,30 @@
)
)
(defwidget left []
(box :class "left"
:space-evenly "false"
:halign "start"
:valign "center"
:orientation "h"
(notifications)
(audio)
(clipboard)
(defwidget color-picker []
(eventbox :class "color-picker"
:onclick "hyprctl dispatch exec \"hyprpicker --no-fancy | wl-copy\""
""
)
)
(defwidget workspace-indicator []
". . . . . . . . . ."
(defwidget left []
(box :class "left"
:halign "start"
:orientation "h"
(notifications) ; TODO: notifications - Opens notification menu
(audio)
(clipboard); TODO: Clipboard - Opens clipboard menu (clipboard history click to make current)
;; TODO: Bluetooth something
(color-picker)
)
)
(defwidget center []
(box :class "center"
:space-evenly "false"
:halign "center"
:valign "center"
:orientation "h"
(workspace-indicator)
)
)
@ -60,8 +61,9 @@
:halign "end"
:valign "center"
:orientation "v"
(time)
(date)
; TODO: Redo this thing and make it open calendar view
(time) ; TODO: Time - Open timer/stopwatch menu?
(date) ; TODO: Year month day - Open calendar/upcoming events list (source these from some daemon?)
)
)
@ -79,7 +81,7 @@
:geometry (geometry :x "0px"
:y "10px"
:width "1060px"
:height "48px"
:height "50px"
:anchor "center top")
:stacking "fg"
:exclusive true

View File

@ -1,3 +0,0 @@
(defpoll time :interval "10s" "date '+%H:%M'")
(defpoll year :interval "10h" "date '+%Y'")
(defpoll date :interval "30m" "date '+%m-%d'")

View File

View File

@ -1,2 +0,0 @@
(include "_variables.yuck")
(include "bar.yuck")

View File

@ -1,15 +0,0 @@
{ inputs
, lib
, config
, pkgs
, ...
}:
{
programs.eww = {
enable = true;
package = pkgs.eww-wayland;
configDir = ./config;
};
}

74
eww/eww.scss Normal file
View File

@ -0,0 +1,74 @@
$clr-primary: #883333;
$clr-background: rgba(0, 0, 0, 0.5);
.bar {
background-color: $clr-background;
border-radius: 10px;
.notifications, .audio, .clipboard, .color-picker {
label {
font-size: 30px;
margin: 5px;
}
&:hover {
color: $clr-primary;
// background-color: rgba(#888888, 0.2);
}
}
.left {
margin-left: 10px;
}
.right {
margin-right: 10px;
}
}
.audio {
background-color: $clr-background;
border-radius: 5px;
.audio-sinks {
margin-left: 50px;
margin-right: 20px;
}
.audio-sources {
margin-left: 20px;
margin-right: 50px;
}
.media-player {
background-size: cover;
margin: 10px;
border-radius: 15px;
border: 2px solid black;
padding: 10px 20px 10px 20px;
.title {
font-size: 25px;
}
.artist {
font-size: 14px;
color: #aaaaaa;
}
.buttons {
.previous, .pause, .next {
background-color: rgba(0, 0, 0, 0.5);
border-radius: 25px;
label {
margin: 10px;
font-size: 20px;
}
}
}
}
}
.title {
font-size: 24px;
}

6
eww/eww.yuck Normal file
View File

@ -0,0 +1,6 @@
(include "_variables.yuck")
(include "util.yuck")
(include "audio.yuck")
(include "bar.yuck")
(include "volume.yuck")

5
eww/util.yuck Normal file
View File

@ -0,0 +1,5 @@
(defwidget title [content]
(box :class "title"
content
)
)

101
eww/volume.yuck Normal file
View File

@ -0,0 +1,101 @@
(defwidget media-player []
(box :class "media-player"
:orientation "v"
:height 200
:style "background-image: radial-gradient(
circle farthest-side at left,
rgba(0, 0, 0, 0.9) 40%,
rgba(0, 0, 0, 0.2) 70%),
url('${media-player_metadata_image}');"
(box :orientation "v"
(box :class "title"
:halign "start"
{media-player_metadata.title}
)
(box :class "artist"
:halign "start"
{media-player_metadata.artist}
)
)
(box :class "buttons"
:valign "end"
:orientation "h"
:space-evenly true
:spacing 50
(eventbox :class "previous"
:width 40
:onclick "playerctl previous"
"󰒮"
)
(eventbox :class "pause"
:width 40
:onclick "playerctl play-pause"
{media-player_status == "Playing" ? "󰏤" : "󰐊"}
)
(eventbox :class "next"
:width 40
:onclick "playerctl next"
"󰒭"
)
)
)
)
(defwidget audio-title []
(box :class "audio-title"
:valign "start"
"Audio"
)
)
(defwidget audio-sinks []
(box :orientation "v" :class "audio-sinks" :space-evenly false
(title :content "Sinks")
{audio_sink_default ? "" : ""} ;; This is dumb, but fixes this variable not updating
(for sink in audio-sinks
(audio-sink :sink {sink})
)
)
)
(defwidget audio-sources []
(box :orientation "v" :class "audio-sources" :space-evenly false
(title :content "Sources")
{audio_source_default ? "" : ""} ;; This is dumb, but fixes this variable not updating
(for source in audio-sources
(audio-source :source {source})
)
)
)
(defwidget audio-window []
(box :class "audio"
:orientation "v"
:space-evenly false
;; TODO: Maybe individual applications as well.
(box :orientation "h"
(media-player)
(box
;; TODO: Put something here
)
)
(box :orientation "h"
(audio-sinks)
(audio-sources)
)
)
)
(defwindow audio
:monitor 2
:geometry (geometry :x "10px"
:y "10px"
:width "1060"
:height "500px"
:anchor "top center")
:stacking "overlay"
:exclusive false
(audio-window)
)

View File

@ -1,201 +0,0 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1708988456,
"narHash": "sha256-RCz7Xe64tN2zgWk+MVHkzg224znwqknJ1RnB7rVqUWw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "1d085ea4444d26aa52297758b333b449b2aa6fca",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "home-manager",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"xdg-desktop-portal-hyprland",
"nixpkgs"
],
"systems": [
"xdg-desktop-portal-hyprland",
"systems"
]
},
"locked": {
"lastModified": 1691753796,
"narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"hyprlang": {
"inputs": {
"nixpkgs": [
"xdg-desktop-portal-hyprland",
"nixpkgs"
],
"systems": "systems"
},
"locked": {
"lastModified": 1708681732,
"narHash": "sha256-ULZZLZ9C33G13IaXLuAc4oTzHUvnATI8Fj2u6gzMfT0=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "f4466367ef0a92a6425d482050dc2b8840c0e644",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1709150264,
"narHash": "sha256-HofykKuisObPUfj0E9CJVfaMhawXkYx3G8UIFR/XQ38=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9099616b93301d5cf84274b184a3a5ec69e94e08",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"plugin-harpoon1": {
"flake": false,
"locked": {
"lastModified": 1703631439,
"narHash": "sha256-SIqssvuNnkw1YbEEElLYCHmh9OLnoHzggXNIZMb3jYI=",
"owner": "ThePrimeagen",
"repo": "harpoon",
"rev": "ccae1b9bec717ae284906b0bf83d720e59d12b91",
"type": "github"
},
"original": {
"owner": "ThePrimeagen",
"repo": "harpoon",
"type": "github"
}
},
"plugin-rainbow-delimiters-nvim": {
"flake": false,
"locked": {
"lastModified": 1709163331,
"narHash": "sha256-QETHqUrqY9acAUxRgROGI3Qopy+P6tW36uVqHCemj10=",
"owner": "HiPhish",
"repo": "rainbow-delimiters.nvim",
"rev": "4902de74335ba0c4816cb67c5d5052c0c5fc7e56",
"type": "gitlab"
},
"original": {
"owner": "HiPhish",
"repo": "rainbow-delimiters.nvim",
"type": "gitlab"
}
},
"plugin-undotree-nvim": {
"flake": false,
"locked": {
"lastModified": 1707485506,
"narHash": "sha256-FIYDyfkaIS9C16ClWKLMdpSPv/OrcOalVVsyFJBU2eI=",
"owner": "jiaoshijie",
"repo": "undotree",
"rev": "eab459ab87dd249617b5f7187bb69e614a083047",
"type": "github"
},
"original": {
"owner": "jiaoshijie",
"repo": "undotree",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"plugin-harpoon1": "plugin-harpoon1",
"plugin-rainbow-delimiters-nvim": "plugin-rainbow-delimiters-nvim",
"plugin-undotree-nvim": "plugin-undotree-nvim",
"xdg-desktop-portal-hyprland": "xdg-desktop-portal-hyprland"
}
},
"systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"xdg-desktop-portal-hyprland": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"hyprlang": "hyprlang",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_2"
},
"locked": {
"lastModified": 1708954916,
"narHash": "sha256-GUbIMXUrcb6Pxmz9lQ3j6XMFLsQaSwTvViNKYNSMdd0=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "15fd76cb6ebb0e3c3b2c3a3daf452e7b781c6e8a",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@ -1,63 +0,0 @@
{
description = "My NixOS and home-manager configs";
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Home manager
home-manager.url = "github:nix-community/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# Neovim plugins not in nixpkgs
plugin-rainbow-delimiters-nvim.url = "gitlab:HiPhish/rainbow-delimiters.nvim";
plugin-rainbow-delimiters-nvim.flake = false;
plugin-undotree-nvim.url = "github:jiaoshijie/undotree";
plugin-undotree-nvim.flake = false;
plugin-harpoon1.url = "github:ThePrimeagen/harpoon";
plugin-harpoon1.flake = false;
# Track hyprland xdg desktop portal master until screenshots get released again
xdg-desktop-portal-hyprland.url = "github:hyprwm/xdg-desktop-portal-hyprland";
xdg-desktop-portal-hyprland.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{ self
, nixpkgs
, home-manager
, ...
} @ inputs:
let
inherit (self) outputs;
in
{
overlays = import ./overlays { inherit inputs; };
nixosConfigurations = {
"kalle-pc" = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = [ ./nixos/kalle-pc/configuration.nix ];
};
"kalle-laptop" = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = [ ./nixos/kalle-laptop/configuration.nix ];
};
};
homeConfigurations = {
"kalle@kalle-pc" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = [ ./home-manager/kalle-pc/kalle.nix ];
};
"kalle@kalle-laptop" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = [ ./home-manager/kalle-laptop/kalle.nix ];
};
};
};
}

View File

@ -1,128 +0,0 @@
{ inputs
, outputs
, lib
, config
, pkgs
, ...
}:
{
home = {
username = "kalle";
homeDirectory = "/home/kalle";
};
imports =
[
../../nvim
../../tmux
];
nixpkgs = {
overlays = with outputs.overlays; [
nvim-plugins
];
config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
permittedInsecurePackages = [
"electron-25.9.0"
];
};
};
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
discord
vesktop
firefox
chromium
httpie
kate
dolphin
ark
rustup
gcc
pavucontrol
difftastic
sops
obsidian
cachix
];
programs.home-manager.enable = true;
programs.bash = {
enable = true;
shellAliases = {
# Git aliases
gg = "git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an (%ae)%C(reset)' --all";
gca = "git add -A; git commit -a --amend --no-edit";
gs = "git status";
# Replace some commands with better versions
ssh = "kitty +kitten ssh";
diff = "${pkgs.difftastic}/bin/difftastic";
};
initExtra = ''
function open() {
xdg-open $@ &> /dev/null &
}
'';
};
programs.kitty = {
enable = true;
theme = "Catppuccin-Mocha";
settings = {
background_opacity = "0.8";
allow_remote_control = true;
};
};
programs.starship = {
enable = true;
settings = {
add_newline = true;
# Remove text from nix shell component
nix_shell.format = "via [$symbol]($style) ";
git_status.disabled = true;
package.disabled = true;
};
};
programs.direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
programs.git = {
enable = true;
userName = "Kalle Struik";
userEmail = "kalle@kallestruik.nl";
difftastic.enable = true;
extraConfig = {
init.defaultBranch = "main";
};
};
home.sessionVariables = {
EDITOR = "nvim";
};
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "23.05"; # Please read the comment before changing.
}

View File

@ -1,348 +0,0 @@
{ inputs
, outputs
, lib
, config
, pkgs
, ...
}:
{
home = {
username = "kalle";
homeDirectory = "/home/kalle";
};
imports =
[
../../nvim
../../tmux
../../eww
../../hyprland
../../hyprland/hyprpaper.nix
];
hyprland =
let
mod = "SUPER"; in
{
mod = mod;
primaryMonitor = "DP-2";
monitors = [
{
name = "DP-2";
width = 1920;
height = 1080;
refreshRate = 144;
x = 0;
y = 1080;
vrr = 1;
}
{
name = "HDMI-A-1";
width = 1920;
height = 1080;
x = 1500;
y = 0;
}
{
name = "HDMI-A-2";
width = 1920;
height = 1080;
x = 1920;
y = 1080;
transform = 3;
}
];
autoStart = [
# Bar
"${pkgs.dunst}/bin/dunst"
"${pkgs.firefox}/bin/firefox"
"${pkgs.discord}/bin/discord"
];
environment = {
XCURSOR_SIZE = "24";
QT_QPA_PLATFORMTHEME = "qt5ct";
};
sensitivity = 0.1;
keyboard = {
layout = "us";
variant = "";
options = "";
};
inner_gaps = 5;
outer_gaps = 10;
border = {
size = 1;
active = "rgba(33ccffee) rgba(00ff99ee) 45deg";
inactive = "rgba(595959aa)";
};
layout = "dwindle";
rounding = 5;
layerRules = {
"gtk-layer-shell" = [ "blur" "ignorezero" ];
};
windowRules = {
# Auto workspace
firefox = [ "workspace 1 silent" ];
discord = [ "workspace name:HDMI-A-2" ];
};
windowRulesV2 = {
# ULauncher
"class:^(ulauncher)$" = [
"forceinput"
"dimaround"
];
};
# Media keys
# bind = ,XF86AudioPlay, exec, playerctl --player plasma-browser-integration play-pause
# bind = ,XF86AudioPrev, exec, playerctl previous
# bind = ,XF86AudioNext, exec, playerctl next
# bind = ,XF86AudioLowerVolume, exec, playerctl --player plasma-browser-integration volume 0.01-
# bind = ,XF86AudioRaiseVolume, exec, playerctl --player plasma-browser-integration volume 0.01+
# This is a dumb work around for hyprland not passing ALT half the time with the pass dispatcher.
# bind = ALT, M, exec, xdotool key 'ALT+m'
# bind = ALT, B, exec, xdotool key 'ALT+b'
binds = {
"${mod}, return" = "exec, kitty";
"${mod}, E" = "exec, ulauncher-toggle #wofi --show drun";
"${mod}, Print" = "exec, bash -c \"grim -g \\\"$(slurp)\\\" - | wl-copy\"";
# Clipboard history
# bind = $mainMod, V, exec, cliphist list | wofi --dmenu | cliphist decode | wl-copy
};
mouseBinds = { };
};
hyprpaper = {
wallpaperFolder = "/home/kalle/Pictures/Wallpapers";
};
services.dunst = {
enable = true;
settings = {
global = {
monitor = 0;
follow = "none";
width = 300;
height = 300;
origin = "top-left";
offset = "10x10";
scale = 0;
notification_limit = 20;
progress_bar = true;
progress_bar_height = 10;
progress_bar_frame_width = 0;
progress_bar_min_width = 150;
progress_bar_max_width = 300;
progress_bar_corner_radius = 0;
icon_corner_radius = 0;
indicate_hidden = "yes";
transparency = "0.3";
separator_height = 2;
padding = 8;
horizontal_padding = 8;
text_icon_padding = 0;
frame_width = 0;
frame_color = "#aaaaaa";
gap_size = 10;
separator_color = "frame";
sort = "yes";
font = "Monospace 8";
line_height = 0;
markup = "full";
format = "<b>%s</b>\n%b";
alignment = "left";
vertical_alignment = "center";
show_age_threshold = 60;
ellipsize = "middle";
ignore_newline = "no";
stack_duplicates = true;
hide_duplicate_count = false;
show_indicators = "yes";
enable_recursive_icon_lookup = true;
icon_theme = "Adwaita";
icon_position = "left";
min_icon_size = 32;
max_icon_size = 128;
icon_path = "/usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/";
sticky_history = "yes";
history_length = 20;
dmenu = "/usr/bin/dmenu -p dunst:";
browser = "/usr/bin/xdg-open";
always_run_script = true;
title = "Dunst";
class = "Dunst";
corner_radius = 0;
ignore_dbusclose = false;
force_xwayland = false;
force_xinerama = false;
mouse_left_click = "close_current";
mouse_middle_click = "do_action, close_current";
mouse_right_click = "close_all";
};
experimental = {
per_monitor_dpi = false;
};
urgency_low = {
background = "#222222";
foreground = "#888888";
timeout = 10;
};
urgency_normal = {
background = "#285577";
foreground = "#ffffff";
timeout = 10;
};
urgency_critical = {
background = "#900000";
foreground = "#ffffff";
frame_color = "#ff0000";
timeout = 0;
};
};
};
nixpkgs = {
overlays = with outputs.overlays; [
nvim-plugins
];
config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
permittedInsecurePackages = [
"electron-25.9.0"
];
};
};
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
discord
vesktop
firefox
chromium
httpie
kate
dolphin
ark
rustup
gcc
prismlauncher
pavucontrol
difftastic
sops
obsidian
cachix
];
programs.home-manager.enable = true;
gtk = {
theme = {
package = pkgs.libsForQt5.breeze-gtk;
name = "Breeze-Dark";
};
iconTheme = {
package = pkgs.libsForQt5.breeze-icons;
name = "breeze-dark";
};
};
programs.bash = {
enable = true;
shellAliases = {
# Git aliases
gg = "git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an (%ae)%C(reset)' --all";
gca = "git add -A; git commit -a --amend --no-edit";
gs = "git status";
# Replace some commands with better versions
ssh = "kitty +kitten ssh";
diff = "${pkgs.difftastic}/bin/difftastic";
};
initExtra = ''
function open() {
xdg-open $@ &> /dev/null &
}
'';
};
programs.kitty = {
enable = true;
theme = "Catppuccin-Mocha";
settings = {
background_opacity = "0.8";
allow_remote_control = true;
};
};
programs.starship = {
enable = true;
settings = {
add_newline = true;
# Remove text from nix shell component
nix_shell.format = "via [$symbol]($style) ";
git_status.disabled = true;
package.disabled = true;
};
};
programs.direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
programs.git = {
enable = true;
userName = "Kalle Struik";
userEmail = "kalle@kallestruik.nl";
difftastic.enable = true;
extraConfig = {
init.defaultBranch = "main";
};
};
home.sessionVariables = {
EDITOR = "nvim";
};
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "23.05"; # Please read the comment before changing.
}

214
hypr/hyprland.conf Normal file
View File

@ -0,0 +1,214 @@
#
# Please note not all available settings / options are set here.
# For a full list, see the wiki
#
# Monitor configuration
monitor=DP-2,1920x1080@144,0x1080,1
monitor=HDMI-A-1,1920x1080@60,1500x0,1
monitor=HDMI-A-2,1920x1080@60,1920x1080,1,transform,3
monitor=,preferred,auto,auto
# Clipboard history
exec-once = wl-paste --watch cliphist store
# Notifications
exec-once = dunst
# Polkit
exec-once = /usr/lib/polkit-kde-authentication-agent-1
# Wallpapers
exec-once = hyprpaper
# Launcher
exec-once = ulauncher --no-window-shadow --hide-window
# Kde Connect
exec-once = kdeconnect-indicator
# Bar
exec-once = eww daemon
exec-once = eww open bar
# Autostart applications
exec-once = firefox
exec-once = flatpak run org.mozilla.Thunderbird
exec-once = flatpak run com.discordapp.Discord
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
# Some default env vars.
env = XCURSOR_SIZE,24
env = QT_QPA_PLATFORMTHEME,qt5ct
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_layout = us
kb_variant = dvorak
kb_model =
kb_options = caps:escape
kb_rules =
follow_mouse = 1
touchpad {
natural_scroll = no
}
sensitivity = 0.1 # -1.0 - 1.0, 0 means no modification.
accel_profile = flat
}
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_out = 10
border_size = 1
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa)
layout = dwindle
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 5
blur {
enabled = yes
size = 3
passes = 1
new_optimizations = on
}
drop_shadow = yes
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
}
layerrule = blur,gtk-layer-shell
layerrule = ignorezero,gtk-layer-shell
animations {
enabled = yes
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 3, myBezier
animation = windowsOut, 1, 3, default, popin 80%
animation = border, 1, 5, default
animation = borderangle, 1, 4, default
animation = fade, 1, 3, default
animation = workspaces, 1, 2, default
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this
}
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true
}
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = off
}
# workspaces
workspace = HDMI-A-1, name:third
workspace = HDMI-A-2, name:second
workspace = 1, monitor:DP-2
workspace = 2, monitor:DP-2
workspace = 3, monitor:DP-2
workspace = 4, monitor:DP-2
workspace = 5, monitor:DP-2
workspace = 6, monitor:DP-2
workspace = 7, monitor:DP-2
workspace = 8, monitor:DP-2
workspace = 9, monitor:DP-2
workspace = 10, monitor:DP-2
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER
$mainModShift = SUPER_SHIFT
bind = $mainMod, return, exec, kitty
bind = $mainModShift, Q, killactive,
bind = $mainMod, F, togglefloating,
bind = $mainModShift, F, fullscreen
bind = $mainMod, E, exec, ulauncher-toggle #wofi --show drun
bind = $mainMod, V, exec, cliphist list | wofi --dmenu | cliphist decode | wl-copy
bind = CTRL, Print, exec, flameshot gui
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# Media keys
bind = ,XF86AudioPlay, exec, playerctl --player plasma-browser-integration play-pause
bind = ,XF86AudioPrev, exec, playerctl previous
bind = ,XF86AudioNext, exec, playerctl next
bind = ,XF86AudioLowerVolume, exec, playerctl --player plasma-browser-integration volume 0.01-
bind = ,XF86AudioRaiseVolume, exec, playerctl --player plasma-browser-integration volume 0.01+
# This is a dumb work around for hyprland not passing ALT half the time with the pass dispatcher.
bind = ALT, M, exec, xdotool key 'ALT+m'
bind = ALT, B, exec, xdotool key 'ALT+b'
#bind = ALT,M,pass,^(discord)$
#bind = ALT,B,pass,^(discord)$
# Window rules
# Auto workspace
windowrule = workspace 1 silent,firefox
windowrule = workspace name:second silent,discord
windowrule = workspace 10 silent,thunderbird
# ULauncher
windowrulev2 = forceinput,class:^(ulauncher)$
windowrulev2 = dimaround,class:^(ulauncher)$
# Flameshot
windowrulev2 = nofullscreenrequest,title:^(flameshot)$
windowrulev2 = float,title:^(flameshot)$
windowrulev2 = move 0 -1080,title:^(flameshot)$
windowrulev2 = noanim,title:^(flameshot)$
windowrulev2 = rounding 0,title:^(flameshot)$

7
hypr/hyprpaper.conf Normal file
View File

@ -0,0 +1,7 @@
preload = ~/Pictures/Wallpapers/digital-art-16-1920×1080.jpg
preload = ~/Pictures/Wallpapers/old-island-3-3840×2160.jpg
preload = ~/Pictures/Wallpapers/lava-dragon-3-1920×1080.jpg
wallpaper = DP-2, ~/Pictures/Wallpapers/digital-art-16-1920×1080.jpg
wallpaper = HDMI-A-1, ~/Pictures/Wallpapers/old-island-3-3840×2160.jpg
wallpaper = HDMI-A-2, ~/Pictures/Wallpapers/lava-dragon-3-1920×1080.jpg

View File

@ -1,433 +0,0 @@
{ inputs
, lib
, config
, pkgs
, ...
}:
{
options =
let
inherit (lib) mkOption types;
in
{
hyprland = {
mod = mkOption {
type = types.str;
default = "SUPER";
};
autoStart = mkOption {
type = types.listOf types.str;
default = [ ];
};
primaryMonitor = mkOption {
type = types.str;
};
monitors = mkOption {
type = types.listOf (types.submodule {
options = {
name = mkOption {
type = types.str;
};
width = mkOption {
type = types.int;
};
height = mkOption {
type = types.int;
};
refreshRate = mkOption {
type = types.int;
default = 60;
};
x = mkOption {
type = types.int;
default = 0;
};
y = mkOption {
type = types.int;
default = 0;
};
transform = mkOption {
type = types.int;
default = 0;
};
vrr = mkOption {
type = types.int;
default = 0;
};
enabled = mkOption {
type = types.bool;
default = true;
};
};
});
default = [ ];
};
environment = mkOption {
type = types.attrsOf types.str;
default = { };
};
sensitivity = mkOption {
type = types.float;
default = 0.0;
};
keyboard = {
layout = mkOption {
type = types.str;
default = "us";
};
variant = mkOption {
type = types.str;
default = "qwerty";
};
options = mkOption {
type = types.str;
default = "";
};
};
inner_gaps = mkOption { type = types.int; };
outer_gaps = mkOption { type = types.int; };
border = {
size = mkOption { type = types.int; };
active = mkOption { type = types.str; };
inactive = mkOption { type = types.str; };
};
animations = {
enable = mkOption {
type = types.bool;
default = true;
};
beziers = mkOption {
type = types.listOf types.str;
default = [
"myBezier, 0.05, 0.9, 0.1, 1.05"
];
};
windows = mkOption {
type = types.str;
default = "1, 3, myBezier";
};
windowsOut = mkOption {
type = types.str;
default = "1, 3, default, popin 80%";
};
border = mkOption {
type = types.str;
default = "1, 5, default";
};
borderangle = mkOption {
type = types.str;
default = "1, 4, default";
};
fade = mkOption {
type = types.str;
default = "1, 3, default";
};
workspaces = mkOption {
type = types.str;
default = "1, 2, default";
};
};
layout = mkOption { type = types.str; };
rounding = mkOption { type = types.int; };
blur = {
enable = mkOption {
type = types.bool;
default = true;
};
size = mkOption {
type = types.int;
default = 3;
};
passes = mkOption {
type = types.int;
default = 1;
};
};
shadow = {
enable = mkOption {
type = types.bool;
default = true;
};
range = mkOption {
type = types.int;
default = 4;
};
strength = mkOption {
type = types.int;
default = 3;
};
color = mkOption {
type = types.str;
default = "rgba(1a1a1aee)";
};
};
layerRules = mkOption {
type = types.attrsOf (types.listOf types.str);
default = { };
};
windowRules = mkOption {
type = types.attrsOf (types.listOf types.str);
default = { };
};
windowRulesV2 = mkOption {
type = types.attrsOf (types.listOf types.str);
default = { };
};
generateWorkspaceBinds = mkOption {
type = types.bool;
default = true;
};
generateWindowManagementBinds = mkOption {
type = types.bool;
default = true;
};
binds = mkOption {
type = types.attrsOf types.str;
default = { };
};
mouseBinds = mkOption {
type = types.attrsOf types.str;
default = { };
};
};
};
config =
let
cfg = config.hyprland;
in
{
home.packages = with pkgs; [
wl-clipboard
cliphist
ulauncher
];
wayland.windowManager.hyprland = {
enable = true;
settings = {
monitor = map
(m:
let
resolution = "${toString m.width}x${toString m.height}@${toString m.refreshRate}";
position = "${toString m.x}x${toString m.y}";
vrr = if m.vrr != 0 then ",vrr,${toString m.vrr}" else "";
transform = if m.transform != 0 then ",transform,${toString m.transform}" else "";
in
"${m.name},${if m.enabled then "${resolution},${position},1${vrr}${transform}" else "disable"}"
)
(cfg.monitors)
# Automatically detect newly connected monitors
++ [ ",preferred,auto,auto" ];
exec-once = [
"${pkgs.wl-clipboard}/bin/wl-paste --watch ${pkgs.cliphist}/bin/cliphist store"
"${pkgs.ulauncher}/bin/ulauncher --no-window-shadow --hide-window"
"${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"
# kde-connect (somehow, wasnt working well last time)
] ++ cfg.autoStart;
env = lib.mapAttrsToList (k: v: "${toString k},${v}") cfg.environment;
input = {
kb_layout = cfg.keyboard.layout;
kb_variant = cfg.keyboard.variant;
kb_options = cfg.keyboard.options;
follow_mouse = 1;
touchpad = {
natural_scroll = "yes";
};
sensitivity = cfg.sensitivity;
accel_profile = "flat";
};
general = {
gaps_in = cfg.inner_gaps;
gaps_out = cfg.outer_gaps;
border_size = cfg.border.size;
"col.active_border" = cfg.border.active;
"col.inactive_border" = cfg.border.inactive;
layout = cfg.layout;
};
misc = {
force_default_wallpaper = 2;
};
decoration = {
rounding = cfg.rounding;
blur = {
enabled = if cfg.blur.enable then "yes" else "no";
size = cfg.blur.size;
passes = cfg.blur.passes;
new_optimizations = "on";
};
drop_shadow = if cfg.shadow.enable then "yes" else "no";
shadow_range = cfg.shadow.range;
shadow_render_power = cfg.shadow.strength;
"col.shadow" = cfg.shadow.color;
};
dwindle = {
pseudotile = "yes";
preserve_split = "yes";
};
master = {
new_is_master = true;
};
gestures = {
workspace_swipe = "on";
};
animations = {
enabled = if cfg.animations.enable then "yes" else "no";
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = cfg.animations.beziers;
animation = [
"windows, ${cfg.animations.windows}"
"windowsOut, ${cfg.animations.windowsOut}"
"border, ${cfg.animations.border}"
"borderangle, ${cfg.animations.borderangle}"
"fade, ${cfg.animations.fade}"
"workspaces, ${cfg.animations.workspaces}"
];
};
layerrule =
let
y = ident: value: "${value},${ident}";
x = ident: values: map (y ident) values;
in
lib.flatten (lib.mapAttrsToList x cfg.layerRules);
workspace =
let
# Create one work space for each non primary monitor
perMonitorWorkspaces = map
(m: "${m.name}, name:${m.name}")
(lib.filter
(m: m.name != cfg.primaryMonitor)
cfg.monitors
);
# Create 10 work spaces on the primary monitor
primaryMonitorWorkspaces = map (i: "${toString i}, monitor:${cfg.primaryMonitor}") (lib.range 1 10);
in
primaryMonitorWorkspaces ++ perMonitorWorkspaces;
bind =
let
# Create binds to switch workspaces and move windows between them
workspaceBinds =
if cfg.generateWorkspaceBinds then
lib.flatten
(map
(i:
let
k = if i == 10 then 0 else i;
in
[
"${cfg.mod}, ${toString k}, workspace, ${toString i}"
"${cfg.mod} SHIFT, ${toString k}, movetoworkspace, ${toString i}"
]
)
(lib.range 1 10)
)
else
[ ];
# Create binds to manage wiwdows
windowManagementBinds =
if cfg.generateWindowManagementBinds then [
"${cfg.mod} SHIFT, Q, killactive"
"${cfg.mod}, F, togglefloating"
"${cfg.mod} SHIFT, F, fullscreen"
]
else
[ ];
configBinds = lib.mapAttrsToList (k: v: "${k}, ${v}") cfg.binds;
in
configBinds ++ workspaceBinds ++ windowManagementBinds;
bindm =
let
windowManagementBinds =
if cfg.generateWindowManagementBinds then [
"${cfg.mod}, mouse:272, movewindow"
"${cfg.mod}, mouse:273, resizewindow"
]
else
[ ];
configBinds = lib.mapAttrsToList (k: v: "${k}, ${v}") cfg.mouseBinds;
in
configBinds ++ windowManagementBinds;
windowrule =
let
y = ident: value: "${value},${ident}";
x = ident: values: map (y ident) values;
in
lib.flatten (lib.mapAttrsToList x cfg.windowRules);
windowrulev2 =
let
y = ident: value: "${value},${ident}";
x = ident: values: map (y ident) values;
in
lib.flatten (lib.mapAttrsToList x cfg.windowRulesV2);
};
};
};
}

View File

@ -1,59 +0,0 @@
{ inputs
, lib
, config
, pkgs
, ...
}:
{
options =
let
inherit (lib) mkOption types;
in
{
hyprpaper = {
wallpaperFolder = mkOption {
type = types.str;
};
};
};
config =
let
cfg = config.hyprpaper;
hyprlandCfg = config.hyprland;
changeWallpaperScript =
pkgs.writeShellScriptBin
"change-wallpaper"
(lib.concatStringsSep
"\n"
(lib.flatten
(map
(m:
let
output = m.name;
wallpaper = "\"$(${pkgs.findutils}/bin/find -L \"${cfg.wallpaperFolder}\" -type f | ${pkgs.coreutils}/bin/shuf -n 1)\"";
in
[
"wallpaper=${wallpaper}"
"${pkgs.hyprland}/bin/hyprctl hyprpaper preload $wallpaper"
"${pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper ${output},$wallpaper"
]
)
hyprlandCfg.monitors)
++ [ "${pkgs.hyprland}/bin/hyprctl hyprpaper unload all" ])
);
in
{
hyprland.autoStart = [
"${pkgs.hyprpaper}/bin/hyprpaper"
"sleep 2; ${changeWallpaperScript}/bin/change-wallpaper"
];
home.packages = with pkgs; [
hyprpaper
changeWallpaperScript
];
};
}

4
kitty/kitty.conf Normal file
View File

@ -0,0 +1,4 @@
font_family Fira Code
background_opacity 0.8
allow_remote_control yes

View File

@ -1,117 +0,0 @@
{ inputs
, config
, pkgs
, ...
}:
{
imports =
[
# Include the results of the hardware scan.
./hardware-configuration.nix
];
nix.settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Deduplicate and optimize nix store
auto-optimise-store = true;
};
nixpkgs.config.allowUnfree = true;
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "kalle-laptop";
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
useXkbConfig = true; # use xkbOptions in tty.
};
# Enable the X11 windowing system.
services.xserver = {
enable = true;
displayManager.sddm.enable = true;
desktopManager.plasma6.enable = true;
# Configure keymap in X11
xkb = {
layout = "us";
options = "eurosign:e,caps:escape";
};
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound.
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
users.users.kalle = {
isNormalUser = true;
group = "kalle";
extraGroups = [ "wheel" ]; # Enable sudo for the user.
};
users.groups.kalle.gid = 1000;
environment.systemPackages = with pkgs; [
xdg-user-dirs
];
fonts = {
enableDefaultPackages = true;
packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-color-emoji
fira-code
fira-code-symbols
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
];
fontconfig = {
defaultFonts = {
serif = [ "Noto Serif" "Symbols Nerd Font" ];
sansSerif = [ "Noto Sans" "Symbols Nerd Font" ];
monospace = [ "Fira Code" "Symbols Nerd Font Mono" ];
};
};
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Disable firewall.
networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
}

View File

@ -1,39 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/f39bc45f-1489-4fe3-8a2f-6f768563ce20";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/C42C-12CF";
fsType = "vfat";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -1,156 +0,0 @@
{ inputs
, config
, pkgs
, ...
}:
{
imports =
[
# Include the results of the hardware scan.
./hardware-configuration.nix
./hardware-configuration.override.nix
];
nix.settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Deduplicate and optimize nix store
auto-optimise-store = true;
};
services.btrfs.autoScrub.enable = true;
nixpkgs.config.allowUnfree = true;
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "kalle-pc";
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
useXkbConfig = true; # use xkbOptions in tty.
};
# Enable the X11 windowing system.
services.xserver = {
enable = true;
displayManager.sddm.enable = true;
# Configure keymap in X11
xkb.layout = "us";
# xkbVariant = "dvorak";
# xkbOptions = "eurosign:e,caps:escape";
};
# Allow flashing ZSA keyboards
hardware.keyboard.zsa.enable = true;
programs.hyprland = {
enable = true;
portalPackage = inputs.xdg-desktop-portal-hyprland.packages.x86_64-linux.xdg-desktop-portal-hyprland;
};
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound.
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
users.users.kalle = {
isNormalUser = true;
group = "kalle";
extraGroups = [ "wheel" "dialout" ]; # Enable sudo for the user.
};
users.groups.kalle.gid = 1000;
environment.systemPackages = with pkgs; [
xdg-user-dirs
grim # For xdg-desktop-portal-hyprland which does not declare this dependency
slurp # Some for this one
gamescope
pkgsi686Linux.gperftools # Needed for tf2
];
fonts = {
enableDefaultPackages = true;
packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-color-emoji
fira-code
fira-code-symbols
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
];
fontconfig = {
defaultFonts = {
serif = [ "Noto Serif" "Symbols Nerd Font" ];
sansSerif = [ "Noto Sans" "Symbols Nerd Font" ];
monospace = [ "Fira Code" "Symbols Nerd Font Mono" ];
};
};
};
# Steam needs to be installed on system level, because reasons
programs.steam = {
enable = true;
package = pkgs.steam.override {
extraPkgs = pkgs: with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
];
extraLibraries = pkgs: with pkgs; [
gperftools # Needed for tf2 to work
];
};
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Disable firewall.
networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
}

View File

@ -1,56 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/d453acaf-12a4-4f7a-b33e-90d87a086995";
fsType = "btrfs";
options = [ "subvol=root" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/d453acaf-12a4-4f7a-b33e-90d87a086995";
fsType = "btrfs";
options = [ "subvol=home" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/d453acaf-12a4-4f7a-b33e-90d87a086995";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/23F6-1045";
fsType = "vfat";
};
fileSystems."/swap" =
{ device = "/dev/disk/by-uuid/d453acaf-12a4-4f7a-b33e-90d87a086995";
fsType = "btrfs";
options = [ "subvol=swap" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp35s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -1,23 +0,0 @@
{ config, lib, pkgs, modulesPath, ...}:
{
fileSystems = {
# Extra filesystem configs to enable compression.
"/".options = [ "compress=zstd" ];
"/home".options = [ "compress=zstd" ];
"/nix".options = [ "compress=zstd" "noatime" ];
"/swap".options = [ "noatime" ];
# Mount other drives
"/mnt/games" = {
device = "/dev/disk/by-uuid/0ac05c3f-df12-458e-b145-e912febe1205";
fsType = "ext4";
};
"/mnt/external" = {
device = "/dev/disk/by-uuid/13e2dfc3-7b4d-44ac-9417-51b933a36917";
fsType = "ext4";
};
};
}

View File

@ -0,0 +1 @@
vim.opt.commentstring = "--%s"

View File

@ -0,0 +1,3 @@
vim.opt_local.textwidth = 80
vim.opt_local.colorcolumn = "81"
vim.opt_local.formatoptions:append("a")

View File

@ -0,0 +1,52 @@
require('bufferline').setup {
options = {
mode = 'buffers',
numbers = 'ordinal',
separator_style = 'slant',
show_buffer_icons = true,
show_buffer_close_icons = false,
show_close_icon = false,
always_show_bufferline = true,
right_mouse_command = function(bufnum) end,
middle_mouse_command = function(bufnum)
require('bufdelete').bufdelete(bufnum)
end,
custom_areas = {
right = function()
local result = {}
local seve = vim.diagnostic.severity
local error = #vim.diagnostic.get(0, {severity = seve.ERROR})
local warning = #vim.diagnostic.get(0, {severity = seve.WARN})
local info = #vim.diagnostic.get(0, {severity = seve.INFO})
local hint = #vim.diagnostic.get(0, {severity = seve.HINT})
if error ~= 0 then
table.insert(result, {text = "" .. error, fg = "#EC5241"})
end
if warning ~= 0 then
table.insert(result, {text = "" .. warning, fg = "#EFB839"})
end
if hint ~= 0 then
table.insert(result, {text = "" .. hint, fg = "#A3BA5E"})
end
if info ~= 0 then
table.insert(result, {text = "" .. info, fg = "#7EA9A7"})
end
return result
end,
},
offsets = {
{
filetype = "NvimTree",
text = function()
return vim.fn.getcwd()
end,
highlight = "Directory",
text_align = "left"
}
}
}
}

94
nvim/after/plugin/cmp.lua Normal file
View File

@ -0,0 +1,94 @@
local cmp = require'cmp'
local luasnip = require'luasnip'
cmp.setup({
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-n>'] = cmp.mapping.select_next_item(),
-- Add tab support
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<C-f>'] = cmp.mapping.scroll_docs(-4),
['<C-d>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Insert,
select = true,
})
}),
sources = cmp.config.sources({
{ name = 'path' }, -- file paths
{ name = 'nvim_lsp' }, -- from language server
{ name = 'nvim_lsp_signature_help'}, -- display function signatures with current parameter emphasized
{ name = 'luasnip' },
{ name = 'nvim_lua' }, -- complete neovim's Lua runtime API such vim.lsp.*
{ name = 'buffer' }, -- source current buffer
{ name = 'calc'}, -- source for math calculation
}),
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
formatting = {
fields = {'menu', 'abbr', 'kind'},
format = function(entry, item)
local menu_icon ={
nvim_lsp = 'λ',
vsnip = '',
buffer = 'Ω',
path = '🖫',
}
item.menu = menu_icon[entry.source.name]
return item
end,
},
})
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})

View File

@ -0,0 +1,14 @@
require('which-key').setup()
require('neogit').setup()
require('lualine').setup()
require('marks').setup()
require('Comment').setup()
require('illuminate').configure()
require("todo-comments").setup()
require("nvim-autopairs").setup()
require("fidget").setup()
require('nvim-highlight-colors').setup()
require('gitsigns').setup {
current_line_blame = true,
}

View File

@ -2,7 +2,7 @@
local function map(mode, keys, func, desc, silent)
local silent = silent == nil and true or silent
vim.keymap.set(mode, keys, func, { desc = desc, silent = silent })
vim.keymap.set(mode, keys, func, {desc = desc, silent = silent})
end
-- Movement between windows
@ -11,19 +11,18 @@ map('n', '<leader>j', function() vim.cmd.wincmd('j') end, "Window Down")
map('n', '<leader>k', function() vim.cmd.wincmd('k') end, "Window Up")
map('n', '<leader>l', function() vim.cmd.wincmd('l') end, "Window Right")
-- Harpoon keybinds
map('n', '<leader>mm', require('harpoon.mark').add_file, "[M]ark file in harpoon")
map('n', '<leader>mh', require('harpoon.ui').toggle_quick_menu, "[M]enu [H]arpoon")
map('n', '<leader>1', function() require('harpoon.ui').nav_file(1) end, "Harpoon [1]")
map('n', '<leader>2', function() require('harpoon.ui').nav_file(2) end, "Harpoon [2]")
map('n', '<leader>3', function() require('harpoon.ui').nav_file(3) end, "Harpoon [3]")
map('n', '<leader>4', function() require('harpoon.ui').nav_file(4) end, "Harpoon [4]")
map('n', '<leader>5', function() require('harpoon.ui').nav_file(5) end, "Harpoon [5]")
map('n', '<leader>6', function() require('harpoon.ui').nav_file(6) end, "Harpoon [6]")
map('n', '<leader>7', function() require('harpoon.ui').nav_file(7) end, "Harpoon [7]")
map('n', '<leader>8', function() require('harpoon.ui').nav_file(8) end, "Harpoon [8]")
map('n', '<leader>9', function() require('harpoon.ui').nav_file(9) end, "Harpoon [9]")
-- Buffer hotkeys
map('n', '<leader>1', function() vim.cmd.BufferLineGoToBuffer(1) end, 'Tab 1')
map('n', '<leader>2', function() vim.cmd.BufferLineGoToBuffer(2) end, 'Tab 2')
map('n', '<leader>3', function() vim.cmd.BufferLineGoToBuffer(3) end, 'Tab 3')
map('n', '<leader>4', function() vim.cmd.BufferLineGoToBuffer(4) end, 'Tab 4')
map('n', '<leader>5', function() vim.cmd.BufferLineGoToBuffer(5) end, 'Tab 5')
map('n', '<leader>6', function() vim.cmd.BufferLineGoToBuffer(6) end, 'Tab 6')
map('n', '<leader>7', function() vim.cmd.BufferLineGoToBuffer(7) end, 'Tab 7')
map('n', '<leader>8', function() vim.cmd.BufferLineGoToBuffer(8) end, 'Tab 8')
map('n', '<leader>9', function() vim.cmd.BufferLineGoToBuffer(9) end, 'Tab 9')
map('n', '<leader>tt', vim.cmd.NvimTreeToggle, '[T]oggle file [T]ree')
map('n', '<leader>tg', vim.cmd.Neogit, '[T]oggle [G]it view')
map('n', '<leader>tu', require('undotree').toggle, '[T]oggle [U]ndo tree')
@ -34,11 +33,12 @@ map('n', '<leader>q', vim.diagnostic.setloclist, 'Errors to [Q]uickfix')
map('n', '<leader>?', require('telescope.builtin').oldfiles, '[?] Find recently opened files')
map('n', '<leader><space>', require('telescope.builtin').find_files, '[ ]Search Files')
map('n', '<leader>sb', require('telescope.builtin').buffers, '[S]earch [B]uffers')
map('n', '<leader><space>', require('telescope.builtin').buffers, '[ ] Find existing buffers')
map('n', '<leader>sf', require('telescope.builtin').find_files, '[S]earch [F]iles')
map('n', '<leader>sh', require('telescope.builtin').help_tags, '[S]earch [H]elp')
map('n', '<leader>sw', require('telescope.builtin').grep_string, '[S]earch current [W]ord')
map('n', '<leader>sg', require('telescope.builtin').live_grep, '[S]earch by [G]rep')
map('n', '<leader>sd', require('telescope.builtin').diagnostics, '[S]earch [D]iagnostics')
map({ 'n', 't' }, '<A-t>', require("FTerm").toggle, 'Toggle Terminal')
map({'n', 't'}, '<A-t>', require("FTerm").toggle, 'Toggle Terminal')

132
nvim/after/plugin/lsp.lua Normal file
View File

@ -0,0 +1,132 @@
require("mason").setup()
require("mason-lspconfig").setup()
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
local on_attach = function(_, bufnr)
local nmap = function(keys, func, desc)
if desc then
desc = 'LSP: ' .. desc
end
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
end
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
nmap('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
-- See `:help K` for why this keymap
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
-- Lesser used LSP functionality
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
nmap('<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, '[W]orkspace [L]ist Folders')
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
if vim.lsp.buf.format then
vim.lsp.buf.format()
elseif vim.lsp.buf.formatting then
vim.lsp.buf.formatting()
end
end, { desc = 'Format current buffer with LSP' })
end
require("mason-lspconfig").setup_handlers({
function (server_name) -- default handler (optional)
if server_name == 'sumneko_lua' then
require("lspconfig")[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = {
Lua = {
diagnostics = {
globals = {'vim'}
},
runtime = {
version = "LuaJIT",
path = vim.split(package.path, ";")
},
workspace = {
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true
}
}
}
},
}
else
require("lspconfig")[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
}
end
end,
})
require('mason-nvim-dap').setup()
local rt_config = {
server = {
on_attach = on_attach,
settings = {
["rust-analyzer"] = {
checkOnSave = {
command = "clippy"
},
},
}
},
}
require('rust-tools').setup(rt_config)
-- LSP Diagnostics Options Setup
local sign = function(opts)
vim.fn.sign_define(opts.name, {
texthl = opts.name,
text = opts.text,
numhl = ''
})
end
sign({name = 'DiagnosticSignError', text = ''})
sign({name = 'DiagnosticSignWarn', text = ''})
sign({name = 'DiagnosticSignHint', text = ''})
sign({name = 'DiagnosticSignInfo', text = ''})
vim.diagnostic.config({
virtual_text = false,
signs = true,
update_in_insert = true,
underline = true,
severity_sort = false,
float = {
border = 'rounded',
source = 'always',
header = '',
prefix = '',
},
})
vim.cmd([[
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
]])
require('nvim-lightbulb').setup({autocmd = {enabled = true}})

View File

@ -0,0 +1,19 @@
require('nvim-tree').setup {
sort_by = 'case_sensitive',
view = {
adaptive_size = true,
},
renderer = {
group_empty = true,
highlight_git = true,
highlight_opened_files = "name",
indent_markers = {
enable = true,
},
},
filters = {
dotfiles = true,
},
}
require("lsp-file-operations").setup()

View File

@ -0,0 +1,13 @@
require('telescope').setup {
defaults = {
mappings = {
i = {
['<C-u>'] = false,
['<C-d>'] = false,
},
},
},
}
require("telescope").load_extension("ui-select")
pcall(require('telescope').load_extension, 'fzf')

View File

@ -0,0 +1,24 @@
require('nvim-treesitter.configs').setup {
ensure_installed = { "lua", "rust", "toml" },
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = {
enable = true
},
rainbow = {
enable = true,
extended_mode = true,
max_file_lines = nil,
},
autotag = {
enable = true,
}
}
-- Treesitter folding
vim.wo.foldmethod = 'expr'
vim.wo.foldexpr = 'nvim_treesitter#foldexpr()'
vim.o.foldenable = false

View File

@ -0,0 +1 @@
require('undotree').setup()

View File

@ -1,131 +0,0 @@
{ inputs
, lib
, config
, pkgs
, ...
}:
{
programs.neovim =
let
toLua = str: "lua << EOF\n${str}\nEOF\n";
toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n";
in
{
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
extraPackages = with pkgs; [
nodejs_21 # Required for copilot-vim
ripgrep # Required for telescope
wl-clipboard # Required for clipboard sync
# Language servers
clang-tools
lua-language-server
rnix-lsp
nodePackages.typescript-language-server
tailwindcss-language-server
];
plugins = with pkgs.vimPlugins; [
yuck-vim
{
plugin = which-key-nvim;
config = toLua "require('which-key').setup()";
}
neodev-nvim
plenary-nvim
{
plugin = telescope-nvim;
config = toLuaFile ./plugin/telescope.lua;
}
telescope-ui-select-nvim
FTerm-nvim
vim-fugitive
harpoon1
{
plugin = undotree-nvim;
config = toLua "require('undotree').setup()";
}
{
plugin = comment-nvim;
config = toLua "require('Comment').setup()";
}
{
plugin = todo-comments-nvim;
config = toLua "require('todo-comments').setup()";
}
{
plugin = neoconf-nvim;
config = toLua "require('neoconf').setup()";
}
{
plugin = catppuccin-nvim;
config = "colorscheme catppuccin-mocha";
}
cmp-nvim-lsp
cmp-nvim-lsp-signature-help
cmp-buffer
cmp-path
cmp-cmdline
cmp-git
cmp-calc
cmp_luasnip
copilot-cmp
luasnip
friendly-snippets
{
plugin = nvim-cmp;
config = toLuaFile ./plugin/cmp.lua;
}
{
plugin = nvim-lspconfig;
config = toLuaFile ./plugin/lsp.lua;
}
rust-tools-nvim
{
plugin = fidget-nvim;
config = toLua "require('fidget').setup({})";
}
rainbow-delimiters-nvim
{
plugin = (nvim-treesitter.withAllGrammars);
config = toLuaFile ./plugin/treesitter.lua;
}
{
plugin = copilot-lua;
config = toLua ''
require("copilot").setup({
suggestion = { enabled = false },
panel = { enabled = false },
})
'';
}
];
extraLuaConfig = ''
${builtins.readFile ./options.lua}
${builtins.readFile ./keymaps.lua}
'';
};
}

View File

@ -37,5 +37,28 @@ vim.opt.updatetime = 50
vim.opt.completeopt = { 'menuone', 'noselect', 'noinsert' }
vim.opt.shortmess = vim.opt.shortmess + { c = true }
vim.opt.timeoutlen = 1000 -- For agda unicode chars to work properly
-- Languagetool stuff
vim.g.languagetool_server_command = '/usr/bin/languagetool --http'
-- Load plugins
require('kalle.plugins')
vim.cmd.colorscheme('carbonfox')
vim.g.vimtex_compiler_latexmk = { -- Make vimtex allow shell-escape while compiling
options = {
'-shell-escape',
'-verbose',
'-file-line-error',
'-synctex=1',
'-interaction=nonstopmode'
}
}
-- Autoformat on save
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]
-- TODO:
-- - Debugger integration (gdb?, java?/kotlin?, rust?, etc) - nvim-dap and friends

135
nvim/lua/kalle/plugins.lua Normal file
View File

@ -0,0 +1,135 @@
vim.cmd([[
augroup packer_user_config
autocmd!
autocmd BufWritePost plugins.lua source <afile> | PackerCompile
augroup end
]])
local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap = fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim',
install_path })
vim.cmd [[packadd packer.nvim]]
end
return require('packer').startup({
function(use)
use('ashinkarov/nvim-agda')
use('lervag/vimtex')
use('vigoux/LanguageTool.nvim')
use('wbthomason/packer.nvim')
use('EdenEast/nightfox.nvim')
use('folke/which-key.nvim')
use('numToStr/FTerm.nvim')
use('brenoprata10/nvim-highlight-colors')
use('jiaoshijie/undotree')
use('j-hui/fidget.nvim')
use('elkowar/yuck.vim')
use('numToStr/Comment.nvim')
use('RRethy/vim-illuminate')
use {
'nvim-treesitter/nvim-treesitter',
run = function() require('nvim-treesitter.install').update({ with_sync = true }) end,
}
use('https://git.sr.ht/~p00f/nvim-ts-rainbow')
use('windwp/nvim-autopairs')
use('windwp/nvim-ts-autotag')
use {
'kosayoda/nvim-lightbulb',
requires = 'antoinemadec/FixCursorHold.nvim',
}
use {
'kyazdani42/nvim-tree.lua',
requires = {
'kyazdani42/nvim-web-devicons',
},
}
use {
'antosha417/nvim-lsp-file-operations',
requires = {
{ "nvim-lua/plenary.nvim" },
{ "kyazdani42/nvim-tree.lua" },
}
}
use {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
}
use('simrat39/rust-tools.nvim')
use('chentoast/marks.nvim')
use('neovim/nvim-lspconfig')
use('mfussenegger/nvim-dap')
use('rcarriga/nvim-dap-ui')
use('theHamsta/nvim-dap-virtual-text')
use('nvim-telescope/telescope-dap.nvim')
use('jayp0521/mason-nvim-dap.nvim')
use {
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-nvim-lsp-signature-help',
'hrsh7th/nvim-cmp',
'L3MON4D3/LuaSnip',
'saadparwaiz1/cmp_luasnip',
}
use 'famiu/bufdelete.nvim'
use {
'TimUntersberger/neogit',
'lewis6991/gitsigns.nvim',
}
use('nvim-lua/plenary.nvim')
use('nvim-lualine/lualine.nvim')
use {
'akinsho/bufferline.nvim', tag = "v2.*",
requires = 'kyazdani42/nvim-web-devicons'
}
use {
'nvim-telescope/telescope.nvim', tag = '0.1.0',
requires = {
'nvim-lua/plenary.nvim'
},
}
use('nvim-telescope/telescope-ui-select.nvim')
use('folke/todo-comments.nvim')
-- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins
if packer_bootstrap then
require('packer').sync()
end
end,
config = {
auto_reload_compiled = false, -- Automatically reload the compiled file after creating it.
display = {
open_fn = function()
return require('packer.util').float({ border = 'single' })
end
}
}
})
-- run bootstrap: nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'

View File

@ -1,102 +0,0 @@
local cmp = require 'cmp'
local luasnip = require 'luasnip'
require("copilot_cmp").setup()
local has_words_before = function()
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then return false end
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_text(0, line - 1, 0, line - 1, col, {})[1]:match("^%s*$") == nil
end
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-n>'] = cmp.mapping.select_next_item(),
-- Add tab support
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() and has_words_before() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<C-f>'] = cmp.mapping.scroll_docs(-4),
['<C-d>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Insert,
select = true,
})
}),
sources = cmp.config.sources({
{ name = "copilot", group_index = 2 },
{ name = 'path' }, -- file paths
{ name = 'nvim_lsp' }, -- from language server
{ name = 'nvim_lsp_signature_help' }, -- display function signatures with current parameter emphasized
{ name = 'luasnip' },
{ name = 'nvim_lua' }, -- complete neovim's Lua runtime API such vim.lsp.*
{ name = 'buffer' }, -- source current buffer
{ name = 'calc' }, -- source for math calculation
}),
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
formatting = {
fields = { 'menu', 'abbr', 'kind' },
format = function(entry, item)
local menu_icon = {
nvim_lsp = 'λ',
vsnip = '',
buffer = 'Ω',
path = '🖫',
}
item.menu = menu_icon[entry.source.name]
return item
end,
},
})
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})

View File

@ -1,134 +0,0 @@
local on_attach = function(_, bufnr)
local nmap = function(keys, func, desc)
if desc then
desc = 'LSP: ' .. desc
end
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
end
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
nmap('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
-- See `:help K` for why this keymap
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
-- Lesser used LSP functionality
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
nmap('<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, '[W]orkspace [L]ist Folders')
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
if vim.lsp.buf.format then
vim.lsp.buf.format()
elseif vim.lsp.buf.formatting then
vim.lsp.buf.formatting()
end
end, { desc = 'Format current buffer with LSP' })
end
-- LSP Diagnostics Options Setup
local sign = function(opts)
vim.fn.sign_define(opts.name, {
texthl = opts.name,
text = opts.text,
numhl = ''
})
end
sign({ name = 'DiagnosticSignError', text = '' })
sign({ name = 'DiagnosticSignWarn', text = '' })
sign({ name = 'DiagnosticSignHint', text = '' })
sign({ name = 'DiagnosticSignInfo', text = '' })
vim.diagnostic.config({
virtual_text = false,
signs = true,
update_in_insert = true,
underline = true,
severity_sort = false,
float = {
border = 'rounded',
source = 'always',
header = '',
prefix = '',
},
})
vim.cmd([[
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
]])
-- LSP Configuration
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
require('neodev').setup({
override = function(root_dir, library)
if root_dir:find("/home/kalle/.dots", 1, true) == 1 then
library.enabled = true
library.plugins = true
end
end,
})
require('lspconfig').lua_ls.setup {
on_attach = on_attach,
capabilities = capabilities,
root_dir = function()
return vim.loop.cwd()
end,
cmd = { "lua-language-server" },
settings = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
}
}
require('lspconfig').rnix.setup {
on_attach = on_attach,
capabilities = capabilities,
}
require('lspconfig').tsserver.setup {
on_attach = on_attach,
capabilities = capabilities,
}
require('lspconfig').tailwindcss.setup {
on_attach = on_attach,
capabilities = capabilities,
}
require('lspconfig').clangd.setup {
on_attach = on_attach,
capabilities = capabilities,
}
require('rust-tools').setup({
server = {
on_attach = on_attach,
settings = {
["rust-analyzer"] = {
checkOnSave = {
command = "clippy"
},
},
}
},
})

View File

@ -0,0 +1,339 @@
-- Automatically generated packer.nvim plugin loader code
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
return
end
vim.api.nvim_command('packadd packer.nvim')
local no_errors, error_msg = pcall(function()
_G._packer = _G._packer or {}
_G._packer.inside_compile = true
local time
local profile_info
local should_profile = false
if should_profile then
local hrtime = vim.loop.hrtime
profile_info = {}
time = function(chunk, start)
if start then
profile_info[chunk] = hrtime()
else
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
end
end
else
time = function(chunk, start) end
end
local function save_profiles(threshold)
local sorted_times = {}
for chunk_name, time_taken in pairs(profile_info) do
sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
end
table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
local results = {}
for i, elem in ipairs(sorted_times) do
if not threshold or threshold and elem[2] > threshold then
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
end
end
if threshold then
table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
end
_G._packer.profile_output = results
end
time([[Luarocks path setup]], true)
local package_path_str = "/home/kalle/.cache/nvim/packer_hererocks/2.1.1694285958/share/lua/5.1/?.lua;/home/kalle/.cache/nvim/packer_hererocks/2.1.1694285958/share/lua/5.1/?/init.lua;/home/kalle/.cache/nvim/packer_hererocks/2.1.1694285958/lib/luarocks/rocks-5.1/?.lua;/home/kalle/.cache/nvim/packer_hererocks/2.1.1694285958/lib/luarocks/rocks-5.1/?/init.lua"
local install_cpath_pattern = "/home/kalle/.cache/nvim/packer_hererocks/2.1.1694285958/lib/lua/5.1/?.so"
if not string.find(package.path, package_path_str, 1, true) then
package.path = package.path .. ';' .. package_path_str
end
if not string.find(package.cpath, install_cpath_pattern, 1, true) then
package.cpath = package.cpath .. ';' .. install_cpath_pattern
end
time([[Luarocks path setup]], false)
time([[try_loadstring definition]], true)
local function try_loadstring(s, component, name)
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
if not success then
vim.schedule(function()
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
end)
end
return result
end
time([[try_loadstring definition]], false)
time([[Defining packer_plugins]], true)
_G.packer_plugins = {
["Comment.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/Comment.nvim",
url = "https://github.com/numToStr/Comment.nvim"
},
["FTerm.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/FTerm.nvim",
url = "https://github.com/numToStr/FTerm.nvim"
},
["FixCursorHold.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/FixCursorHold.nvim",
url = "https://github.com/antoinemadec/FixCursorHold.nvim"
},
["LanguageTool.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/LanguageTool.nvim",
url = "https://github.com/vigoux/LanguageTool.nvim"
},
LuaSnip = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/LuaSnip",
url = "https://github.com/L3MON4D3/LuaSnip"
},
["bufdelete.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/bufdelete.nvim",
url = "https://github.com/famiu/bufdelete.nvim"
},
["bufferline.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/bufferline.nvim",
url = "https://github.com/akinsho/bufferline.nvim"
},
["cmp-buffer"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/cmp-buffer",
url = "https://github.com/hrsh7th/cmp-buffer"
},
["cmp-cmdline"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/cmp-cmdline",
url = "https://github.com/hrsh7th/cmp-cmdline"
},
["cmp-nvim-lsp"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
},
["cmp-nvim-lsp-signature-help"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp-signature-help",
url = "https://github.com/hrsh7th/cmp-nvim-lsp-signature-help"
},
["cmp-path"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/cmp-path",
url = "https://github.com/hrsh7th/cmp-path"
},
cmp_luasnip = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
url = "https://github.com/saadparwaiz1/cmp_luasnip"
},
["fidget.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/fidget.nvim",
url = "https://github.com/j-hui/fidget.nvim"
},
["gitsigns.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/gitsigns.nvim",
url = "https://github.com/lewis6991/gitsigns.nvim"
},
["lualine.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/lualine.nvim",
url = "https://github.com/nvim-lualine/lualine.nvim"
},
["marks.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/marks.nvim",
url = "https://github.com/chentoast/marks.nvim"
},
["mason-lspconfig.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim",
url = "https://github.com/williamboman/mason-lspconfig.nvim"
},
["mason-nvim-dap.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/mason-nvim-dap.nvim",
url = "https://github.com/jayp0521/mason-nvim-dap.nvim"
},
["mason.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/mason.nvim",
url = "https://github.com/williamboman/mason.nvim"
},
neogit = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/neogit",
url = "https://github.com/TimUntersberger/neogit"
},
["nightfox.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nightfox.nvim",
url = "https://github.com/EdenEast/nightfox.nvim"
},
["nvim-agda"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-agda",
url = "https://github.com/ashinkarov/nvim-agda"
},
["nvim-autopairs"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-autopairs",
url = "https://github.com/windwp/nvim-autopairs"
},
["nvim-cmp"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-cmp",
url = "https://github.com/hrsh7th/nvim-cmp"
},
["nvim-dap"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-dap",
url = "https://github.com/mfussenegger/nvim-dap"
},
["nvim-dap-ui"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-dap-ui",
url = "https://github.com/rcarriga/nvim-dap-ui"
},
["nvim-dap-virtual-text"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-dap-virtual-text",
url = "https://github.com/theHamsta/nvim-dap-virtual-text"
},
["nvim-highlight-colors"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-highlight-colors",
url = "https://github.com/brenoprata10/nvim-highlight-colors"
},
["nvim-lightbulb"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-lightbulb",
url = "https://github.com/kosayoda/nvim-lightbulb"
},
["nvim-lsp-file-operations"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-lsp-file-operations",
url = "https://github.com/antosha417/nvim-lsp-file-operations"
},
["nvim-lspconfig"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
url = "https://github.com/neovim/nvim-lspconfig"
},
["nvim-tree.lua"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
url = "https://github.com/kyazdani42/nvim-tree.lua"
},
["nvim-treesitter"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
url = "https://github.com/nvim-treesitter/nvim-treesitter"
},
["nvim-ts-autotag"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-ts-autotag",
url = "https://github.com/windwp/nvim-ts-autotag"
},
["nvim-ts-rainbow"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-ts-rainbow",
url = "https://git.sr.ht/~p00f/nvim-ts-rainbow"
},
["nvim-web-devicons"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
url = "https://github.com/kyazdani42/nvim-web-devicons"
},
["packer.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/packer.nvim",
url = "https://github.com/wbthomason/packer.nvim"
},
["plenary.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/plenary.nvim",
url = "https://github.com/nvim-lua/plenary.nvim"
},
["rust-tools.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/rust-tools.nvim",
url = "https://github.com/simrat39/rust-tools.nvim"
},
["telescope-dap.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/telescope-dap.nvim",
url = "https://github.com/nvim-telescope/telescope-dap.nvim"
},
["telescope-ui-select.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/telescope-ui-select.nvim",
url = "https://github.com/nvim-telescope/telescope-ui-select.nvim"
},
["telescope.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/telescope.nvim",
url = "https://github.com/nvim-telescope/telescope.nvim"
},
["todo-comments.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/todo-comments.nvim",
url = "https://github.com/folke/todo-comments.nvim"
},
undotree = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/undotree",
url = "https://github.com/jiaoshijie/undotree"
},
["vim-illuminate"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/vim-illuminate",
url = "https://github.com/RRethy/vim-illuminate"
},
vimtex = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/vimtex",
url = "https://github.com/lervag/vimtex"
},
["which-key.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/which-key.nvim",
url = "https://github.com/folke/which-key.nvim"
},
["yuck.vim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/yuck.vim",
url = "https://github.com/elkowar/yuck.vim"
}
}
time([[Defining packer_plugins]], false)
_G._packer.inside_compile = false
if _G._packer.needs_bufread == true then
vim.cmd("doautocmd BufRead")
end
_G._packer.needs_bufread = false
if should_profile then save_profiles() end
end)
if not no_errors then
error_msg = error_msg:gsub('"', '\\"')
vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
end

View File

@ -1,13 +0,0 @@
require('telescope').setup {
defaults = {
mappings = {
i = {
['<C-u>'] = false,
['<C-d>'] = false,
},
},
},
}
require("telescope").load_extension("ui-select")
pcall(require('telescope').load_extension, 'fzf')

View File

@ -1,9 +0,0 @@
require('nvim-treesitter.configs').setup {
ensure_installed = {},
auto_install = false,
highlight = { enable = true },
indent = { enable = true },
}

62
nvim/spell/en.utf-8.add Normal file
View File

@ -0,0 +1,62 @@
unnamedplus
updatetime
menuone
noselect
noinsert
kalle
utils
colorscheme
config
carbonfox
lua
github
nvim
treesitter
FixCursorHold
lightbulb
antoinemadec
kosayoda
kyazdani42
devicons
lspconfig
williamboman
simrat39
chentoast
neovim
mfussenegger
rcarriga
theHamsta
dap
ui
jayp0521
MunifTanjim
noice
folke
numToStr
EdenEast
wbthomason
nui
RRethy
hrsh7th
cmp
cmdline
vsnip
lsp
bufdelete
famiu
TimUntersberger
lewis6991
neogit
gitsigns
lualine
bufferline
akinsho
v2
todo
nightfox
FTerm
dto
api
loadPage
hits
Bruijn

BIN
nvim/spell/en.utf-8.add.spl Normal file

Binary file not shown.

View File

@ -1,24 +0,0 @@
{ inputs
, ...
}:
{
nvim-plugins = final: prev: {
vimPlugins = prev.vimPlugins // {
rainbow-delimiters-nvim = prev.vimUtils.buildVimPlugin {
name = "raindow-delimiters.nvim";
src = inputs.plugin-rainbow-delimiters-nvim;
};
undotree-nvim = prev.vimUtils.buildVimPlugin {
name = "undotree.nvim";
src = inputs.plugin-undotree-nvim;
};
harpoon1 = prev.vimUtils.buildVimPlugin {
name = "harpoon";
src = inputs.plugin-harpoon1;
};
};
};
}

11
scripts/click Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
sleep 3
for i in $(seq 250); do
xdotool mousedown 3
sleep 0.010
xdotool mouseup 3
sleep 0.010
done

10
scripts/confirm-menu Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
options="No\nNo\nNo\nNo\nNo\nYes"
selected=$(echo -e $options | rofi -p "$1" -mesg "Are you sure you want to run \"$2\"?" -dmenu -theme appsmenu)
case $selected in
"Yes")
$2
;;
esac

View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
cat | xargs -I '%' curl '%' -o /tmp/mpris-thumb 2>&1 | echo "/tmp/mpris-thumb"

32
scripts/git-stats Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
TOTALS=`git log --shortstat --author=$author | grep -E "fil(e|es) changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print files, " ", inserted, " ", deleted }'`
TOTAL_INSERTS=`echo $TOTALS | cut -d' ' -f2`
TOTAL_DELETES=`echo $TOTALS | cut -d' ' -f3`
TOTAL_TOTAL=$(( $TOTAL_INSERTS + $TOTAL_DELETES ))
IFS="
"
for author in `git log --format='%aN' | sort -u`; do
echo $author":"
USER=`git log --shortstat --author=$author | grep -E "fil(e|es) changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print files, " ", inserted, " ", deleted }'`
IFS=" "
USER_INSERTS=`echo $USER | cut -d' ' -f2`
USER_DELETES=`echo $USER | cut -d' ' -f3`
USER_TOTAL=`bc <<< "$USER_INSERTS + $USER_DELETES"`
PERC_INSERTS=`bc <<< $USER_INSERTS"* 100 /"$TOTAL_INSERTS`
PERC_DELETES=`bc <<< $USER_DELETES"* 100 /"$TOTAL_DELETES`
PERC_TOTAL=`bc <<< $USER_TOTAL"* 100 /"$TOTAL_TOTAL`
echo " TOTAL: $USER_TOTAL ($PERC_TOTAL%)"
echo " INSERTS: $USER_INSERTS ($PERC_INSERTS%)"
echo " DELETES: $USER_DELETES ($PERC_DELETES%)"
IFS="
"
done

12
scripts/new Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
TEMPLATE_DIR="$HOME/Templates/src"
src=`ls "$TEMPLATE_DIR" | fzf --preview="$HOME/.dots/scripts/template_preview $TEMPLATE_DIR/{}"`
if [ -n "$src" ]; then
read -p "File name: " name
if [ -n "$name" ]; then
cp "$TEMPLATE_DIR/$src" "$name" -r
fi
fi

14
scripts/playlist-dl Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -x
echo "Looking up playlist name..."
pl_line=$(yt-dlp --flat-playlist "$1" | grep "\[download\] Downloading playlist: ")
pl_name=$(echo ${pl_line:33} | tr '/' ' ')
echo "Found playlist by name: $pl_name"
echo "Downloading it into directory: $pl_name"
mkdir "$pl_name"
cd "$pl_name"
yt-dlp --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" "$1"
cd ../

17
scripts/power-menu Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
options="Shutdown\nReboot\nLogout"
selected=$(echo -e $options | rofi -p Power -dmenu -theme appsmenu)
case $selected in
"Shutdown")
confirm-menu "Shutdown?" "poweroff"
;;
"Reboot")
confirm-menu "Reboot?" "reboot"
;;
"Logout")
confirm-menu "Logout?" "i3-msg exit"
;;
esac

2
scripts/proj_preview Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
bat -pf "`project path "$1"`"/README.md

11
scripts/screen-share-toggle Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
USER=$(logname)
if [ -f "/tmp/$USER.screen-share" ]; then
screen -S "Screen Share" -X quit
rm "/tmp/$USER.screen-share"
else
screen -dmS "Screen Share" ffmpeg -f x11grab -video_size 1920x1080 -i :0+0,1050 -pix_fmt yuv420p -r 30 -f v4l2 /dev/video9
touch "/tmp/$USER.screen-share"
fi

30
scripts/speedrun-finder Executable file
View File

@ -0,0 +1,30 @@
#!/bin/python
import math
parts = input("First point? ").split(" ")
x1,z1,a1 = float(parts[6]),float(parts[8]),float(parts[9])
if a1 >= 90:
a1 = 180 - a1+90
else:
a1 = -1 * (a1+90)
s1 = -1 * math.tan(math.radians(a1))
i1 = z1 - s1 * x1
parts = input("Second point? ").split(" ")
x2,z2,a2 = float(parts[6]),float(parts[8]),float(parts[9])
if a2 >= 90:
a2 = 180 - a2+90
else:
a2 = -1 * (a2+90)
s2 = -1 * math.tan(math.radians(a2))
i2 = z2 - s2 * x2
x3 = (i2 - i1) / (s1 - s2)
z3 = s1 * x3 + i1
print(f"Stronghold at: {round(x3)}, {round(z3)}")
print(f"In nether: {round(x3/8)}, {round(z3/8)}")

7
scripts/speedrun-timer Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
STARTTIME=$(date +%s.%3N)
echo "End timing with ctrl-c."
while true; do
DUR=$(printf "%.3f" $(bc <<< $(date +%s.%3N)-$STARTTIME))
printf "\r%s " $(date +%T.%3N -u -d "@${DUR}")
done

3
scripts/start-krunner Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
krunner -d

3
scripts/start-obs Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
obs --startreplaybuffer --minimize-to-tray

8
scripts/template_preview Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
file="$TEMPLATE_DIR/$1"
if [ -d "$file" ]; then
tree -C "$file"
else
bat -pf "$file"
fi

21
scripts/timer-launcher Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
hours=$(echo -e "0\n1\n2\n3\n4\n5\n6" | rofi -dmenu -theme appsmenu)
if [ -z $hours ]; then
exit 0
fi
minutes=$(echo -e "0\n5\n10\n15\n30\n45" | rofi -dmenu -theme appsmenu)
if [ -z $minutes ]; then
exit 0
fi
seconds=$(echo -e "0\n10\n15\n30\n45" | rofi -dmenu -theme appsmenu)
if [ -z $seconds ]; then
exit 0
fi
timer $hours $minutes $seconds &

40
scripts/utilities-menu Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash
export PATH=$PATH:$HOME/bin/:$HOME/bin/scripts/
SCREEN_SHARE_OPTION="Start screen share"
if [ -f "/tmp/$USER.screen-share" ]; then
SCREEN_SHARE_OPTION="Stop screen share"
fi
WEBCAM_OPTION="Start good webcam"
if [ -f "/tmp/$USER.webcam" ]; then
WEBCAM_OPTION="Stop good webcam"
fi
DUNST_PAUSE_OPTION="Pause dunst notifications"
if [[ $(dunstctl is-paused) == "true" ]]; then
DUNST_PAUSE_OPTION="Resume dunst notifications"
fi
options="Power menu\nTimer\n$SCREEN_SHARE_OPTION\n$WEBCAM_OPTION\n$DUNST_PAUSE_OPTION"
selected=$(echo -e $options | rofi -p Utility -dmenu -theme appsmenu)
case $selected in
"Timer")
timer-launcher
;;
"$SCREEN_SHARE_OPTION")
screen-share-toggle
;;
"$WEBCAM_OPTION")
webcam-toggle
;;
"Power menu")
power-menu
;;
"$DUNST_PAUSE_OPTION")
dunstctl set-paused toggle
;;
esac

5
scripts/wacom-config Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
xsetwacom --set "Wacom Intuos3 6x8 Pad pad" MapToOutput HEAD-0
xsetwacom --set "Wacom Intuos3 6x8 Pen stylus" MapToOutput HEAD-0
xsetwacom --set "Wacom Intuos3 6x8 Pen eraser" MapToOutput HEAD-0
xsetwacom --set "Wacom Intuos3 6x8 Pen cursor" MapToOutput HEAD-0

11
scripts/webcam-toggle Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
USER=$(logname)
if [ -f "/tmp/$USER.webcam" ]; then
screen -S "Webcam" -X quit
rm "/tmp/$USER.webcam"
else
screen -dmS "Webcam" ffmpeg -video_size 1920x1080 -framerate 30 -c:v mjpeg -i /dev/video0 -c:v mjpeg -vf lenscorrection=k1=-0.1:k2=-0.05 -f v4l2 /dev/video8
touch "/tmp/$USER.webcam"
fi

20
scripts/window-menu Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
options="Close\nToggle floating\nToggle sticky\nToggle fullscreen"
selected=$(echo -e $options | rofi -p Window -dmenu -theme appsmenu)
case $selected in
"Close")
i3-msg "kill"
;;
"Toggle floating")
i3-msg "floating toggle"
;;
"Toggle sticky")
i3-msg "sticky toggle"
;;
"Toggle fullscreen")
i3-msg "fullscreen toggle"
;;
esac

52
setup.sh Executable file
View File

@ -0,0 +1,52 @@
#!/usr/bin/env bash
#
cd $(dirname $0)
DOTS_DIR=$(pwd)
function link_config {
NAME="$1"
TARGET="$2"
FROM="$DOTS_DIR/$3"
if [ -d "$TARGET" ]; then
echo "[$NAME] Configuration directory exists. Skipping."
else
ln -s "$FROM" "$TARGET"
fi
}
link_config "Dunst" "$HOME/.config/dunst" "dunst"
link_config "Kitty" "$HOME/.config/kitty" "kitty"
link_config "Eww" "$HOME/.config/eww" "eww"
# Neovim
NVIM_DIR="$HOME/.config/nvim"
# Check if the NVIM directory exists. If it does we skip this part of the script and inform the user.
if [ -d $NVIM_DIR ]; then
echo "[NVIM] Configuration directory exists. Skipping."
else
# Symlink the config.
ln -s $DOTS_DIR/nvim $NVIM_DIR
# Bootstrap the plugins
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
fi
# Scripts
SCRIPT_DIR="$HOME/bin/scripts"
# Check if the scripts directory exists. If it does we skip this part of the script and inform the user.
if [ -d $SCRIPT_DIR ]; then
echo "[SCRIPTS] Configuration directory exists. Skipping."
else
mkdir "$HOME/bin"
ln -s $DOTS_DIR/scripts $SCRIPT_DIR
fi
# Templates
TEMPLATE_DIR="$HOME/Templates"
rmdir "$TEMPLATE_DIR"
ln -s "$DOTS_DIR/Templates" "$TEMPLATE_DIR"

3
templates/scripts/latex-test Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
echo "Latex Test: '$1'"

12
templates/templ Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
BASE_DIR=`dirname "$0"`
TO_CREATE=`ls "$BASE_DIR"/scripts | fzf`
read -p "Directory [.]: " WHERE
WHERE=${WHERE:-.}
mkdir -p "$WHERE"
"$BASE_DIR/scripts/$TO_CREATE" "$WHERE"

View File

@ -1,38 +0,0 @@
{ inputs
, lib
, config
, pkgs
, ...
}:
{
programs.tmux = {
enable = true;
keyMode = "vi";
mouse = true;
baseIndex = 1;
escapeTime = 20;
terminal = "tmux-256color";
historyLimit = 100000;
plugins = with pkgs.tmuxPlugins;
[
better-mouse-mode
catppuccin
];
extraConfig = ''
# Use catppuccin-mocha theme.
set -g @catppuccin_flavour 'mocha'
# Other catppuccin settigns.
set -g @catppuccin_window_default_text "#{window_name}"
# Don't leave gaps inDon't leave gaps in window numbers.
set -g renumber-windows on
# Vim keys for pane navigation.
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
'';
};
}