Browse Source

feat: add some hyprland stuff

master
Tovi Jaeschke-Rogers 4 days ago
parent
commit
414b5b60b8
12 changed files with 142 additions and 29 deletions
  1. +20
    -1
      .config/alacritty/alacritty.toml
  2. +1
    -0
      .config/hypr/hyprWorkspaceLayouts
  3. +4
    -4
      .config/hypr/hypridle.conf
  4. +17
    -8
      .config/hypr/hyprland.conf
  5. +5
    -0
      .config/hypr/monitors.conf
  6. +4
    -0
      .config/hypr/workspaces.conf
  7. +6
    -0
      .config/nvim/lua/core/commands.lua
  8. +7
    -7
      .config/nvim/lua/plugins/telescope.lua
  9. +0
    -8
      .config/waybar/config.jsonc
  10. +1
    -1
      .config/waybar/style.css
  11. +71
    -0
      .local/bin/hyprland-monitor-switcher.sh
  12. +6
    -0
      .tmux.conf

+ 20
- 1
.config/alacritty/alacritty.toml View File

@ -2,4 +2,23 @@
import = ["~/.config/alacritty/cyberdream.toml"]
[window]
opacity = 0.95
opacity = 0.90
[font]
size = 10.0
[font.bold]
family = "JetBrainsMono NerdFont"
style = "Bold"
[font.bold_italic]
family = "JetBrainsMono NerdFont"
style = "Bold Italic"
[font.italic]
family = "JetBrainsMono NerdFont"
style = "Italic"
[font.normal]
family = "JetBrainsMono NerdFont"
style = "Regular"

+ 1
- 0
.config/hypr/hyprWorkspaceLayouts

@ -0,0 +1 @@
Subproject commit d74fa07f4484e7934a26c26cdbe168533451935d

+ 4
- 4
.config/hypr/hypridle.conf View File

@ -14,7 +14,7 @@ listener {
on-timeout = hyprctl dispatch dpms off # turn off display 30 seconds after lock
}
listener {
timeout = 1800 # 30 minutes
on-timeout = systemctl suspend # suspend system after 30 minutes
}
# listener {
# timeout = 1800 # 30 minutes
# on-timeout = systemctl suspend # suspend system after 30 minutes
# }

+ 17
- 8
.config/hypr/hyprland.conf View File

@ -5,9 +5,6 @@
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,auto
monitor = DP-1-8, preferred, auto, 1
monitor = DP-1-9, preferred, auto, 1
###################
### MY PROGRAMS ###
@ -27,7 +24,14 @@ $menu = wofi --show drun
exec-once = waybar
exec-once = hypridle
exec-once = hyprpaper
# We want this to run every time the config is refreshed
exec-once = hyprctl plugin load /home/tovi/.config/hypr/hyprWorkspaceLayouts/workspaceLayoutPlugin.so
plugin {
wslayout {
default_layout=master
}
}
#############################
### ENVIRONMENT VARIABLES ###
@ -79,7 +83,7 @@ general {
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
layout = master
layout=workspacelayout
}
# Master layout specific settings
@ -149,7 +153,8 @@ input {
kb_layout = us
kb_variant =
kb_model =
kb_options = caps:swapescape
# kb_options = kb_options = caps:swapescape
kb_options = =
kb_rules =
follow_mouse = 1
@ -191,11 +196,15 @@ bind = $mainMod, Q, killactive,
bind = $mainMod SHIFT, Q, exec, uwsm stop
bind = $mainMod, F, togglefloating,
bind = $mainMod, P, exec, $menu
bind = $mainMod, S, togglesplit, # dwindle
bind = $mainMod, M, exec, ~/.local/bin/hyprland-monitor-switcher.sh
bind = $mainMod SHIFT, L, exec, hyprlock
bind = $mainMod, S, exec, hyprshot -m region --clipboard-only
bind = $mainMod, Return, layoutmsg, swapwithmaster
bind = $mainMod, j, layoutmsg, swapnext
bind = $mainMod, k, layoutmsg, swapprev
bind = $mainMod, j, layoutmsg, cyclenext
bind = $mainMod, k, layoutmsg, cycleprev
bind = $mainMod, l, layoutmsg, mfact +0.05
bind = $mainMod, h, layoutmsg, mfact -0.05
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1


+ 5
- 0
.config/hypr/monitors.conf View File

@ -0,0 +1,5 @@
# Generated by nwg-displays on 2025-07-07 at 07:57:10. Do not edit manually.
monitor=eDP-1,1920x1080@60.0,1440x1080,1.0
monitor=DP-3,1920x1080@60.0,1440x0,1.0
monitor=DP-4,1920x1080@60.0,3360x0,1.0

+ 4
- 0
.config/hypr/workspaces.conf View File

@ -0,0 +1,4 @@
# Generated by nwg-displays on 2025-07-07 at 07:57:09. Do not edit manually.
workspace=1,monitor:DP-3,default:true
workspace=2,monitor:DP-4,default:true

+ 6
- 0
.config/nvim/lua/core/commands.lua View File

@ -27,3 +27,9 @@ end, {})
vim.api.nvim_create_user_command("CopyFilename", function()
vim.cmd('let @+ = expand("%")')
end, {})
vim.api.nvim_create_user_command("SnakeToCamel", function()
vim.cmd([[%s#\%($\%(\k\+\)\)\@<=_\(\k\)#\u\1#g]])
end, {})

+ 7
- 7
.config/nvim/lua/plugins/telescope.lua View File

@ -16,6 +16,13 @@ return {
local sorters = require("telescope.sorters")
local builtin = require("telescope.builtin")
vim.api.nvim_create_autocmd('User', {
pattern = 'TelescopePreviewerLoaded',
callback = function(args)
vim.wo.number = true
end,
})
local max_size = 100000
local truncate_large_files = function(filepath, bufnr, opts)
opts = opts or {}
@ -35,13 +42,6 @@ return {
end)
end
vim.api.nvim_set_hl(0, 'TelescopePromptBorder', { bg = 'none' })
vim.api.nvim_set_hl(0, 'TelescopeResultsBorder', { bg = 'none' })
vim.api.nvim_set_hl(0, 'TelescopePreviewBorder', { bg = 'none' })
vim.api.nvim_set_hl(0, 'TelescopePromptTitle', { bg = '#5ea1ff', fg = '#000000' })
vim.api.nvim_set_hl(0, 'TelescopeResultsTitle', { bg = '#bd5eff', fg = '#000000' })
vim.api.nvim_set_hl(0, 'TelescopePreviewTitle', { bg = '#5eff6c', fg = '#000000' })
telescope.setup({
defaults = {
file_sorter = sorters.get_fzy_sorter,


+ 0
- 8
.config/waybar/config.jsonc View File

@ -17,7 +17,6 @@
"clock"
],
"modules-right": [
"custom/weather",
"pulseaudio",
"temperature",
"network",
@ -141,12 +140,5 @@
"ignored-sinks": [
"Easy Effects Sink"
]
},
"custom/weather": {
"format": "{}°C",
"tooltip": true,
"interval": 3600,
"exec": "wttrbar --date-format \"%d.%m.%Y\" -l de",
"return-type": "json"
}
}

+ 1
- 1
.config/waybar/style.css View File

@ -1,7 +1,7 @@
* {
border: none;
border-radius: 0;
font-family: JetBrainsMono, Roboto, Helvetica, Arial, sans-serif;
font-family: JetBrainsMono NerdFont, Roboto, Helvetica, Arial, sans-serif;
font-size: 14px;
min-height: 0;
}


+ 71
- 0
.local/bin/hyprland-monitor-switcher.sh View File

@ -0,0 +1,71 @@
#!/bin/bash
# Hyprland Monitor Management Script
# Disables eDP-1 when both DP-5 and DP-6 are connected
# Function to check if a monitor is connected
check_monitor_connected() {
local monitor_name="$1"
hyprctl monitors -j | jq -r ".[].name" | grep -q "^${monitor_name}$"
}
# Function to check if a monitor is disabled
check_monitor_disabled() {
local monitor_name="$1"
hyprctl monitors -j | jq -r ".[] | select(.name == \"${monitor_name}\") | .disabled" 2>/dev/null
}
# Function to disable a monitor
disable_monitor() {
local monitor_name="$1"
echo "Disabling monitor: $monitor_name"
hyprctl keyword monitor "$monitor_name,disable"
}
# Function to enable a monitor (you might want to customize the resolution/position)
enable_monitor() {
local monitor_name="$1"
echo "Enabling monitor: $monitor_name"
# Adjust the resolution and position as needed for your eDP-1
hyprctl keyword monitor "$monitor_name,preferred,auto,1"
}
# Main logic
main() {
# Check if both external monitors are connected
if check_monitor_connected "DP-5" && check_monitor_connected "DP-6"; then
echo "Both DP-5 and DP-6 are connected"
# Check if eDP-1 is currently enabled
if check_monitor_connected "eDP-1"; then
local edp_disabled=$(check_monitor_disabled "eDP-1")
if [[ "$edp_disabled" == "false" ]]; then
echo "eDP-1 is enabled, disabling it..."
disable_monitor "eDP-1"
else
echo "eDP-1 is already disabled"
fi
else
echo "eDP-1 is not detected"
fi
else
echo "Not both external monitors are connected"
# Check if eDP-1 exists and is disabled, then enable it
if check_monitor_connected "eDP-1"; then
local edp_disabled=$(check_monitor_disabled "eDP-1")
if [[ "$edp_disabled" == "true" ]]; then
echo "eDP-1 is disabled, enabling it..."
enable_monitor "eDP-1"
else
echo "eDP-1 is already enabled"
fi
else
echo "eDP-1 is not detected"
fi
fi
}
# Run the main function
main "$@"

+ 6
- 0
.tmux.conf View File

@ -6,6 +6,9 @@ bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
set-option -g status-position top
# Renumber windows on window close
set -g renumber-windows on
# set window split
bind v split-window -h -c "#{pane_current_path}"
bind b split-window -v -c "#{pane_current_path}"
@ -89,5 +92,8 @@ set -g @plugin 'catppuccin/tmux#v2.1.3'
set -g @catppuccin_flavour "cyberdream"
run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

Loading…
Cancel
Save