Compare commits
8 Commits
8c30126267
...
fa6f170e78
| Author | SHA1 | Date | |
|---|---|---|---|
|
fa6f170e78
|
|||
|
36e62c9bbf
|
|||
|
0642124a2b
|
|||
|
aa2dc6ea15
|
|||
|
9c40ab1ef4
|
|||
|
2a7ae7ee34
|
|||
|
5176480fe3
|
|||
|
d950725e34
|
18
tree/.config/hypr/hypridle.conf
Normal file
18
tree/.config/hypr/hypridle.conf
Normal file
@ -0,0 +1,18 @@
|
||||
general {
|
||||
lock_cmd = screenlock
|
||||
unlock_cmd = pkill -USR1 swaylock
|
||||
#before_sleep_cmd = notify-send "Zzz" # command ran before sleep
|
||||
#after_sleep_cmd = notify-send "Awake!" # command ran after sleep
|
||||
ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam)
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 585 # seconds
|
||||
on-timeout = notify-set idle-lock -t 14000 "Idle" "Locking in 15s..."
|
||||
on-resume = notify-set idle-lock -t 1000 "Idle" "Never mind."
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 600 # seconds
|
||||
on-timeout = loginctl lock-session
|
||||
}
|
||||
@ -132,6 +132,8 @@ windowrule=size 300 100,title:Volume
|
||||
windowrule=move 100%-375 75,title:Volume
|
||||
windowrule=rounding 35,title:Volume
|
||||
windowrule=nofocus,title:Volume
|
||||
windowrule=float,title:Jitsi Meet
|
||||
windowrule=move 100%-375 75,title:Jitsi Meet
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
$mainMod = ALT
|
||||
|
||||
@ -820,12 +820,14 @@ alias gp = git push
|
||||
alias gpu = git push -u origin
|
||||
alias gsta = git stash push
|
||||
alias gstp = git stash pop
|
||||
alias gw = git switch
|
||||
alias bt = bluetoothctl
|
||||
alias d = cd ~/.config/dotfiles/tree
|
||||
alias xo = xdg-open
|
||||
|
||||
# random scripts
|
||||
source ~/.local/nu/readelf.nu
|
||||
source ~/.local/nu/mullvad.nu
|
||||
|
||||
# init zoxide
|
||||
source ~/.cache/zoxide.nu
|
||||
|
||||
@ -84,6 +84,7 @@ $env.PATH = ($env.PATH | split row (char esep) | prepend [
|
||||
($env.HOME + "/.volta/bin"),
|
||||
])
|
||||
|
||||
$env.SSH_AUTH_SOCK = $"($env.XDG_RUNTIME_DIR)/ssh-agent.socket"
|
||||
$env.GPG_TTY = (tty)
|
||||
$env.BROWSER = "firefox"
|
||||
$env.EDITOR = "nvim"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
// "layer": "top", // Waybar at top layer
|
||||
"layer": "top", // Waybar at top layer
|
||||
"position": "bottom", // Waybar position (top|bottom|left|right)
|
||||
"height": 26, // Waybar height (to be removed for auto height)
|
||||
// "width": 1280, // Waybar width
|
||||
|
||||
@ -30,8 +30,10 @@ sudo pacman --needed -S \
|
||||
noto-fonts-emoji \
|
||||
noto-fonts-extra \
|
||||
nushell \
|
||||
pamixer \
|
||||
ripgrep \
|
||||
rustup \
|
||||
sad \
|
||||
tig \
|
||||
vim \
|
||||
waybar \
|
||||
@ -59,6 +61,7 @@ fi
|
||||
paru -S hyprpaper-git findex-bin wdisplays eww-wayland
|
||||
|
||||
cargo install --locked --git https://git.nubo.sh/hulthe/lockscreen-blur.git
|
||||
cargo install --locked --git https://git.nubo.sh/hulthe/volume_indicator.git
|
||||
|
||||
# cargo binstall
|
||||
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
||||
|
||||
16
tree/.local/bin/notify-set
Executable file
16
tree/.local/bin/notify-set
Executable file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Send a notification using notify-send, but also give it a name to make it easily replaceable.
|
||||
|
||||
ID="$1"
|
||||
DIR="/tmp/notify-ids/$(whoami)"
|
||||
ID_PATH="$DIR/$ID"
|
||||
|
||||
mkdir -p "$DIR"
|
||||
|
||||
REPLACE_ID="$(cat "$ID_PATH" 2>/dev/null)";
|
||||
if [ -n "$REPLACE_ID" ]; then
|
||||
REPLACE_ID="--replace-id=$REPLACE_ID"
|
||||
fi
|
||||
|
||||
notify-send $REPLACE_ID --print-id "${@:2}" > "$ID_PATH"
|
||||
25
tree/.local/nu/mullvad.nu
Normal file
25
tree/.local/nu/mullvad.nu
Normal file
@ -0,0 +1,25 @@
|
||||
# Get a Mullvad api access token from an account number
|
||||
def m-token [
|
||||
account: string # Mullvad account number
|
||||
] {
|
||||
(http post https://api.mullvad.net/auth/v1/token
|
||||
-t application/json {account_number: $account}
|
||||
).access_token
|
||||
}
|
||||
|
||||
# Add a device to a mullvad account
|
||||
def m-add-device [
|
||||
account: string # Mullvad account number
|
||||
] {
|
||||
let token = (m-token $account)
|
||||
let bearer = ("Bearer " + $token)
|
||||
|
||||
(http post https://api.mullvad.net/accounts/v1/devices
|
||||
-t application/json
|
||||
-H [Authorization $bearer]
|
||||
{
|
||||
pubkey: (wg genkey | wg pubkey),
|
||||
hijack_dns: false,
|
||||
kind: "App",
|
||||
})
|
||||
}
|
||||
@ -1,36 +1,13 @@
|
||||
#!/bin/env nu
|
||||
|
||||
def elf-sections [
|
||||
# Inpect ELF-files
|
||||
def elf [
|
||||
elf: string # ELF-file to inspect
|
||||
get?: cell-path
|
||||
] {
|
||||
LANG=C readelf --wide --sections $elf |
|
||||
parse -r " +\\[ *\\S+\\] +(?<name>\\.\\S+) +(?<type>\\S+) +0*(?<addr>\\S+) +0*(?<off>\\S+) +0*(?<size>\\S+).*" |
|
||||
into int -r 16 "addr" "off" "size"
|
||||
|
||||
}
|
||||
|
||||
def elf-symbols [
|
||||
elf: string # ELF-file to inspect
|
||||
--section (-s): string
|
||||
] {
|
||||
|
||||
let symbols = (
|
||||
LANG=C readelf --wide --syms --demangle=rust $elf |
|
||||
tail -n +5 |
|
||||
parse -r " *(?<num>\\d+): (?<addr>\\S+) +(?<size>\\S+) +(?<type>\\S+) +(?<bind>\\S+) +(?<vis>\\S+) +(?<ndx>\\S+) (?<name>.*)" |
|
||||
into int "size" |
|
||||
into int "num" |
|
||||
into int -r 16 "addr"
|
||||
)
|
||||
|
||||
|
||||
if $section == null {
|
||||
$symbols
|
||||
if $get == null {
|
||||
^elf $elf | from json
|
||||
} else {
|
||||
let section = (elf-sections $elf | where name == $section | first)
|
||||
let section_start = ($section | get addr)
|
||||
let section_end = ($section_start + ($section | get size))
|
||||
|
||||
$symbols | where addr >= $section_start and addr < $section_end
|
||||
^elf $elf | from json | get $get
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user