From 773ce006f066804c137545efbad131ab92a01018 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 9 Jun 2022 19:29:23 +0200 Subject: [PATCH] feat: add hyprland config --- configs/hypr/hyprland.conf | 115 ++++++++++++++++++++++++++ configs/hypr/scripts/bg-switcher | 13 +++ configs/kitty/current-theme.conf | 42 +++++----- configs/kitty/kitty.conf | 2 +- configs/kitty/kitty.conf.bak | 2 +- configs/nvim/ftplugin/markdown.vim | 4 +- configs/nvim/lua/configs/tree.lua | 22 ++--- configs/nvim/lua/core/keymappings.lua | 15 ++-- configs/sway/config | 14 ++-- configs/waybar/config | 39 +++++---- configs/waybar/scripts/set-theme | 2 +- configs/waybar/style.css | 42 ++++------ configs/wofi/scripts/open-project | 12 ++- 13 files changed, 229 insertions(+), 95 deletions(-) create mode 100644 configs/hypr/hyprland.conf create mode 100755 configs/hypr/scripts/bg-switcher diff --git a/configs/hypr/hyprland.conf b/configs/hypr/hyprland.conf new file mode 100644 index 0000000..cf141b8 --- /dev/null +++ b/configs/hypr/hyprland.conf @@ -0,0 +1,115 @@ +# This is an example Hyprland config file. +# Syntax is the same as in Hypr, but settings might differ. +# +# Refer to the wiki for more information. + +monitor=,1920x1080@60,0x0,2 +workspace=DP-1,1,name:Code + +input { + kb_layout= de + kb_variant= + kb_model= + kb_options= + kb_rules= + + follow_mouse=1 + natural_scroll=1 +} + +general { + sensitivity=0.8 + main_mod=SUPER + + gaps_in=5 + gaps_out=5 + border_size=1 + col.active_border=0x00 + col.inactive_border=0x00 + + damage_tracking=full # leave it on full unless you hate your GPU and want to make it suffer +} + +decoration { + rounding=10 + blur=0 + blur_size=3 # minimum 1 + blur_passes=1 # minimum 1, more passes = more resource intensive. + bezier=overshot,0.05,0.9,0.1,1.1 + # Your blur "amount" is blur_size * blur_passes, but high blur_size (over around 5-ish) will produce artifacts. + # if you want heavy blur, you need to up the blur_passes. + # the more passes, the more you can up the blur_size without noticing artifacts. +} + +animations { + enabled=1 + bezier=overshot,0.62,0,0,1 + animation=windows,1,2,overshot + animation=borders,1,2,default + animation=fadein,1,2,default + animation=workspaces,1,2,overshot +} + +dwindle { + pseudotile=1 # enable pseudotiling on dwindle +} + +exec="systemctl --user import-environment SWAYSOCK XDG_CURRENT_DESKTOP WAYLAND_DISPLAY" +exec-once=swaybg --image $(find $HOME/.customization/background -type f | shuf -n 1) -m fill +exec-once=/usr/lib/kdeconnectd +exec-once=waybar +# Dimms the screen +exec-once=wlsunset -l 39.47 -L -0.3821346 +exec=wl-paste -t text --watch clipman store --no-persist + +# Generic Bindings + +# Launch programs +bind=SUPER,Return,exec,kitty -e "tmux" +bind=SUPER,B,exec,firefox-developer-edition +bind=SUPER,D,exec,wofi --show drun +bind=SUPER,E,exec,nautilus +bind=SUPER,comma,exec,gnome-control-center + +# Wofi programs +bind=SUPERSHIFT,Q,exec,$HOME/.config/wofi/scripts/power-menu +bind=SUPER,P,exec,rofi-rbw --selector wofi --clipboarder wl-copy + +# Screenshot sections +bind=SUPERSHIFT,I,exec,grim -g "$(slurp -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:- | tail -n 1 | cut -d ' ' -f 4 | wl-copy + +# Media Keys +bind=,XF86MonBrightnessUp,exec,brightnessctl set +70 +bind=,XF86MonBrightnessDown,exec,brightnessctl set 70- + +# Layout Bindings +bind=SUPER,Q,killactive, +bind=SUPER,V,togglefloating, +bind=SUPER,F,fullscreen, + +bind=SUPER,left,movefocus,l +bind=SUPER,right,movefocus,r +bind=SUPER,up,movefocus,u +bind=SUPER,down,movefocus,d + +bind=SUPER,1,workspace,1 +bind=SUPER,2,workspace,2 +bind=SUPER,3,workspace,3 +bind=SUPER,4,workspace,4 +bind=SUPER,5,workspace,5 +bind=SUPER,6,workspace,6 +bind=SUPER,7,workspace,7 +bind=SUPER,8,workspace,8 +bind=SUPER,9,workspace,9 +bind=SUPER,0,workspace,10 + +bind=SHIFTSUPER,exclam,movetoworkspace,1 +bind=SHIFTSUPER,@,movetoworkspace,2 +bind=SHIFTSUPER,numbersign,movetoworkspace,3 +bind=SHIFTSUPER,dollar,movetoworkspace,4 +bind=SHIFTSUPER,percent,movetoworkspace,5 +bind=SHIFTSUPER,asciicircum,movetoworkspace,6 +bind=SHIFTSUPER,ampersand,movetoworkspace,7 +bind=SHIFTSUPER,asterisk,movetoworkspace,8 +bind=SHIFTSUPER,parenleft,movetoworkspace,9 +bind=SHIFTSUPER,parenright,movetoworkspace,10 diff --git a/configs/hypr/scripts/bg-switcher b/configs/hypr/scripts/bg-switcher new file mode 100755 index 0000000..81c55a1 --- /dev/null +++ b/configs/hypr/scripts/bg-switcher @@ -0,0 +1,13 @@ +#!/bin/zsh +swaybg --image $(find $HOME/.customization/background/ -type f | shuf -n 1) -m fill& +function handle { + if [[ ${1:0:9} == "workspace" ]]; then + echo $line + swpid=`ps axf | grep swaybg | grep -v grep | awk '{printf $1}'` + swaybg --image $(find $HOME/.customization/background | shuf -n 1) -m fill& + sleep .3 + kill $swpid + fi +} + +socat - UNIX-CONNECT:/tmp/hypr/_1654794872/.socket2.sock | while read line; do handle $line; done diff --git a/configs/kitty/current-theme.conf b/configs/kitty/current-theme.conf index 056ef3b..29f8f9e 100644 --- a/configs/kitty/current-theme.conf +++ b/configs/kitty/current-theme.conf @@ -1,21 +1,21 @@ -background #f8f8f8 -foreground #2a2b33 -cursor #bbbbbb -selection_background #ececec -color0 #000000 -color8 #000000 -color1 #de3d35 -color9 #de3d35 -color2 #3e953a -color10 #3e953a -color3 #d2b67b -color11 #d2b67b -color4 #2f5af3 -color12 #2f5af3 -color5 #950095 -color13 #a00095 -color6 #3e953a -color14 #3e953a -color7 #bbbbbb -color15 #ffffff -selection_foreground #f8f8f8 +background #000000 +foreground #fffaf3 +cursor #ffffff +selection_background #002a3a +color0 #222222 +color8 #444444 +color1 #ff000f +color9 #ff273f +color2 #8ce00a +color10 #abe05a +color3 #ffb900 +color11 #ffd141 +color4 #008df8 +color12 #0092ff +color5 #6c43a5 +color13 #9a5feb +color6 #00d7eb +color14 #67ffef +color7 #ffffff +color15 #ffffff +selection_foreground #0d0f18 diff --git a/configs/kitty/kitty.conf b/configs/kitty/kitty.conf index 8c61916..c625178 100644 --- a/configs/kitty/kitty.conf +++ b/configs/kitty/kitty.conf @@ -1314,6 +1314,6 @@ map kitty_mod+minus change_font_size all -2.0 # BEGIN_KITTY_THEME -# Atom One Light +# Argonaut include current-theme.conf # END_KITTY_THEME diff --git a/configs/kitty/kitty.conf.bak b/configs/kitty/kitty.conf.bak index c625178..8c61916 100644 --- a/configs/kitty/kitty.conf.bak +++ b/configs/kitty/kitty.conf.bak @@ -1314,6 +1314,6 @@ map kitty_mod+minus change_font_size all -2.0 # BEGIN_KITTY_THEME -# Argonaut +# Atom One Light include current-theme.conf # END_KITTY_THEME diff --git a/configs/nvim/ftplugin/markdown.vim b/configs/nvim/ftplugin/markdown.vim index 9f06c51..2d1d06b 100644 --- a/configs/nvim/ftplugin/markdown.vim +++ b/configs/nvim/ftplugin/markdown.vim @@ -1 +1,3 @@ -inoremap **** +:imap **** +:vmap S* +:set wrap linebreak diff --git a/configs/nvim/lua/configs/tree.lua b/configs/nvim/lua/configs/tree.lua index e8bc703..d45573d 100644 --- a/configs/nvim/lua/configs/tree.lua +++ b/configs/nvim/lua/configs/tree.lua @@ -1,14 +1,4 @@ -local g = vim.g - -- Configure nvim-tree -g.nvim_tree_highlight_opened_files = 1 -g.nvim_tree_group_empty = 1 -g.nvim_tree_show_icons = { - folder_arrows = 0, - folders = 1, - files = 1, - git = 1 -} require("nvim-tree").setup { hijack_cursor = true, update_cwd = false, @@ -28,5 +18,17 @@ require("nvim-tree").setup { view = { hide_root_folder = true, signcolumn = "no" + }, + renderer = { + group_empty = true, + highlight_opened_files = "all", + icons = { + show = { + folder_arrow = false, + folder = true, + file = true, + git = true + } + } } } diff --git a/configs/nvim/lua/core/keymappings.lua b/configs/nvim/lua/core/keymappings.lua index d1bd4c4..6f5aefe 100644 --- a/configs/nvim/lua/core/keymappings.lua +++ b/configs/nvim/lua/core/keymappings.lua @@ -10,8 +10,10 @@ map("n", "", ":Telescope git_files", options) map("n", "", ":lua require'telescope.builtin'.live_grep{ cwd = vim.fn.getcwd() }", options) map("n", "", ":Telescope command_center", options) map("n", "", "za", options) -vim.notify("keys") + -- LSP Functionality +map("n", "n", ":lua vim.diagnostic.goto_next()", options) +map("n", "p", ":lua vim.diagnostic.goto_prev()", options) map("n", "gD", "lua vim.lsp.buf.declaration()", options) map("n", "gd", "lua vim.lsp.buf.definition()", options) map("n", "gr", "lua vim.lsp.buf.references()", options) @@ -20,9 +22,6 @@ map("n", "K", "lua vim.lsp.buf.hover()", options) map("n", "e", "lua vim.diagnostic.open_float()", options) map("n", "rn", "lua vim.lsp.buf.rename()", options) map("n", "c", "lua vim.lsp.buf.code_action()", options) --- map("n", "", ":Neoformat", options) -map("n", "[d", "lua vim.lsp.diagnostic.goto_prev()", options) -map("n", "]d", "lua vim.lsp.diagnostic.goto_next()", options) map("n", "t", ":TroubleToggle", remap) -- Navigate Buffers @@ -54,10 +53,10 @@ map("n", "k", "{", options) map("n", "j", "}", options) -- I dont use macros at the moment, can disable this if i want to -map('v', 'Q', 'q', {}) -map('v', 'Q', 'q', {}) -map('n', 'q', '', {}) -map('n', 'q', '', {}) +-- map('v', 'Q', 'q', {}) +-- map('v', 'Q', 'q', {}) +-- map('n', 'q', '', {}) +-- map('n', 'q', '', {}) -- Move lines vscode style map("n", "", "move +1", options) diff --git a/configs/sway/config b/configs/sway/config index c104ef5..56a9c5c 100644 --- a/configs/sway/config +++ b/configs/sway/config @@ -87,12 +87,12 @@ output * bg `find $wallpapers_path -type f | shuf -n 1` fill # # Example configuration: # + exec swayidle -w \ - timeout 300 '~/.config/sway/lock_screen.sh' \ - timeout 600 'swaymsg "output * dpms off"' \ - timeout 660 'systemctl suspend' \ - resume 'swaymsg "output * dpms on"' \ - before-sleep $lock_screen + timeout 300 '~/.config/sway/scripts/lock_screen.sh' \ + timeout 600 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep $lock_screen # # This will lock your screen after 300 seconds of inactivity, then turn off @@ -148,8 +148,8 @@ input "1739:24385:Synaptics_TM2438-005" { bindsym --locked XF86AudioRaiseVolume exec "pactl -- set-sink-volume @DEFAULT_SINK@ +10%" #Increase brightness - bindsym XF86MonBrightnessUp exec brightnessctl -d intel_backlight set +20 - bindsym XF86MonBrightnessDown exec brightnessctl -d intel_backlight set 20- + bindsym XF86MonBrightnessUp exec brightnessctl set +20 + bindsym XF86MonBrightnessDown exec brightnessctl set 20- # Exit sway (logs you out of your Wayland session) bindsym $mod+Shift+e exec swaynag -t warning -m 'Do you really want to exit your Wayland session?' -B 'Yes, exit sway' 'swaymsg exit' diff --git a/configs/waybar/config b/configs/waybar/config index 317f71c..59b4560 100644 --- a/configs/waybar/config +++ b/configs/waybar/config @@ -3,30 +3,24 @@ "spacing": 4, "bar_id": "bar-0", "ipc": true, - "mode": "hide", + // "mode": "hide", "hidden_state": "show", "modules-left": [ "clock", "custom/waybar-mpris" ], "modules-center": [ - "sway/workspaces", - "sway/mode" + "wlr/workspaces" ], "modules-right": [ "custom/power-consumption", "custom/power-profile", - "custom/dpi", + // "custom/dpi", "custom/theme", "pulseaudio", "network", "battery" ], - "sway/workspaces": { - "disable-scroll": true, - "all-outputs": false, - "format": "{name}" - }, "custom/theme": { "exec": "~/.config/waybar/scripts/toggle-theme", "on-click": "~/.config/waybar/scripts/toggle-theme --toggle", @@ -36,19 +30,30 @@ "exec": "~/.config/waybar/scripts/power-consumption", "interval": 1 }, + "wlr/workspaces": { + "format": "{icon} {name}", + "on-click": "activate", + "format-icons": { + "1": "", + "2": "", + "3": "", + "4": "", + "5": "", + "urgent": "", + // "active": "", + "default": "" + } + }, "custom/power-profile": { "exec": "~/.config/waybar/scripts/power-profile", "on-click": "~/.config/waybar/scripts/power-profile --toggle", "interval": 2 }, - "custom/dpi": { - "exec": "~/.config/waybar/scripts/toggle-hdpi", - "on-click": "~/.config/waybar/scripts/toggle-hdpi --toggle", - "restart-interval": 2 - }, - "sway/mode": { - "format": "{}" - }, + // "custom/dpi": { + // "exec": "~/.config/waybar/scripts/toggle-hdpi", + // "on-click": "~/.config/waybar/scripts/toggle-hdpi --toggle", + // "restart-interval": 2 + // }, "clock": { "interval": 60, "format": "{:%H:%M}", diff --git a/configs/waybar/scripts/set-theme b/configs/waybar/scripts/set-theme index d94fd8e..2397b3f 100755 --- a/configs/waybar/scripts/set-theme +++ b/configs/waybar/scripts/set-theme @@ -186,7 +186,7 @@ esac # requires this in ~/.config/kitty/kitty.conf: # allow_remote_control yes # listen_on unix:/tmp/kitty-socket - kitty +kitten themes --reload-in=all $new_kitty_theme + kitty +kitten themes --cache-age=-1 --reload-in=all $new_kitty_theme # for SOCK in /tmp/kitty-socket-*; do # if [[ -r $new_kitty_theme ]]; then # else diff --git a/configs/waybar/style.css b/configs/waybar/style.css index 2ff82fa..2175b1a 100644 --- a/configs/waybar/style.css +++ b/configs/waybar/style.css @@ -1,9 +1,9 @@ * { - border: none; - font-family: Font Awesome, Hack Nerd Font Mono; + border: none; + font-family: Font Awesome, Hack Nerd Font Mono; font-weight: 600; - font-size: 13px; - /* opacity: 0.95; */ + font-size: 13px; + /* opacity: 0.95; */ } window#waybar { @@ -11,39 +11,34 @@ window#waybar { } window > box { - margin: 6px; - margin-bottom: 0px; + margin: 6px; + margin-bottom: 0px; background: #2b303b; - background: @theme_bg_color; - padding: 5px 8px; + background: @theme_bg_color; + padding: 5px 8px; border-radius: 4px; - /*border-bottom: 3px solid rgba(100, 114, 125, 0.5);*/ } #workspaces button { - padding: 0px 7px; - padding-left: 4px; - color: @theme_fg_color; - background: transparent; + padding:0px 10px; + color: @theme_fg_color; + background: transparent; border-radius: 2px; } #workspaces button:hover{ - background: rgba(255, 255, 255, 0.1); + background: rgba(255, 255, 255, 0.1); } -#workspaces button.focused { - background-color: @theme_fg_color; - color: @theme_bg_color; +#workspaces button.active { + background-color: @theme_fg_color; + color: @theme_bg_color; } -#battery, #network, #pulseaudio, #clock, #custom-power, #custom-qbitstats { - /*margin: 0px 3px 0px 1px;*/ -} #clock { - margin: 0px 16px 0px 10px; - min-width: 10px; + margin: 0px 16px 0px 10px; + min-width: 10px; } .custom-spotify { @@ -56,9 +51,6 @@ window > box { color: #cc241d; } -#custom-qbitstats { -} - #battery { color: #689d6a; } diff --git a/configs/wofi/scripts/open-project b/configs/wofi/scripts/open-project index 23d41ac..f9f5678 100755 --- a/configs/wofi/scripts/open-project +++ b/configs/wofi/scripts/open-project @@ -5,9 +5,15 @@ NAME="$(echo "$PROJECTS" | sed 's/.*\%//' | sed 's/\.vim//g' | wofi --show dmenu PROJECT="$(echo "$PROJECTS" | grep "$NAME.vim" | sed 's/\%/\//g' | sed 's/\.vim$//')" -VIM="$HOME/.asdf/shims/nvim"; +VIM="$HOME/.asdf/shims/nvim ; zsh"; if [ "$PROJECT" != "" ]; then - cd $PROJECT - tmux new-window "$VIM . ; zsh" + if [ "$(pgrep kitty)" == "" ]; then + kitty -d $PROJECT $VIM + exit + else + cd $PROJECT + tmux new-window "$VIM" + exit + fi fi