Make everything work in NixOS

This commit is contained in:
tarneo 2024-01-14 18:59:49 +01:00
parent 0e1b904aef
commit 2a458129da
Signed by: tarneo
GPG Key ID: BA924E53D0EB3FCC
14 changed files with 120 additions and 122 deletions

View File

@ -1,69 +0,0 @@
[colors.bright]
black = "0x928374"
blue = "0x83a598"
cyan = "0x8ec07c"
green = "0xb8bb26"
magenta = "0xd3869b"
red = "0xfb4934"
white = "0xebdbb2"
yellow = "0xfabd2f"
[colors.normal]
black = "0x282828"
blue = "0x458588"
cyan = "0x689d6a"
green = "0x98971a"
magenta = "0xb16286"
red = "0xcc241d"
white = "0xa89984"
yellow = "0xd79921"
[colors.primary]
background = "0x282828"
foreground = "0xebdbb2"
[cursor]
blink_interval = 500
blink_timeout = 10
thickness = 0.25
unfocused_hollow = false
[cursor.style]
blinking = "On"
shape = "Beam"
[cursor.vi_mode_style]
shape = "Beam"
[env]
TERM = "xterm-256color"
[font]
size = 14
[font.normal]
family = "Fantasque Sans Mono"
style = "Regular"
[[keyboard.bindings]]
chars = "\u001B[13;2u"
key = "Return"
mods = "Shift"
[[keyboard.bindings]]
chars = "\u001B[13;5u"
key = "Return"
mods = "Control"
[mouse]
hide_when_typing = true
[scrolling]
history = 100000
[window]
dynamic_padding = true
[window.padding]
x = 5
y = 5

View File

@ -0,0 +1,57 @@
colors:
bright:
black: "0x928374"
blue: "0x83a598"
cyan: "0x8ec07c"
green: "0xb8bb26"
magenta: "0xd3869b"
red: "0xfb4934"
white: "0xebdbb2"
yellow: "0xfabd2f"
normal:
black: "0x282828"
blue: "0x458588"
cyan: "0x689d6a"
green: "0x98971a"
magenta: "0xb16286"
red: "0xcc241d"
white: "0xa89984"
yellow: "0xd79921"
primary:
background: "0x282828"
foreground: "0xebdbb2"
cursor:
blink_interval: 500
blink_timeout: 10
thickness: 0.25
unfocused_hollow: false
style:
blinking: On
shape: Beam
vi_mode_style:
shape: Beam
env:
TERM: xterm-256color
font:
size: 8
normal:
family: FantasqueSansM Nerd Font
style: Regular
keyboard:
bindings:
- chars: "\e[13;2u"
key: Return
mods: Shift
- chars: "\e[13;5u"
key: Return
mods: Control
mouse:
hide_when_typing: true
scrolling:
history: 100000
window:
dynamic_padding: true
padding:
x: 5
y: 5

View File

@ -1,7 +1,7 @@
local awful = require("awful")
local wibox = require("wibox")
local gears = require("gears")
local lain = require("lain")
-- local lain = require("lain")
local widget = wibox.widget.textbox()
@ -25,36 +25,36 @@ local function daemon ()
end)
end
local function toggle ()
get_vpn_status(function(status)
local new
if status then
new = "down"
else
new = "up"
end
-- local function toggle ()
-- get_vpn_status(function(status)
-- local new
-- if status then
-- new = "down"
-- else
-- new = "up"
-- end
local quake = lain.util.quake({
app = "alacritty --class VpnQuake",
argname = "--title %s -e sudo wg-quick " .. new .. " vpn",
followtag = true,
height = 0.3,
width = 0.3,
vert = "center",
horiz = "center",
border = 2,
name = "VpnQuake",
settings = function(c) c.sticky = true end
})
quake:toggle()
end)
end
-- local quake = lain.util.quake({
-- app = "alacritty --class VpnQuake",
-- argname = "--title %s -e sudo wg-quick " .. new .. " vpn",
-- followtag = true,
-- height = 0.3,
-- width = 0.3,
-- vert = "center",
-- horiz = "center",
-- border = 2,
-- name = "VpnQuake",
-- settings = function(c) c.sticky = true end
-- })
-- quake:toggle()
-- end)
-- end
widget:connect_signal("button::press", function(_, _, _, button)
if button == 1 then
toggle()
end
end)
-- widget:connect_signal("button::press", function(_, _, _, button)
-- if button == 1 then
-- toggle()
-- end
-- end)
gears.timer {
timeout = 1,

View File

@ -9,11 +9,11 @@ local gears = require("gears")
local naughty = require("naughty")
require("awful.hotkeys_popup.keys")
local lain = require("lain")
-- local lain = require("lain")
local org_quake = lain.util.quake({ app = "alacritty --class OrgQuake", argname = "--title %s -e nvim org/fast.org", followtag = true, height = 0.9, width = 0.9, vert = "center", horiz = "center", border = 2, name = "OrgQuake", settings = function(c) c.sticky = true end })
-- local org_quake = lain.util.quake({ app = "alacritty --class OrgQuake", argname = "--title %s -e nvim org/fast.org", followtag = true, height = 0.9, width = 0.9, vert = "center", horiz = "center", border = 2, name = "OrgQuake", settings = function(c) c.sticky = true end })
local weechat_quake = lain.util.quake({ app = "alacritty --class WeechatQuake", argname = "--title %s -e ssh cocinero-tarneo -t \"tmux a -t weechat\"", followtag = true, height = 0.9, width = 0.9, vert = "center", horiz = "center", border = 2, name = "WeechatQuake", settings = function(c) c.sticky = true end })
-- local weechat_quake = lain.util.quake({ app = "alacritty --class WeechatQuake", argname = "--title %s -e ssh cocinero-tarneo -t \"tmux a -t weechat\"", followtag = true, height = 0.9, width = 0.9, vert = "center", horiz = "center", border = 2, name = "WeechatQuake", settings = function(c) c.sticky = true end })
ModKey = "Mod4"
@ -32,9 +32,9 @@ local globalkeys = gears.table.join(
-- Zathura: PDF viewer. Archlinux package: zathura.
awful.key({ ModKey, }, "z", function() awful.spawn.with_shell("zathura") end),
-- Open org quake terminal
awful.key({ ModKey, }, "j", function() org_quake:toggle() end),
-- awful.key({ ModKey, }, "j", function() org_quake:toggle() end),
-- Open weechat quake terminal
awful.key({ ModKey, }, "k", function() weechat_quake:toggle() end),
-- awful.key({ ModKey, }, "k", function() weechat_quake:toggle() end),
-- ncmpcpp: terminal music player/mpd frontend. Archlinux package: ncmpcpp.
awful.key({ ModKey, }, "slash", function() awful.spawn.with_shell(TerminalCmd .. " ncmpcpp") end),

View File

@ -32,14 +32,14 @@ theme.fg_accent = theme.color11
theme.fg_inactive = theme.color14
-- ADD THE GAAAAP
theme.useless_gap = 10
theme.useless_gap = 5
theme.gap_single_client = true
theme.bar_bg = theme.background
theme.bar_fg = theme.foreground
theme.font = "Fantasque Sans Mono 14"
theme.bar_height = 30
theme.font = "FantasqueSansM Nerd Font 8"
theme.bar_height = 18
theme.bg_normal = theme.background
theme.bg_focus = theme.background

View File

@ -85,7 +85,7 @@ After this snippet, ~use-package~ is available and all packages are installed wi
* Appearance
** Set font
#+BEGIN_SRC emacs-lisp
(set-face-attribute 'default nil :font "Fantasque Sans Mono-9")
(set-face-attribute 'default nil :font "FantasqueSansM Nerd Font-9")
#+END_SRC
** Disable some UI elements
#+BEGIN_SRC emacs-lisp

View File

@ -54,7 +54,7 @@
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)
(set-face-attribute 'default nil :font "Fantasque Sans Mono-9")
(set-face-attribute 'default nil :font "FantasqueSansM Nerd Font-9")
(menu-bar-mode -1)
(tool-bar-mode -1)

View File

@ -471,11 +471,11 @@ require("lazy").setup({
dap.listeners.before.event_terminated.dapui_config = function() dapui.close() end
dap.listeners.before.event_exited.dapui_config = function() dapui.close() end
require("dap-python").setup("/usr/bin/python3")
require("dap-python").setup("/usr/bin/env python3")
dap.adapters.lldb = {
type = 'executable',
command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path
command = '/usr/bin/env lldb-vscode', -- adjust as needed, must be absolute path
name = 'lldb'
}

View File

@ -41,7 +41,7 @@ my_bar = bar.Bar(
)
widget_defaults = dict(
font="Fantasque Sans Mono",
font="FantasqueSansM Nerd Font",
fontsize=20,
padding=5,
)

View File

@ -13,9 +13,9 @@ c.url.start_pages = "https://searx.renn.es"
config.bind("<Ctrl+p>", "hint links spawn mpv --ytdl-format=bestvideo+bestaudio/best {hint-url}")
# Set default zoom level to 80%
c.zoom.default = "120%"
c.zoom.default = "70%"
c.fonts.default_size = "14pt"
c.fonts.default_size = "8pt"
# Open pdfs in browser
c.content.pdfjs = False

View File

@ -15,7 +15,7 @@ BAR_HEIGHT_SMALL=18
USELESS_GAP_LARGE=10
USELESS_GAP_SMALL=5
external=$(xrandr | grep " connected " | grep -o "DisplayPort-[0-9]*")
external=$(xrandr | grep " connected " | grep -o "^DP-[0-9]*")
if [ $(echo "$external" | wc -l) -gt 1 ]; then
echo "More than one external display is connected, doing nothing"
@ -35,10 +35,10 @@ if [ "$external" = "" ]; then
useless_gap_to=$USELESS_GAP_LARGE
xrandr --output eDP --auto
xrandr --output eDP-1 --auto
# Disable other displays just in case (they still count as connected and
# will mess up the size of the desktop and available space for apps)
other_displays=$(xrandr | grep -o "DisplayPort-[0-9]*")
other_displays=$(xrandr | grep -o "^DP-[0-9]*")
for display in $other_displays; do
xrandr --output "$display" --off
done
@ -54,7 +54,7 @@ elif [ "$(echo "$external" | wc -l)" -eq 1 ]; then
useless_gap_from=$USELESS_GAP_LARGE
useless_gap_to=$USELESS_GAP_SMALL
xrandr --output eDP --off
xrandr --output eDP-1 --off
xrandr --output "$external" --auto
fi
@ -62,7 +62,7 @@ fi
# Every one of these takes a single argument, which is the value to replace the
# placeholder with.
alacritty_font_size() {
echo "size = ${1}"
echo " size: ${1}"
}
qutebrowser_font_size() {
echo "c.fonts.default_size = \"${1}pt\""
@ -71,7 +71,7 @@ qutebrowser_zoom() {
echo "c.zoom.default = \"${1}%\""
}
awesome_font_size() {
echo "theme.font = \"Fantasque Sans Mono ${1}\""
echo "theme.font = \"FantasqueSansM Nerd Font ${1}\""
}
awesome_bar_height() {
echo "theme.bar_height = ${1}"
@ -88,7 +88,7 @@ awesome_useless_gap() {
# - Otherwise, send a notification to the user so they can fix the config file
# Alacritty (reloading is automatic)
alacritty_config=~/.config/alacritty/alacritty.toml
alacritty_config=~/.config/alacritty/alacritty.yml
if grep -q "^$(alacritty_font_size "$font_size_from")$" $alacritty_config; then
sed -i "s/^$(alacritty_font_size "$font_size_from")$/$(alacritty_font_size "$font_size_to")/" $alacritty_config
elif ! grep -q "^$(alacritty_font_size "$font_size_to")$" $alacritty_config; then

View File

@ -1,10 +1,10 @@
#! /bin/bash
#!/bin/sh
# This script is used to sync a local directory with a remote one using unison.
# It notifies you when a conflict occurs and allows you to resolve it manually by running the script again with the -i option.
# Change the following variables to suit your needs:
REMOTE_HOST="cocinero-tarneo" # the remote host to sync with.
REMOTE_HOST="tarneo@cocinero" # the remote host to sync with.
REMOTE_DIR="sync" # the remote directory
LOCAL_DIR="$HOME/.sync" # the local directory, preferably an absolute path.

View File

@ -206,6 +206,11 @@ alias ta="tmux attach -t"
alias rennes="ssh -t cocinero \"./start-tmux\""
# By default nix-shell doesn't use the user's shell for purity.
# With this, we both start Zsh instead of bash, and also use Zsh in all
# subsequent shells, e.g. tmux sessions (which would otherwise use bash).
alias nix-zshell="nix-shell --command 'SHELL=zsh zsh'"
# Little scripts with curl
wttr() { curl -s "wttr.in/$1" }
picopinout() { curl -s https://gabmus.org/pico_pinout | bat -p }

View File

@ -24,6 +24,11 @@ rtmux() {
}
htmux() {
if ! command -v hugo &> /dev/null ; then
nix-shell -p hugo --command "SHELL=$SHELL zsh -ic htmux"
return
fi
local session_name="$(__dir_to_tmux_session_name)"
# Verify we are in a Hugo project