Compare commits
10 Commits
f683d77a39
...
master
Author | SHA1 | Date | |
---|---|---|---|
0c0ab0acec
|
|||
d36941b3d1
|
|||
4de2de5cf7 | |||
8ef05d2a11
|
|||
257c6a0b38
|
|||
fd9de58b0f
|
|||
263aeed08f | |||
e986f0eabb | |||
267e505265 | |||
3f7e576869 |
16
dwl.switch_context
Executable file
16
dwl.switch_context
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function log_this() {
|
||||
TSTMP=$(date)
|
||||
echo "$TSTMP : " $1 >> $DWL_LOG_FILE
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Let DWL start
|
||||
# ----------------------------------------------------------
|
||||
|
||||
log_this "Switch Context: Configuring $(wlr-randr | grep -E "^\w+" | wc -l) displays"
|
||||
source ~/bin/dwl.randr_setup
|
||||
|
||||
log_this "Switch Context: Starting somebar using $SOMEBAR_FIFO"
|
||||
source ~/bin/dwl.bar_setup
|
@@ -1,3 +1,3 @@
|
||||
|
||||
swayidle -w \
|
||||
timeout 600 'systemctl hybrid-sleep' &
|
||||
timeout 6000 'systemctl hybrid-sleep' &
|
||||
|
@@ -6,7 +6,7 @@ function die() {
|
||||
|
||||
START_DIR=$(pwd)
|
||||
FILE_DIR="/opt/neovim"
|
||||
FILE_NAME="nvim.appimage"
|
||||
FILE_NAME="nvim-linux-x86_64.appimage"
|
||||
FILE_URL="https://github.com/neovim/neovim/releases/download/nightly"
|
||||
TMP_FILE=$(mktemp $FILE_DIR/nvim.XXXXXX.appimage)
|
||||
|
||||
|
17
get_randr.pl
17
get_randr.pl
@@ -11,11 +11,12 @@ unless (exists $ENV{'WAYLAND_DISPLAY'}) {
|
||||
|
||||
my $app = {};
|
||||
$app->{'displays'} = {};
|
||||
$app->{'setup'} = "";
|
||||
|
||||
get_display_info($app);
|
||||
show_debug(Data::Dumper->Dump([$app]));
|
||||
my $wlr_line = get_wlr_line($app);
|
||||
|
||||
notify($app);
|
||||
print "${wlr_line}\n";
|
||||
|
||||
# -----------
|
||||
@@ -94,6 +95,7 @@ sub get_wlr_line {
|
||||
my $num_disps = scalar(keys(%{$app->{'displays'}}));
|
||||
if ($num_disps == 1) {
|
||||
show_debug("Single display configuration");
|
||||
$app->{'setup'} = "Single display configuration";
|
||||
$wlr_line = "wlr-randr --output HDMI-A-1 --off --output eDP-1 --on --pos 0,0"
|
||||
} elsif ($num_disps > 1) {
|
||||
# Determine setup (Custom)
|
||||
@@ -104,6 +106,7 @@ sub get_wlr_line {
|
||||
my ($h, $v) = get_display_current_dimensions($app, $matching_disps->[0]);
|
||||
my $disp_name = $matching_disps->[0]->{'name'};
|
||||
show_debug("Multiple display configuration: Den room");
|
||||
$app->{'setup'} = "Multiple display configuration: Den room";
|
||||
|
||||
$wlr_line = "wlr-randr --output ${disp_name} --on --pos 0,0 --output eDP-1 --on --pos ${h},0";
|
||||
}
|
||||
@@ -115,6 +118,7 @@ sub get_wlr_line {
|
||||
my ($h, $v) = get_display_current_dimensions($app, $matching_disps->[0]);
|
||||
my $disp_name = $matching_disps->[0]->{'name'};
|
||||
show_debug("Multiple display configuration: Media room");
|
||||
$app->{'setup'} = "Multiple display configuration: Media room";
|
||||
|
||||
$wlr_line = "wlr-randr --output ${disp_name} --on --pos 0,0 --output eDP-1 --on --pos 0,${v}";
|
||||
}
|
||||
@@ -153,9 +157,20 @@ sub get_display_current_dimensions {
|
||||
|
||||
return ($disp->{'current_mode'}->{'horizontal'}, $disp->{'current_mode'}->{'vertical'});
|
||||
}
|
||||
# -----------
|
||||
sub notify {
|
||||
my ($app) = @_;
|
||||
|
||||
system("notify-send",
|
||||
"--app-name=get_randr.pl",
|
||||
"--icon=/usr/share/icons/Adwaita/scalable/devices/video-display.svg",
|
||||
"--expire-time=5000",
|
||||
"Display Configuration Changed", "Now set to - $app->{'setup'}");
|
||||
}
|
||||
|
||||
# -----------
|
||||
sub show_debug {
|
||||
my ($str) = @_;
|
||||
# UNCOMMENT TO DEBUG # print "[DEBUG] $str\n";
|
||||
}
|
||||
|
||||
|
@@ -3,15 +3,18 @@
|
||||
|
||||
# Font
|
||||
font-family = Iosevka Term
|
||||
font-size = 13
|
||||
font-size = 15
|
||||
|
||||
# Theme
|
||||
theme = MaterialOcean
|
||||
# theme = MaterialOcean
|
||||
theme = 0x96f
|
||||
|
||||
# Cursor
|
||||
cursor-color = #aa2222
|
||||
cursor-opacity = 0.6
|
||||
cursor-opacity = 0.8
|
||||
cursor-style = block
|
||||
cursor-style-blink = false
|
||||
shell-integration-features = no-cursor
|
||||
|
||||
# Window
|
||||
window-decoration = false
|
||||
|
@@ -35,7 +35,7 @@ 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' }
|
||||
@@ -44,9 +44,66 @@ 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'
|
||||
}
|
||||
},
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
branch = 'master',
|
||||
lazy = false,
|
||||
build = ":TSUpdate"
|
||||
},
|
||||
-- Copilot setup
|
||||
"github/copilot.vim",
|
||||
-- {
|
||||
-- "zbirenbaum/copilot-cmp",
|
||||
-- config = function ()
|
||||
-- require("copilot_cmp").setup()
|
||||
-- end
|
||||
-- }
|
||||
})
|
||||
|
||||
-- Treesitter
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
|
||||
ensure_installed = { "verilog", "rust" },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
-- List of parsers to ignore installing (or "all")
|
||||
--ignore_install = { "javascript" },
|
||||
|
||||
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
|
||||
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
|
||||
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
|
||||
-- the name of the parser)
|
||||
-- list of language that will be disabled
|
||||
--disable = { "c", "rust" },
|
||||
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
|
||||
disable = function(lang, buf)
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
}
|
||||
|
||||
-- LuaLine
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
@@ -117,7 +174,7 @@ require('onedark').load()
|
||||
-- See `:help vim.o`
|
||||
|
||||
if vim.g.neovide then
|
||||
vim.o.guifont = "Iosevka Term:h13"
|
||||
vim.o.guifont = "Iosevka Term:h15"
|
||||
vim.g.neovide_scale_factor = 1.0
|
||||
end
|
||||
|
||||
@@ -239,7 +296,8 @@ vim.g.NERDTreeKeepTreeInNewTab = 1
|
||||
vim.g.nerdtree_tabs_open_on_gui_startup = 0
|
||||
|
||||
-- Filetype assignments - TODO: Is there an automatic way for this?
|
||||
vim.cmd("au! BufRead,BufNewFile *.sv,*.svh set filetype=verilog_systemverilog")
|
||||
-- vim.cmd("au! BufRead,BufNewFile *.sv,*.svh set filetype=verilog_systemverilog")
|
||||
-- vim.cmd("au! BufRead,BufNewFile *.sv,*.svh set filetype=verilog")
|
||||
vim.cmd("au! BufRead,BufNewFile *iosfsb_trk.out set filetype=iosfsbtrk")
|
||||
vim.cmd("au! BufRead,BufNewFile *iosf_trk.out set filetype=iosftrk")
|
||||
|
||||
|
27
root.bashrc
27
root.bashrc
@@ -3,14 +3,23 @@
|
||||
# --------------------------------
|
||||
# Shell RC
|
||||
# --------------------------------
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;41m\]$(hostname)\[\033[00m\]\[\033[01;34m\] \w\[\033[00m\] \$ '
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;41m\]$(hostnamectl hostname)\[\033[00m\]\[\033[01;34m\] \w\[\033[00m\] \$ '
|
||||
|
||||
#
|
||||
# Variables
|
||||
#
|
||||
export EDITOR=n
|
||||
export PATH=~/bin:$PATH
|
||||
|
||||
#
|
||||
# Editor setup
|
||||
#
|
||||
export PATH=/opt/neovim:$PATH
|
||||
export EDITOR=nvim
|
||||
|
||||
function n () {
|
||||
/opt/neovim/nvim $* || nvim $*
|
||||
}
|
||||
|
||||
#
|
||||
# Aliases
|
||||
#
|
||||
@@ -18,20 +27,10 @@ alias ls='ls -al --color'
|
||||
alias q=exit
|
||||
alias a=clear
|
||||
alias h=history
|
||||
alias e=$EDITOR
|
||||
|
||||
#
|
||||
# Functions
|
||||
#
|
||||
function myvim () {
|
||||
gvim $1 >& /dev/null &
|
||||
disown %1
|
||||
}
|
||||
|
||||
function n () {
|
||||
/opt/neovim/nvim $* || nvim $*
|
||||
}
|
||||
|
||||
function hgrep () {
|
||||
history | grep $1
|
||||
}
|
||||
@@ -42,10 +41,10 @@ function pgrep () {
|
||||
|
||||
function u2d () {
|
||||
~mahesh/git/snips/get_neovim.sh
|
||||
~mahesh/git/snips/get_wezterm.sh
|
||||
# ~mahesh/git/snips/get_wezterm.sh
|
||||
cd
|
||||
if [ -e /etc/arch-release ]; then
|
||||
pacman -Syu
|
||||
pacman --sync --refresh --sysupgrade --noconfirm
|
||||
elif [ -e /etc/debian_version ]; then
|
||||
apt update && apt full-upgrade -y && apt autoremove -y
|
||||
else
|
||||
|
@@ -17,9 +17,19 @@ PS1='${debian_chroot:+($debian_chroot)}\[\033[01;92m\]$(hostnamectl hostname)\[\
|
||||
#
|
||||
# Variables
|
||||
#
|
||||
#export EDITOR=vim
|
||||
export EDITOR=nvim
|
||||
export PATH=~/bin:~/.local/bin:$PATH
|
||||
export IGNOREEOF=50 # Ignore first 50 Ctrl-D on shell
|
||||
export GPG_TTY=$(tty)
|
||||
|
||||
#
|
||||
# Editor setup
|
||||
#
|
||||
export PATH=/opt/neovim:$PATH
|
||||
export EDITOR=nvim
|
||||
|
||||
function n () {
|
||||
/opt/neovim/nvim $* || nvim $*
|
||||
}
|
||||
|
||||
#
|
||||
# Aliases
|
||||
@@ -28,18 +38,11 @@ alias ls='ls -altrh --color'
|
||||
alias q=exit
|
||||
alias a=clear
|
||||
alias h=history
|
||||
alias e=$EDITOR
|
||||
alias n=$EDITOR
|
||||
alias gn='neovide --fork'
|
||||
|
||||
#
|
||||
# Functions
|
||||
#
|
||||
function myvim () {
|
||||
gvim $1 >& /dev/null &
|
||||
disown %1
|
||||
}
|
||||
|
||||
function pyedit () {
|
||||
gedit $1 >& /dev/null &
|
||||
disown %1
|
||||
@@ -56,3 +59,7 @@ function pgrep () {
|
||||
function start_tmux () {
|
||||
TERM=screen-256color tmux -u new -A -s DevEnv
|
||||
}
|
||||
|
||||
function start_gitui() {
|
||||
GPG_TTY=$(tty) gitui
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ ${if_existing /sys/class/net/enp3s0/operstate up}🌎 ${addr enp3s0}${else}\
|
||||
${if_existing /sys/class/net/wlp4s0/operstate up}📶 ${addr wlp4s0}${else}\
|
||||
${if_up eth0}🌎 ${addr eth0}${else}\
|
||||
network down ${endif}${endif}${endif}${endif}${endif}${endif} \
|
||||
${execi 600 curl 'wttr.in/~45.54,-122.83?u&format=%c%t'} \
|
||||
${execi 600 curl 'wttr.in/~45.5202471,-122.6741948?u&format=%c%t'} \
|
||||
🔊 ${execi 10 wpctl get-volume 53 | tail -1 | perl -ne 'm/([\d\.]+)/; print scalar (($1>1) ? 100 : ($1*100))'} \
|
||||
${if_existing /sys/class/power_supply/ADP0/online 1}🔌${else}🔋${endif} ${battery_percent}% \
|
||||
📅 ${time %Y %h %d} \
|
||||
@@ -58,6 +58,7 @@ ${if_existing /sys/class/power_supply/ADP0/online 1}🔌${else}🔋${endif} ${ba
|
||||
--[[
|
||||
Reference
|
||||
|
||||
${execi 600 curl 'wttr.in/~45.54,-122.83?u&format=%c%t'} \
|
||||
|
||||
🌡 ${execi 600 weather fips4105192520 | grep Tempera | awk '{print $2}'}°F | \
|
||||
${execi 1 cat /tmp/dwl.tags.out} | \
|
||||
|
Reference in New Issue
Block a user