From 7e3c5f1a73e714c05a7a11e90e103487e257041f Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Sun, 27 Aug 2023 11:39:03 -0700 Subject: [PATCH 1/8] Conflict resolution --- nvim.init.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/nvim.init.lua b/nvim.init.lua index 724a1b2..96731d6 100644 --- a/nvim.init.lua +++ b/nvim.init.lua @@ -94,15 +94,14 @@ require('packer').startup(function(use) 'williamboman/mason-lspconfig.nvim', -- Useful status updates for LSP - {'j-hui/fidget.nvim', branch = 'legacy'}, use { - 'j-hui/fidget.nvim', - tag = 'legacy', - config = function() - require("fidget").setup { - -- options - } - end, + 'j-hui/fidget.nvim', + tag = 'legacy', + config = function() + require("fidget").setup { + -- options + } + end, } }, } @@ -177,7 +176,8 @@ vim.api.nvim_create_autocmd('BufWritePost', { -- See `:help vim.o` if vim.g.neovide then - vim.o.guifont = "Iosevka Term:h16" + vim.o.guifont = "Iosevka Term:h12" + vim.g.neovide_scale_factor = 1.0 end -- Set highlight on search From ccf2897cb80cbed16755fb39d9f6f5d7f872b0b1 Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Sun, 27 Aug 2023 11:40:10 -0700 Subject: [PATCH 2/8] Neovide settings --- nvim.init.lazy.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nvim.init.lazy.lua b/nvim.init.lazy.lua index 7775dcc..b2da17a 100644 --- a/nvim.init.lazy.lua +++ b/nvim.init.lazy.lua @@ -108,7 +108,8 @@ require('onedark').load() -- See `:help vim.o` if vim.g.neovide then - vim.o.guifont = "Iosevka Term:h16" + vim.o.guifont = "Iosevka Term:h12" + vim.g.neovide_scale_factor = 1.0 end -- Set highlight on search From c9e3e7ae53035a621c546b2433d2410a198838d0 Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Mon, 25 Dec 2023 11:30:33 -0800 Subject: [PATCH 3/8] Support for updated somebar Better logging --- dwl.entourage | 56 +++++++++++++++++++-------------------------------- 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/dwl.entourage b/dwl.entourage index ca18dfa..067a0ab 100755 --- a/dwl.entourage +++ b/dwl.entourage @@ -1,9 +1,14 @@ #!/usr/bin/env bash -echo "Entourage: $XDG_RUNTIME_DIR - $DWL_TAGS_FILE" >> $DWL_LOG_FILE +function log_this() { + TSTMP=$(date) + echo "$TSTMP : " $1 >> $DWL_LOG_FILE +} -NUM_DISPS=$(wlr-randr | egrep "^\w+" | wc -l) -echo "Entourage: Configuring ${NUM_DISPS} displays" >> $DWL_LOG_FILE +log_this "Entourage: $XDG_RUNTIME_DIR - $DWL_TAGS_FILE" + +NUM_DISPS=$(wlr-randr | grep -E "^\w+" | wc -l) +log_this "Entourage: Configuring ${NUM_DISPS} displays" if [[ $NUM_DISPS > 1 ]]; then # Dual screen @@ -21,39 +26,11 @@ fi # ---------------------------------------------------------- while [ ! -e "$XDG_RUNTIME_DIR/wayland-0.lock" ] do - echo "DWL getting ready..." >> $DWL_LOG_FILE + log_this "DWL getting ready..." sleep 1 done -echo "DWL ready!" >> $DWL_LOG_FILE -echo "Entourage: " $DWL_TAGS_FILE >> $DWL_LOG_FILE - -if [ -e /usr/local/bin/somebar ]; then - dbus-run-session /usr/local/bin/somebar > $XDG_RUNTIME_DIR/somebar.log & - (sleep 2 && conky -c ~/.conkyrc > $XDG_RUNTIME_DIR/somebar-0) & - echo "Entourage: Started somebar " >> $DWL_LOG_FILE -else - DISPLAYS=$(wlr-randr | perl -ne 'print "$1 " if /^([\w-]+)/') - DISP_NUM=$(expr 0) - for DISP in $DISPLAYS; do - DISP_NUM=$(expr $DISP_NUM + 1) - TF=${DWL_TAGS_FILE}.${DISP} - # ---------------------------------------------------------- - # Top bar for displaying DWL tags - # ---------------------------------------------------------- - # Dependency - needs inotify-tools package - echo "Entourage: Monitor - ${DISP_NUM} ${DISP}, new tags file " ${TF} >> $DWL_LOG_FILE - touch ${TF} - inotifywait -q -m -e close_write ${TF} | - (cat ${TF} ; - while read -r filename event; do - cat ${TF} - done) | dtao -z -z -xs ${DISP_NUM} -ta l -tw 100 -expand r -h 22 -fn 'Iosevka:style=Regular:size=12' & - # ---------------------------------------------------------- - # Bottom bar for displaying context information - # ---------------------------------------------------------- - (conky -c ~/.conkyrc) | dtao -xs ${DISP_NUM} -ta r -tw 100 -expand l -h 22 -fn 'Iosevka:style=Regular:size=12' & - done -fi +log_this "DWL ready!" +log_this "Entourage: $DWL_TAGS_FILE" # ---------------------------------------------------------- # Background @@ -64,13 +41,22 @@ fi # ---------------------------------------------------------- # Lock when idle # ---------------------------------------------------------- +log_this "Entourage: Starting screen locker with 10min idle time" swayidle -w timeout 600 swaylock & # ---------------------------------------------------------- # Redirect STDIN to STDOUT and pass along to tags script # ---------------------------------------------------------- +BAR_PATH=/usr/local/bin/somebar +# BAR_PATH=/home/mahesh/git/somebar_20231001/build/somebar + +export SOMEBAR_FIFO=$XDG_RUNTIME_DIR/somebar.fifo +mkfifo $SOMEBAR_FIFO -m666 +log_this "Entourage: Starting somebar using $SOMEBAR_FIFO" +conky -c ~/.conkyrc > $SOMEBAR_FIFO & + (while read line do echo $line -done) | dwltags.pl --file $DWL_TAGS_FILE +done) | ($BAR_PATH -s $SOMEBAR_FIFO > $XDG_RUNTIME_DIR/somebar.log 2>&1) From ab53be3749bbeb1c146051e9792c5066ae897b4a Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Mon, 25 Dec 2023 11:31:27 -0800 Subject: [PATCH 4/8] Pipewire support --- dwl.service | 1 + 1 file changed, 1 insertion(+) diff --git a/dwl.service b/dwl.service index 192acfb..6585a2a 100644 --- a/dwl.service +++ b/dwl.service @@ -36,6 +36,7 @@ Environment=XDG_RUNTIME_DIR=%I Environment=DWL_TAGS_FILE=%I/dwl.tags Environment=DWL_LOG_FILE=%I/dwl.log Environment=DWLTAGS_FMT=DZEN +Environment=PIPEWIRE_RUNTIME_DIR=/run/user/501 ExecStart=%h/bin/dwl.session Restart=on-failure RestartSec=1 From 1502bfe4b0e6bf91c12dc4ddcfe017c35050ae70 Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Mon, 25 Dec 2023 11:33:13 -0800 Subject: [PATCH 5/8] Added telescope configuration --- nvim.init.lazy.lua | 64 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 12 deletions(-) diff --git a/nvim.init.lazy.lua b/nvim.init.lazy.lua index b2da17a..951e1fe 100644 --- a/nvim.init.lazy.lua +++ b/nvim.init.lazy.lua @@ -35,7 +35,15 @@ require("lazy").setup({ "nathanaelkane/vim-indent-guides", -- "https://github.com/intel-sandbox/vim-iosf.git", -- intel -- "https://github.com/intel-sandbox/vim-pcietrk", -- intel - "vhda/verilog_systemverilog.vim" + "vhda/verilog_systemverilog.vim", + { + 'nvim-telescope/telescope.nvim', tag = '0.1.2', + dependencies = { 'nvim-lua/plenary.nvim' } + }, + { + 'nvim-telescope/telescope-fzf-native.nvim', + build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' + } }) -- LuaLine @@ -86,17 +94,17 @@ require('lualine').setup { } } --- Gitsigns --- See `:help gitsigns.txt` -require('gitsigns').setup { - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - }, -} +-- -- Gitsigns +-- -- See `:help gitsigns.txt` +-- require('gitsigns').setup { +-- signs = { +-- add = { text = '+' }, +-- change = { text = '~' }, +-- delete = { text = '_' }, +-- topdelete = { text = '‾' }, +-- changedelete = { text = '~' }, +-- }, +-- } -- Onedark theme require('onedark').setup { @@ -233,5 +241,37 @@ vim.cmd("au! BufRead,BufNewFile *.sv,*.svh set filetype=verilog_systemv vim.cmd("au! BufRead,BufNewFile *iosfsb_trk.out set filetype=iosfsbtrk") vim.cmd("au! BufRead,BufNewFile *iosf_trk.out set filetype=iosftrk") +-- [[ Configure Telescope ]] +-- See `:help telescope` and `:help telescope.setup()` +require('telescope').setup { + defaults = { + mappings = { + i = { + [''] = false, + [''] = false, + }, + }, + }, +} + +-- Enable telescope fzf native, if installed +pcall(require('telescope').load_extension, 'fzf') + +-- See `:help telescope.builtin` +vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) +vim.keymap.set('n', '', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) +vim.keymap.set('n', '/', function() + -- You can pass additional configuration to telescope to change theme, layout, etc. + require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) +end, { desc = '[/] Fuzzily search in current buffer]' }) + +vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) +vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) +vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) +vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) +vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ft=lua ts=4 sts=4 sw=4 et From 70c89479adf4d32ab96fd1c80736c4e20b16faa5 Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Mon, 25 Dec 2023 11:33:35 -0800 Subject: [PATCH 6/8] Using Pipewire/Wireplumber for volume info --- user.conkyrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user.conkyrc b/user.conkyrc index 4bd06a7..b612626 100644 --- a/user.conkyrc +++ b/user.conkyrc @@ -46,7 +46,7 @@ ${if_existing /sys/class/net/wlp4s0/operstate up}📶 ${addr wlp4s0}${else}\ ${if_up eth0}🌎 ${addr eth0}${else}\ network down ${endif}${endif}${endif} \ ${execi 600 curl 'wttr.in/~45.54,-122.83?u&format=%c%t'} \ -🔊 ${execi 10 amixer get Master | tail -1 | sed 's/.*\[\([0-9]*%\)\].*/\1/'} \ +🔊 ${execi 10 wpctl get-volume 54 | tail -1 | perl -ne 'm/([\d\.]+)/; print scalar (($1>1) ? 100 : ($1*100))'} \ 🔋 ${battery_percent}% \ 📅 ${time %Y %h %d} \ 🕑 ${time %I:%M%p %Z} From 00c69cb17cfb908bcdc7a63171f4d39270cd939f Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Mon, 25 Dec 2023 11:35:15 -0800 Subject: [PATCH 7/8] Added script to handle button actions --- dwl_act | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 dwl_act diff --git a/dwl_act b/dwl_act new file mode 100755 index 0000000..1fc095a --- /dev/null +++ b/dwl_act @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +act=$1 + +echo "$0 - $act" >> ~/dwl_key_act.log + +# In Wayland, use the following like X11's xev: +# +# % wev | grep "sym" +# + +case $act in + vol_mute) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle;; + vol_lower) wpctl set-volume --limit 1.0 @DEFAULT_AUDIO_SINK@ 10%-;; + vol_raise) wpctl set-volume --limit 1.0 @DEFAULT_AUDIO_SINK@ 10%+;; + # mic_mute) ;; + # bright_low) ;; + # bright_high) ;; + # disp) ;; + # wlan) ;; + # tools) ;; + # search) ;; + # launch) ;; + # explore) ;; + *) echo "Unknown action '$act'";; +esac From 52d9a2773d5f8e9617c95f7656df399163f254c5 Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Sun, 24 Mar 2024 12:37:05 -0700 Subject: [PATCH 8/8] DWL startup scripting cleanup --- dwl.entourage | 23 ++++++++++++++++++----- dwl.session | 8 +++++++- dwl_act | 5 +++-- user.bash_aliases | 2 +- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/dwl.entourage b/dwl.entourage index 067a0ab..32b39fb 100755 --- a/dwl.entourage +++ b/dwl.entourage @@ -14,8 +14,22 @@ if [[ $NUM_DISPS > 1 ]]; then # Dual screen # wlr-randr --output HDMI-A-1 --on --pos 0,0 --output eDP-1 --on --pos 0,1050 # wlr-randr --output HDMI-A-1 --on --pos 0,0 --output eDP-1 --on --pos 2560,0 - # With Dell 1920x1200 display - wlr-randr --output HDMI-A-1 --on --pos 0,0 --output eDP-1 --on --pos 0,1200 + + # With Dell 1920x1200 display - vertical arrangement + # + # .--------------------------------. + # | | + # | DELL 24" 1920x1200 | + # | (HDMI-A-1) | + # | | + # `--------------------------------' + # | | + # | LAPTOP 13" 1366x768 | + # | (eDP-1) | + # | | + # `-------------------------' + # + wlr-randr --output HDMI-A-1 --on --pos 0,0 --output eDP-1 --on --pos 300,1200 else # Single laptop screen wlr-randr --output HDMI-A-1 --off --output eDP-1 --on --pos 0,0 @@ -47,8 +61,7 @@ swayidle -w timeout 600 swaylock & # ---------------------------------------------------------- # Redirect STDIN to STDOUT and pass along to tags script # ---------------------------------------------------------- -BAR_PATH=/usr/local/bin/somebar -# BAR_PATH=/home/mahesh/git/somebar_20231001/build/somebar +DWL_BAR=$DWL_BAR_PATH/somebar export SOMEBAR_FIFO=$XDG_RUNTIME_DIR/somebar.fifo mkfifo $SOMEBAR_FIFO -m666 @@ -58,5 +71,5 @@ conky -c ~/.conkyrc > $SOMEBAR_FIFO & (while read line do echo $line -done) | ($BAR_PATH -s $SOMEBAR_FIFO > $XDG_RUNTIME_DIR/somebar.log 2>&1) +done) | ($DWL_BAR -s $SOMEBAR_FIFO > $XDG_RUNTIME_DIR/somebar.log 2>&1) diff --git a/dwl.session b/dwl.session index df9ed96..a006323 100755 --- a/dwl.session +++ b/dwl.session @@ -2,6 +2,12 @@ echo $XDG_RUNTIME_DIR used for Wayland session export WLR_LIBINPUT_NO_DEVICES=1 + +export DWL_PATH=/usr/local/bin +# export DWL_PATH=/home/mahesh/git/dwl_20240101 +export DWL_BAR_PATH=/usr/local/bin +# export DWL_BAR_PATH=/home/mahesh/git/somebar_20240217/build + # export DWLTAGS_SHOW_MON=1 export PATH=~/bin:$PATH # export DWL_LOG_VERBOSE=1 @@ -9,4 +15,4 @@ export PATH=~/bin:$PATH echo "Session: in $XDG_RUNTIME_DIR" >> $DWL_LOG_FILE env -exec /usr/local/bin/dwl -s $HOME/bin/dwl.entourage +exec $DWL_PATH/dwl -s $HOME/bin/dwl.entourage diff --git a/dwl_act b/dwl_act index 1fc095a..378eb79 100755 --- a/dwl_act +++ b/dwl_act @@ -1,8 +1,9 @@ #!/usr/bin/env bash act=$1 +timestamp=$(date) -echo "$0 - $act" >> ~/dwl_key_act.log +echo "$0 - $timestamp - $act" >> ~/dwl_key_act.log # In Wayland, use the following like X11's xev: # @@ -20,7 +21,7 @@ case $act in # wlan) ;; # tools) ;; # search) ;; - # launch) ;; + launch) wldash;; # explore) ;; *) echo "Unknown action '$act'";; esac diff --git a/user.bash_aliases b/user.bash_aliases index 28c939e..3334dbe 100644 --- a/user.bash_aliases +++ b/user.bash_aliases @@ -52,5 +52,5 @@ function pgrep () { } function start_tmux () { - tmux new -A -s Tenor + TERM=screen-256color tmux new -A -s DevEnv }