Merge branch 'master' of https://git.heshapps.com/asolkar/snips
This commit is contained in:
commit
5e56166650
@ -1,16 +1,35 @@
|
||||
#!/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
|
||||
# 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
|
||||
@ -21,39 +40,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 +55,21 @@ 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
|
||||
# ----------------------------------------------------------
|
||||
DWL_BAR=$DWL_BAR_PATH/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) | ($DWL_BAR -s $SOMEBAR_FIFO > $XDG_RUNTIME_DIR/somebar.log 2>&1)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
27
dwl_act
Executable file
27
dwl_act
Executable file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
act=$1
|
||||
timestamp=$(date)
|
||||
|
||||
echo "$0 - $timestamp - $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) wldash;;
|
||||
# explore) ;;
|
||||
*) echo "Unknown action '$act'";;
|
||||
esac
|
@ -42,6 +42,7 @@ require("lazy").setup({
|
||||
},
|
||||
{
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
-- build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
|
||||
build = 'make'
|
||||
}
|
||||
})
|
||||
@ -116,7 +117,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
|
||||
|
@ -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
|
||||
|
@ -52,5 +52,5 @@ function pgrep () {
|
||||
}
|
||||
|
||||
function start_tmux () {
|
||||
tmux new -A -s Tenor
|
||||
TERM=screen-256color tmux new -A -s DevEnv
|
||||
}
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user