From 44e2c18c7ae1621352c86e22085be4dd260b1327 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Mon, 28 Mar 2022 14:12:36 +0200 Subject: [PATCH] feat: some stuff --- configs/.zshrc | 4 ++ configs/nvim/init.lua | 11 ++++- configs/nvim/lua/keymappings.lua | 2 +- configs/nvim/lua/lazy-git.lua | 80 ++++++++++++++++---------------- configs/nvim/lua/lsp-conf.lua | 2 - configs/nvim/lua/plugins.lua | 2 +- configs/sway/config | 17 +++++-- configs/waybar/config | 31 +++++++++---- configs/waybar/style.css | 3 ++ configs/zsh/functions.zsh | 2 +- configs/zsh/functions/conf.zsh | 5 +- configs/zsh/functions/fx.zsh | 10 +++- 12 files changed, 107 insertions(+), 62 deletions(-) diff --git a/configs/.zshrc b/configs/.zshrc index 57266d1..fd3c086 100644 --- a/configs/.zshrc +++ b/configs/.zshrc @@ -83,3 +83,7 @@ fi export PNPM_HOME="$HOME/.local/share/pnpm" export PATH="$PNPM_HOME:$PATH" + +# tabtab source for packages +# uninstall by removing these lines +[[ -f ~/.config/tabtab/zsh/__tabtab.zsh ]] && . ~/.config/tabtab/zsh/__tabtab.zsh || true diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index a38bc4d..a12afc3 100644 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -149,7 +149,14 @@ if u.has_plugin("cmp") then g.tokyonight_transparent_sidebar = true require("nightfox").setup( { - transparent = true + options = { + styles = { + comments = "italic", + keywords = "bold", + types = "italic,bold" + }, + transparent = true + } } ) @@ -261,6 +268,8 @@ if u.has_plugin("cmp") then -- LSP Config require "lspinstaller-conf" + + -- Setup Command OVerlays require "lazy-git" require "autocommands" diff --git a/configs/nvim/lua/keymappings.lua b/configs/nvim/lua/keymappings.lua index 406604d..92038e6 100644 --- a/configs/nvim/lua/keymappings.lua +++ b/configs/nvim/lua/keymappings.lua @@ -66,7 +66,7 @@ map("n", "r", "lua require('rest-nvim').run()", options) map("n", "q", ":q", options) -- Open Nerdtree -map("n", "", ":NvimTreeToggle:TransparentEnable", options) +map("n", "", ":NvimTreeToggle", options) -- Make ctrl+s work map("n", "", ":w", options) diff --git a/configs/nvim/lua/lazy-git.lua b/configs/nvim/lua/lazy-git.lua index 7a3d66f..406aea4 100644 --- a/configs/nvim/lua/lazy-git.lua +++ b/configs/nvim/lua/lazy-git.lua @@ -1,68 +1,68 @@ local Terminal = require("toggleterm.terminal").Terminal local u = require("utils") local lazygit = - Terminal:new( - { - cmd = "lazygit", - dir = "git_dir", - direction = "float", - float_opts = { - winblend = 0, - border = "shadow" - }, - on_open = function(term) - vim.cmd("startinsert!") - vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "close", {noremap = true, silent = true}) - end, - on_close = function(term) - Terminal:close() - end - } + Terminal:new( + { + cmd = "lazygit", + dir = "git_dir", + direction = "float", + float_opts = { + winblend = 0, + border = "shadow" + }, + on_open = function(term) + vim.cmd("startinsert!") + vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "close", {noremap = true, silent = true}) + end, + on_close = function(term) + Terminal:close() + end + } ) function _lazygit_toggle() - lazygit:toggle() + lazygit:toggle() end vim.api.nvim_set_keymap("n", "", "lua _lazygit_toggle()", {noremap = true, silent = true}) local pnpm = - Terminal:new( - { - cmd = "pnpm dev", - dir = "git_dir", - size = 5, - direction = "vertical", - on_close = function(term) - Terminal:close() - end - } + Terminal:new( + { + cmd = "pnpm dev", + dir = "git_dir", + size = 5, + direction = "vertical", + on_close = function(term) + Terminal:close() + end + } ) function _pnpm_toggle() - pnpm:toggle() + pnpm:toggle() end vim.api.nvim_set_keymap("n", "d", "lua _pnpm_toggle()", {noremap = true, silent = true}) local nvimConfig = - Terminal:new( - { - cmd = "cd $HOME/.dotfiles && nvim configs/init.lua && cd -", - direction = "float", - on_close = function(term) - Terminal:close() - u.ReloadConfig() - end - } + Terminal:new( + { + cmd = "cd $HOME/.dotfiles && nvim configs/init.lua && cd -", + direction = "float", + on_close = function(term) + Terminal:close() + u.ReloadConfig() + end + } ) function _nvimConfig_toggle() - nvimConfig:toggle() + nvimConfig:toggle() end vim.api.nvim_set_keymap("n", "", "lua _nvimConfig_toggle()", {noremap = true, silent = true}) require("toggleterm").setup { - shade_terminals = true + shade_terminals = true } diff --git a/configs/nvim/lua/lsp-conf.lua b/configs/nvim/lua/lsp-conf.lua index ebc5d10..a0301b6 100644 --- a/configs/nvim/lua/lsp-conf.lua +++ b/configs/nvim/lua/lsp-conf.lua @@ -87,8 +87,6 @@ lsp.tsserver.setup( init_options = require("nvim-lsp-ts-utils").init_options, -- on_attach = function(client, bufnr) - vim.notify("Eyyyy") - -- defaults ts_utils.setup( { diff --git a/configs/nvim/lua/plugins.lua b/configs/nvim/lua/plugins.lua index a237f4d..6464c58 100644 --- a/configs/nvim/lua/plugins.lua +++ b/configs/nvim/lua/plugins.lua @@ -12,7 +12,7 @@ return require("packer").startup( -- Theming Section -- use 'folke/tokyonight.nvim' use "EdenEast/nightfox.nvim" - use "xiyaowong/nvim-transparent" + -- use "xiyaowong/nvim-transparent" -- Layout Plugins use "kyazdani42/nvim-web-devicons" diff --git a/configs/sway/config b/configs/sway/config index fd17cc3..983b61f 100644 --- a/configs/sway/config +++ b/configs/sway/config @@ -35,7 +35,12 @@ set $term kitty set $explorer nautilus set $mail geary set $browser google-chrome-beta --enable-features=UseOzonePlatform --ozone-platform=wayland +set $password_mngr rofi-rbw --selector wofi --typer wtype --clipboarder wl-copy +set $bluetooth_mngr blueman-manager +set $calculator flatpak run io.github.Qalculate +set $photo_editor gtk-launch ~/.local/share/applications/photopea.desktop +# Scripts set $config_editor ~/.config/sway/config_editor.sh set $debug_window ~/.config/sway/debug_window.sh set $settings gnome-control-center @@ -46,9 +51,7 @@ set $web_search $wofi_scripts/web-search.sh set $select_window ~/.config/sway/select_window.sh set $lock_screen ~/.config/sway/lock_screen.sh set $select_emoji $wofi_scripts/wofi-emoji -set $password_mngr rofi-rbw --selector wofi --typer wtyper --cliboarder wl-copy set $open_localhost $wofi_scripts/open-localhost -set $bluetooth_mngr blueman-manager # Input configuration input * { @@ -116,6 +119,7 @@ input "1739:24385:Synaptics_TM2438-005" { bindsym $mod+Shift+Comma exec $config_editor bindsym $mod+a exec $web_search bindsym $mod+p exec $password_mngr + bindsym $mod+Shift+p exec $photo_editor # Drag and resize floating windows with mouse right/left drag floating_modifier $mod normal @@ -165,6 +169,7 @@ input "1739:24385:Synaptics_TM2438-005" { # for_window [class="zoom"] floating enable for_window [app_id="gnome-calculator"] floating enable + for_window [app_id="qalculate-gtk"] floating enable for_window [title="Zoom Meeting.*"] floating disable for_window [title="Zoom Meeting.*"] inhibit_idle visible @@ -247,7 +252,8 @@ input "1739:24385:Synaptics_TM2438-005" { bindsym $mod+i exec $select_emoji bindsym $mod+Shift+i exec $debug_window bindsym $mod+o exec $open_localhost - bindsym $mod+c exec $lock_screen + bindsym $mod+Control+l exec $lock_screen + bindsym $mod+c exec $calculator bindsym Alt+Tab exec $select_window bindsym $mod+m exec $mail # @@ -297,7 +303,8 @@ bindsym $mod+r mode "resize" # Handles notifications exec_always mako - +exec_always pulseaudio --start +# Dimms the screen exec_always wlsunset -l 39.47 -L -0.3821346 @@ -310,4 +317,4 @@ bar { } include @sysconfdir@/sway/config.d/* -exec "systemctl --user import-environment SWAYSOCK WAYLAND_DISPLAY"; +exec "systemctl --user import-environment SWAYSOCK XDG_CURRENT_DESKTOP WAYLAND_DISPLAY"; diff --git a/configs/waybar/config b/configs/waybar/config index b2ef8ac..e9a668d 100644 --- a/configs/waybar/config +++ b/configs/waybar/config @@ -1,12 +1,12 @@ { "height": 20, "spacing": 4, - "modules-left": ["sway/workspaces", "sway/mode"], - "modules-center": ["custom/media", "custom/clock"], + "modules-left": ["custom/clock", "custom/waybar-mpris"], + "modules-center": ["sway/workspaces", "sway/mode"], "modules-right": ["pulseaudio", "network", "custom/cpu_speed", "memory", "battery", "custom/clock" ], "sway/workspaces": { "disable-scroll": true, - "all-outputs": true, + "all-outputs": false, "format": "{name}", "format-icons": { "urgent": "", @@ -78,7 +78,7 @@ "custom/clock": { "exec": "date +'%H:%M'", "interval": 10, - "on-click": "nm-applet" + "on-click": "nm-applet" }, "cpu": { "format": "{usage}% ", @@ -88,7 +88,7 @@ "format": "{}% " }, "temperature": { - // "thermal-zone": 2, + // "thermal-zone": 2,media // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", "critical-threshold": 80, // "format-critical": "{temperatureC}°C {icon}", @@ -102,7 +102,7 @@ }, "battery": { "states": { - // "good": 95, + "good": 95 "warning": 30, "critical": 15 }, @@ -110,7 +110,7 @@ "format-charging": "{capacity}% ", "format-plugged": "{capacity}% ", "format-alt": "{time} {icon}", - // "format-good": "", // An empty format will hide the module + "format-good": "", // An empty format will hide the module // "format-full": "", "format-icons": ["", "", "", "", ""] }, @@ -152,7 +152,21 @@ "format": "{icon} {}", "format-icons": [""], "escape": true, - "on-click": "terminator -e htop" + "on-click": "kitty -e htop" +}, +"custom/waybar-mpris": { + "return-type": "json", + "exec": "waybar-mpris --position --autofocus", + "on-click": "waybar-mpris --send toggle", + // This option will switch between players on right click. + "on-click-right": "waybar-mpris --send player-next", + // The options below will switch the selected player on scroll + // "on-scroll-up": "waybar-mpris --send player-next", + // "on-scroll-down": "waybar-mpris --send player-prev", + // The options below will go to next/previous track on scroll + // "on-scroll-up": "waybar-mpris --send next", + // "on-scroll-down": "waybar-mpris --send prev", + "escape": true, }, "custom/media": { "format": "{icon} {}", @@ -164,7 +178,6 @@ }, "escape": true, "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder - // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name } } diff --git a/configs/waybar/style.css b/configs/waybar/style.css index 904f9ad..a50e813 100644 --- a/configs/waybar/style.css +++ b/configs/waybar/style.css @@ -84,3 +84,6 @@ window > box { padding: 0 3px; } +#custom-waybar-mpris{ + margin-left: 5px; +} diff --git a/configs/zsh/functions.zsh b/configs/zsh/functions.zsh index 41df11b..3598261 100644 --- a/configs/zsh/functions.zsh +++ b/configs/zsh/functions.zsh @@ -1,3 +1,4 @@ +source $(dirname "$0")/functions/dv.zsh; source $(dirname "$0")/functions/co.zsh; source $(dirname "$0")/functions/fx.zsh; source $(dirname "$0")/functions/start.zsh; @@ -7,7 +8,6 @@ source $(dirname "$0")/functions/rn.zsh; source $(dirname "$0")/functions/sum.zsh; source $(dirname "$0")/functions/myip.zsh; source $(dirname "$0")/functions/cht.zsh; -source $(dirname "$0")/functions/dv.zsh; source $(dirname "$0")/functions/run.zsh; source $(dirname "$0")/functions/conf.zsh; source $(dirname "$0")/functions/note.zsh; diff --git a/configs/zsh/functions/conf.zsh b/configs/zsh/functions/conf.zsh index 0abc073..f6fbfc1 100644 --- a/configs/zsh/functions/conf.zsh +++ b/configs/zsh/functions/conf.zsh @@ -1,5 +1,7 @@ function conf(){ + OLD_PWD=$PWD; + if [ "$1" = "u" ]; then source ~/.zshrc else @@ -21,7 +23,8 @@ function conf(){ nvim . fi - fi + cd $OLD_PWD + } diff --git a/configs/zsh/functions/fx.zsh b/configs/zsh/functions/fx.zsh index ac0cdd8..60bd177 100644 --- a/configs/zsh/functions/fx.zsh +++ b/configs/zsh/functions/fx.zsh @@ -17,7 +17,15 @@ function fx(){ cd $2 fi + if [ "$1" = "d" ]; then + dv + fi + + if [ "$1" = "v" ]; then + nvim . + fi + if [ "$1" = "o" ]; then code-insiders . fi -} \ No newline at end of file +}