From 52707674444320ee76b64b210e8f6e92027e0f0f Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Tue, 7 Apr 2020 23:22:20 +0200 Subject: [PATCH] new menu script --- conf/config/scripts/brightness | 3 ++- conf/config/scripts/menu | 18 +++++++++++++++ conf/config/sway/config | 37 ++++++++++++++++-------------- conf/home/vim/.netrwhist | 3 ++- conf/home/vim/plugged/nerdtree | 1 - conf/home/vim/plugged/vim-surround | 1 + conf/home/vim/plugged/vim-vinegar | 1 + conf/home/vimrc | 12 ++++++---- 8 files changed, 51 insertions(+), 25 deletions(-) create mode 100755 conf/config/scripts/menu delete mode 160000 conf/home/vim/plugged/nerdtree create mode 160000 conf/home/vim/plugged/vim-surround create mode 160000 conf/home/vim/plugged/vim-vinegar diff --git a/conf/config/scripts/brightness b/conf/config/scripts/brightness index c4834f3..a8417f7 100755 --- a/conf/config/scripts/brightness +++ b/conf/config/scripts/brightness @@ -10,7 +10,8 @@ case $1 in ;; *) scale="1.0" + ;; esac val="$(echo "${back} * ${scale}" | bc)" -exec xbacklight -fps 30 -set $val +exec xbacklight -fps 30 -set "$val" diff --git a/conf/config/scripts/menu b/conf/config/scripts/menu new file mode 100755 index 0000000..69350c9 --- /dev/null +++ b/conf/config/scripts/menu @@ -0,0 +1,18 @@ +#!/bin/sh + +MENU="wofi" +case $1 in + "dmenu") + exec $MENU -S run -p "" # Use run to replicate dmenu_run beahviour + ;; + "apps") + exec $MENU -S drun -I -p "Search applications" + ;; + + "pass") + exec $MENU -d -P -L 1 -W 400 2>/dev/null + ;; + *) + echo "Error option not valid" + ;; +esac diff --git a/conf/config/sway/config b/conf/config/sway/config index 6168418..545a32d 100644 --- a/conf/config/sway/config +++ b/conf/config/sway/config @@ -5,7 +5,8 @@ set $down j set $up k set $right l set $term alacritty -set $menu wofi --show drun +set $menu $SCRIPT_DIR/menu apps +set $dmenu $SCRIPT_DIR/menu dmenu # Disable xwaylnad # xwayland disable @@ -46,27 +47,29 @@ bindsym XF86AudioLowerVolume exec amixer -q sset Master 3%- bindsym XF86AudioMute exec amixer -q sset Master toggle bindsym XF86AudioMicMute exec amixer -q sset Capture toggle - # Start a terminal - bindsym $mod+Return exec $term +# Start a terminal +bindsym $mod+Return exec $term - # Kill focused window - bindsym $mod+Shift+q kill +# Kill focused window +bindsym $mod+Shift+q kill - # Start your launcher - bindsym $mod+d exec $menu +# Start your launcher +bindsym $mod+d exec $menu +bindsym $mod+Shift+d exec $dmenu - # Drag floating windows by holding down $mod and left mouse button. - # Resize them with right mouse button + $mod. - # Despite the name, also works for non-floating windows. - # Change normal to inverse to use left mouse button for resizing and right - # mouse button for dragging. - floating_modifier $mod normal +# Drag floating windows by holding down $mod and left mouse button. +# Resize them with right mouse button + $mod. +# Despite the name, also works for non-floating windows. +# Change normal to inverse to use left mouse button for resizing and right +# mouse button for dragging. +floating_modifier $mod normal - # Reload the configuration file - bindsym $mod+Shift+c reload +# Reload the configuration file +bindsym $mod+Shift+c reload + +# Exit sway (logs you out of your Wayland session) +bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' - # Exit sway (logs you out of your Wayland session) - bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' # # Moving around: # diff --git a/conf/home/vim/.netrwhist b/conf/home/vim/.netrwhist index 97fca0f..996abd5 100644 --- a/conf/home/vim/.netrwhist +++ b/conf/home/vim/.netrwhist @@ -1,5 +1,6 @@ let g:netrw_dirhistmax =10 -let g:netrw_dirhistcnt =9 +let g:netrw_dirhistcnt =0 +let g:netrw_dirhist_0='/home/ale' let g:netrw_dirhist_9='/home/ale/sw/conf/config/waybar' let g:netrw_dirhist_8='/home/ale/sw/conf/config/sway' let g:netrw_dirhist_7='/home/ale/Documents/projects/distro' diff --git a/conf/home/vim/plugged/nerdtree b/conf/home/vim/plugged/nerdtree deleted file mode 160000 index 343508e..0000000 --- a/conf/home/vim/plugged/nerdtree +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 343508e9fd981928f1e830c71c9d8b2a54edb7dd diff --git a/conf/home/vim/plugged/vim-surround b/conf/home/vim/plugged/vim-surround new file mode 160000 index 0000000..f51a26d --- /dev/null +++ b/conf/home/vim/plugged/vim-surround @@ -0,0 +1 @@ +Subproject commit f51a26d3710629d031806305b6c8727189cd1935 diff --git a/conf/home/vim/plugged/vim-vinegar b/conf/home/vim/plugged/vim-vinegar new file mode 160000 index 0000000..fcce70f --- /dev/null +++ b/conf/home/vim/plugged/vim-vinegar @@ -0,0 +1 @@ +Subproject commit fcce70f1403ba4101668a4c960c577bddbd00f06 diff --git a/conf/home/vimrc b/conf/home/vimrc index e03402d..bcd647a 100644 --- a/conf/home/vimrc +++ b/conf/home/vimrc @@ -11,7 +11,9 @@ call plug#begin('~/.vim/plugged') " Declare the list of plugins. Plug 'itchyny/lightline.vim' -Plug 'preservim/nerdtree' +" Plug 'preservim/nerdtree' +Plug 'tpope/vim-vinegar' +Plug 'tpope/vim-surround' Plug 'tpope/vim-fugitive' Plug 'terryma/vim-multiple-cursors' Plug 'ap/vim-css-color' @@ -36,9 +38,9 @@ if !has('gui_running') endif " NERDTree -map :NERDTreeToggle +" map :NERDTreeToggle " Start nerdtree when no file is specified -autocmd StdinReadPre * let s:std_in=1 -autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif -autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif +" autocmd StdinReadPre * let s:std_in=1 +" autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif +" autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif