mirror of
https://github.com/Cian-H/dotfiles.git
synced 2025-12-22 19:31:57 +00:00
Changed . token to _dot
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
This commit is contained in:
16
dot_config/hypr/HomeManagerInit_inputs.conf
Normal file
16
dot_config/hypr/HomeManagerInit_inputs.conf
Normal file
@@ -0,0 +1,16 @@
|
||||
input {
|
||||
kb_layout = us
|
||||
kb_variant =
|
||||
kb_model =
|
||||
kb_options =
|
||||
kb_rules =
|
||||
|
||||
follow_mouse = 1
|
||||
|
||||
touchpad {
|
||||
natural_scroll = true
|
||||
}
|
||||
|
||||
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
|
||||
}
|
||||
|
||||
2
dot_config/hypr/appearance.conf
Normal file
2
dot_config/hypr/appearance.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
# Animation preferences
|
||||
bezier = easeInOutBack,0.05,0.9,0.1,1.1
|
||||
75
dot_config/hypr/binds.conf
Normal file
75
dot_config/hypr/binds.conf
Normal file
@@ -0,0 +1,75 @@
|
||||
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
|
||||
bind = $mainMod, Q, exec, $terminal
|
||||
bind = $mainMod, W, exec, $browser
|
||||
bind = $mainMod, E, exec, $fileManager
|
||||
bind = $mainMod, R, exec, $menu
|
||||
bind = $mainMod, T, exec, $screenshot
|
||||
bind = $mainMod, ESCAPE, exec, $lockscreen
|
||||
bind = $mainMod SHIFT, T, exec, $colorpicker
|
||||
bind = $mainMod, ., exec, $emojipicker
|
||||
bind = $mainMod, C, killactive,
|
||||
bind = $mainMod, V, togglefloating,
|
||||
bind = $mainMod, M, exit,
|
||||
bind = $mainMod, P, pseudo, # dwindle
|
||||
bind = $mainMod, ;, togglesplit, # dwindle
|
||||
|
||||
# Move focus with mainMod + arrow keys
|
||||
bind = $mainMod, left, movefocus, l
|
||||
bind = $mainMod, down, movefocus, d
|
||||
bind = $mainMod, up, movefocus, u
|
||||
bind = $mainMod, right, movefocus, r
|
||||
bind = $mainMod, H, movefocus, l
|
||||
bind = $mainMod, J, movefocus, d
|
||||
bind = $mainMod, K, movefocus, u
|
||||
bind = $mainMod, L, movefocus, r
|
||||
|
||||
# Move active window around workspaces with mainMod + SHIFT + arrow keys
|
||||
bind = $mainMod SHIFT, left, movewindow, l
|
||||
bind = $mainMod SHIFT, down, movetoworkspace, +1
|
||||
bind = $mainMod SHIFT, up, movetoworkspace, -1
|
||||
bind = $mainMod SHIFT, right, movewindow, r
|
||||
bind = $mainMod SHIFT, H, movewindow, l
|
||||
bind = $mainMod SHIFT, J, movetoworkspace, +1
|
||||
bind = $mainMod SHIFT, K, movetoworkspace, -1
|
||||
bind = $mainMod SHIFT, L, movewindow, r
|
||||
|
||||
# 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
|
||||
|
||||
# Example special workspace (scratchpad)
|
||||
bind = $mainMod, S, togglespecialworkspace, magic
|
||||
bind = $mainMod SHIFT, S, movetoworkspace, special:magic
|
||||
|
||||
# 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 key bindings
|
||||
binde=, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+
|
||||
binde=, XF86AudioLowerVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-
|
||||
binde=, XF86AudioMute, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 0%
|
||||
26
dot_config/hypr/hyprland.conf
Normal file
26
dot_config/hypr/hyprland.conf
Normal file
@@ -0,0 +1,26 @@
|
||||
# Some default env vars.
|
||||
env = SDL_VIDEODRIVER,wayland
|
||||
env = CLUTTER_BACKEND,wayland
|
||||
env = HYPRCURSOR_THEME,"phinger-cursor"
|
||||
env = HYPRCURSOR_SIZE,28
|
||||
|
||||
$terminal = kitty
|
||||
$fileManager = thunar
|
||||
$browser = zen
|
||||
$lockscreen = hyprlock
|
||||
$colorpicker = hyprpicker
|
||||
$emojipicker = smile
|
||||
$screenshot = hyprshot --mode region -o ~/Pictures/Screenshot/
|
||||
$menu = wofi --show drun --normal window --prompt "Run application"
|
||||
$mainMod = SUPER
|
||||
|
||||
source = monitors.conf
|
||||
source = variables.conf
|
||||
source = rules.conf
|
||||
source = binds.conf
|
||||
source = inputs.conf
|
||||
source = appearance.conf
|
||||
|
||||
exec-once = pueued -d
|
||||
exec-once = waybar
|
||||
exec-once = hyprpaper
|
||||
76
dot_config/hypr/hyprlock.conf
Normal file
76
dot_config/hypr/hyprlock.conf
Normal file
@@ -0,0 +1,76 @@
|
||||
background {
|
||||
monitor =
|
||||
path = ~/Pictures/Wallpapers/City_1_Upscaled.png
|
||||
color = rgba(25, 20, 20, 1.0)
|
||||
|
||||
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
|
||||
blur_passes = 0 # 0 disables blurring
|
||||
blur_size = 7
|
||||
noise = 0.0117
|
||||
contrast = 0.8916
|
||||
brightness = 0.8172
|
||||
vibrancy = 0.1696
|
||||
vibrancy_darkness = 0.0
|
||||
}
|
||||
|
||||
image {
|
||||
monitor =
|
||||
path = ~/Pictures/Avatars/Avatar.jpg
|
||||
size = 192 # lesser side if not 1:1 ratio
|
||||
rounding = -1 # negative values mean circle
|
||||
border_size = 4
|
||||
border_color = rgb(7aa2f7)
|
||||
rotate = 0 # degrees, counter-clockwise
|
||||
reload_time = -1 # seconds between reloading, 0 to reload with SIGUSR2
|
||||
reload_cmd = # command to get new path. if empty, old path will be used. don't run "follow" commands like tail -F
|
||||
|
||||
position = 0, 200
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
input-field {
|
||||
monitor =
|
||||
size = 420, 50
|
||||
outline_thickness = 3
|
||||
dots_size = 0.33 # Scale of input-field height, 0.2 - 0.8
|
||||
dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0
|
||||
dots_center = true
|
||||
dots_rounding = -1 # -1 default circle, -2 follow input-field rounding
|
||||
outer_color = rgb(7aa2f7)
|
||||
inner_color = rgb(1a1b26)
|
||||
font_color = rgb(c0caf5)
|
||||
fade_on_empty = true
|
||||
fade_timeout = 1000 # Milliseconds before fade_on_empty is triggered.
|
||||
placeholder_text = <i>Input Password...</i> # Text rendered in the input box when it's empty.
|
||||
hide_input = false
|
||||
rounding = -1 # -1 means complete rounding (circle/oval)
|
||||
check_color = rgb(204, 136, 34)
|
||||
fail_color = rgb(204, 34, 34) # if authentication failed, changes outer_color and fail message color
|
||||
fail_text = <i>$FAIL <b>($ATTEMPTS)</b></i> # can be set to empty
|
||||
fail_timeout = 2000 # milliseconds before fail_text and fail_color disappears
|
||||
fail_transition = 300 # transition time in ms between normal outer_color and fail_color
|
||||
capslock_color = -1
|
||||
numlock_color = -1
|
||||
bothlock_color = -1 # when both locks are active. -1 means don't change outer color (same for above)
|
||||
invert_numlock = false # change color if numlock is off
|
||||
swap_font_color = false # see below
|
||||
|
||||
position = 0, -20
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
label {
|
||||
monitor =
|
||||
text = Hi there, $USER
|
||||
text_align = center # center/right or any value for default left. multi-line text alignment inside label container
|
||||
color = rgb(c0caf5)
|
||||
font_size = 25
|
||||
font_family = Noto Sans
|
||||
rotate = 0 # degrees, counter-clockwise
|
||||
|
||||
position = 0, 80
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
7
dot_config/hypr/hyprpaper.conf
Normal file
7
dot_config/hypr/hyprpaper.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
preload = ~/Pictures/Wallpapers/City_1_Upscaled.png
|
||||
splash = true
|
||||
|
||||
wallpaper = eDP-1,~/Pictures/Wallpapers/City_1_Upscaled.png
|
||||
wallpaper = DP-4,~/Pictures/Wallpapers/City_1_Upscaled.png
|
||||
wallpaper = DP-5,~/Pictures/Wallpapers/City_1_Upscaled.png
|
||||
wallpaper = DP-6,~/Pictures/Wallpapers/City_1_Upscaled.png
|
||||
2
dot_config/hypr/kb_layouts.txt
Normal file
2
dot_config/hypr/kb_layouts.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
ie
|
||||
us
|
||||
5
dot_config/hypr/monitors.conf
Normal file
5
dot_config/hypr/monitors.conf
Normal file
@@ -0,0 +1,5 @@
|
||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||
monitor=,preferred,auto,auto
|
||||
monitor=eDP-1,1920x1080@60,auto,1.2
|
||||
monitor=DP-6,1920x1080@60,auto,auto,transform,3
|
||||
monitor=DP-4,2560x1440@144,auto-left,auto
|
||||
2
dot_config/hypr/rules.conf
Normal file
2
dot_config/hypr/rules.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
windowrulev2 = stayfocused,class:(wofi)
|
||||
windowrulev2 = noborder,class:(wofi)
|
||||
8
dot_config/hypr/utils/build_utils.sh
Normal file
8
dot_config/hypr/utils/build_utils.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
SCRIPT_PATH="$(realpath "$0")"
|
||||
SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
|
||||
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
go build -o ./cycle_kb_layout ./src/cycle_kb_layout.go
|
||||
BIN
dot_config/hypr/utils/cycle_kb_layout
Normal file
BIN
dot_config/hypr/utils/cycle_kb_layout
Normal file
Binary file not shown.
148
dot_config/hypr/utils/src/cycle_kb_layout.go
Normal file
148
dot_config/hypr/utils/src/cycle_kb_layout.go
Normal file
@@ -0,0 +1,148 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const valueToChange = "kb_layout"
|
||||
|
||||
func readLayouts(layoutFile string) ([]string, error) {
|
||||
file, err := os.Open(layoutFile)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
var layouts []string
|
||||
scanner := bufio.NewScanner(file)
|
||||
for scanner.Scan() {
|
||||
layout := strings.TrimSpace(scanner.Text())
|
||||
if layout != "" {
|
||||
layouts = append(layouts, layout)
|
||||
}
|
||||
}
|
||||
|
||||
if err := scanner.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// To prevent index out of range error in toggleLine function
|
||||
layouts = append(layouts, layouts[0]) // Cycle back to the first layout
|
||||
|
||||
return layouts, nil
|
||||
}
|
||||
|
||||
func isTargetLine(line string) bool {
|
||||
return strings.Contains(line, valueToChange)
|
||||
}
|
||||
|
||||
func readCurrentConfig(configFile string) ([]string, error) {
|
||||
file, err := os.Open(configFile)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
var lines []string
|
||||
scanner := bufio.NewScanner(file)
|
||||
for scanner.Scan() {
|
||||
lines = append(lines, scanner.Text())
|
||||
}
|
||||
|
||||
if err := scanner.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return lines, nil
|
||||
}
|
||||
|
||||
func writeNewConfig(lines []string, configFile string) error {
|
||||
file, err := os.Create(configFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
for _, line := range lines {
|
||||
_, err := file.WriteString(line + "\n")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func toggleLine(line string, layouts []string) string {
|
||||
var builder strings.Builder
|
||||
|
||||
indentLength := len(line) - len(strings.TrimLeft(line, " \t"))
|
||||
builder.Grow(len(line)) // Preallocate enough space to avoid multiple allocations
|
||||
|
||||
builder.WriteString(strings.Repeat(" ", indentLength))
|
||||
|
||||
codeAndComments := strings.SplitN(line, "#", 2)
|
||||
code := strings.TrimSpace(codeAndComments[0])
|
||||
tokens := strings.Fields(code)
|
||||
currentLayout := tokens[len(tokens)-1]
|
||||
index := (strings.Index(strings.Join(layouts, " "), currentLayout)/len(currentLayout) + 1) % len(layouts)
|
||||
tokens[len(tokens)-1] = layouts[index]
|
||||
builder.WriteString(strings.Join(tokens, " "))
|
||||
|
||||
if len(codeAndComments) > 1 {
|
||||
builder.WriteString(" # ")
|
||||
builder.WriteString(codeAndComments[1])
|
||||
}
|
||||
|
||||
return builder.String()
|
||||
}
|
||||
|
||||
func cycleKbLayout(configFile, layoutFile string) error {
|
||||
layouts, err := readLayouts(layoutFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
lines, err := readCurrentConfig(configFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var newLines []string
|
||||
for _, line := range lines {
|
||||
if isTargetLine(line) {
|
||||
line = toggleLine(line, layouts)
|
||||
}
|
||||
newLines = append(newLines, line)
|
||||
}
|
||||
|
||||
return writeNewConfig(newLines, configFile)
|
||||
}
|
||||
|
||||
// Define flags for the input files
|
||||
var configFile = flag.String("c", "inputs.conf", "Path to the configuration file")
|
||||
var layoutFile = flag.String("l", "kb_layouts.txt", "Path to the keyboard layout file")
|
||||
|
||||
func main() {
|
||||
// Parse command-line flags
|
||||
flag.Parse()
|
||||
|
||||
// Determine the absolute paths based on provided flags
|
||||
hyprDir, err := filepath.Abs(filepath.Dir(os.Args[0]))
|
||||
if err != nil {
|
||||
fmt.Println("Error getting directory: %v", err)
|
||||
}
|
||||
|
||||
configFilePath := filepath.Join(hyprDir, *configFile)
|
||||
layoutFilePath := filepath.Join(hyprDir, *layoutFile)
|
||||
|
||||
// Call the cycleKbLayout function with the paths from the flags
|
||||
if err := cycleKbLayout(configFilePath, layoutFilePath); err != nil {
|
||||
fmt.Println("Error cycling keyboard layout: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
3
dot_config/hypr/utils/src/go.mod
Normal file
3
dot_config/hypr/utils/src/go.mod
Normal file
@@ -0,0 +1,3 @@
|
||||
module cycle_kb_layout
|
||||
|
||||
go 1.21.8
|
||||
64
dot_config/hypr/variables.conf
Normal file
64
dot_config/hypr/variables.conf
Normal file
@@ -0,0 +1,64 @@
|
||||
general {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
|
||||
gaps_in = 6
|
||||
gaps_out = 6
|
||||
border_size = 2
|
||||
col.active_border = rgb(7aa2f7)
|
||||
col.inactive_border = rgba(595959aa)
|
||||
|
||||
layout = dwindle
|
||||
|
||||
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
|
||||
allow_tearing = false
|
||||
}
|
||||
|
||||
decoration {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
|
||||
rounding = 8
|
||||
|
||||
blur {
|
||||
enabled = true
|
||||
size = 3
|
||||
passes = 1
|
||||
|
||||
vibrancy = 0.1696
|
||||
}
|
||||
|
||||
drop_shadow = true
|
||||
shadow_range = 4
|
||||
shadow_render_power = 3
|
||||
col.shadow = rgba(1a1a1aee)
|
||||
}
|
||||
|
||||
animations {
|
||||
enabled = true
|
||||
|
||||
# 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, 7, myBezier
|
||||
animation = windowsOut, 1, 7, default, popin 80%
|
||||
animation = border, 1, 10, default
|
||||
animation = borderangle, 1, 8, default
|
||||
animation = fade, 1, 7, default
|
||||
animation = workspaces, 1, 6, default
|
||||
}
|
||||
|
||||
dwindle {
|
||||
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
|
||||
pseudotile = true # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
|
||||
preserve_split = true # you probably want this
|
||||
}
|
||||
|
||||
gestures {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
workspace_swipe = false
|
||||
}
|
||||
|
||||
misc {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers
|
||||
}
|
||||
Reference in New Issue
Block a user