feat: some stuff

This commit is contained in:
max_richter 2022-03-28 14:12:36 +02:00
parent e8a2b9b3f9
commit 44e2c18c7a
12 changed files with 107 additions and 62 deletions

View File

@ -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

View File

@ -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"

View File

@ -66,7 +66,7 @@ map("n", "<Leader>r", "<cmd>lua require('rest-nvim').run()<CR>", options)
map("n", "<Leader>q", "<Esc>:q<CR>", options)
-- Open Nerdtree
map("n", "<C-n>", ":NvimTreeToggle<CR>:TransparentEnable<CR>", options)
map("n", "<C-n>", ":NvimTreeToggle<CR>", options)
-- Make ctrl+s work
map("n", "<C-s>", "<Esc>:w<CR>", options)

View File

@ -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", "<cmd>close<CR>", {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", "<cmd>close<CR>", {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", "<C-g>", "<cmd>lua _lazygit_toggle()<CR>", {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", "<Leader>d", "<cmd>lua _pnpm_toggle()<CR>", {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", "<Leader><C-i>", "<cmd>lua _nvimConfig_toggle()<CR>", {noremap = true, silent = true})
require("toggleterm").setup {
shade_terminals = true
shade_terminals = true
}

View File

@ -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(
{

View File

@ -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"

View File

@ -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";

View File

@ -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": "<span font='Font Awesome 5 Free 11'>{icon}</span> {}",
"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
}
}

View File

@ -84,3 +84,6 @@ window > box {
padding: 0 3px;
}
#custom-waybar-mpris{
margin-left: 5px;
}

View File

@ -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;

View File

@ -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
}

View File

@ -17,6 +17,14 @@ function fx(){
cd $2
fi
if [ "$1" = "d" ]; then
dv
fi
if [ "$1" = "v" ]; then
nvim .
fi
if [ "$1" = "o" ]; then
code-insiders .
fi