Compare commits
8 Commits
f683d77a39
...
4de2de5cf7
Author | SHA1 | Date | |
---|---|---|---|
4de2de5cf7 | |||
8ef05d2a11 | |||
257c6a0b38 | |||
fd9de58b0f | |||
263aeed08f | |||
e986f0eabb | |||
267e505265 | |||
3f7e576869 |
@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
swayidle -w \
|
swayidle -w \
|
||||||
timeout 600 'systemctl hybrid-sleep' &
|
timeout 6000 'systemctl hybrid-sleep' &
|
||||||
|
@ -6,7 +6,7 @@ function die() {
|
|||||||
|
|
||||||
START_DIR=$(pwd)
|
START_DIR=$(pwd)
|
||||||
FILE_DIR="/opt/neovim"
|
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"
|
FILE_URL="https://github.com/neovim/neovim/releases/download/nightly"
|
||||||
TMP_FILE=$(mktemp $FILE_DIR/nvim.XXXXXX.appimage)
|
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 = {};
|
my $app = {};
|
||||||
$app->{'displays'} = {};
|
$app->{'displays'} = {};
|
||||||
|
$app->{'setup'} = "";
|
||||||
|
|
||||||
get_display_info($app);
|
get_display_info($app);
|
||||||
show_debug(Data::Dumper->Dump([$app]));
|
show_debug(Data::Dumper->Dump([$app]));
|
||||||
my $wlr_line = get_wlr_line($app);
|
my $wlr_line = get_wlr_line($app);
|
||||||
|
notify($app);
|
||||||
print "${wlr_line}\n";
|
print "${wlr_line}\n";
|
||||||
|
|
||||||
# -----------
|
# -----------
|
||||||
@ -94,6 +95,7 @@ sub get_wlr_line {
|
|||||||
my $num_disps = scalar(keys(%{$app->{'displays'}}));
|
my $num_disps = scalar(keys(%{$app->{'displays'}}));
|
||||||
if ($num_disps == 1) {
|
if ($num_disps == 1) {
|
||||||
show_debug("Single display configuration");
|
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"
|
$wlr_line = "wlr-randr --output HDMI-A-1 --off --output eDP-1 --on --pos 0,0"
|
||||||
} elsif ($num_disps > 1) {
|
} elsif ($num_disps > 1) {
|
||||||
# Determine setup (Custom)
|
# Determine setup (Custom)
|
||||||
@ -104,6 +106,7 @@ sub get_wlr_line {
|
|||||||
my ($h, $v) = get_display_current_dimensions($app, $matching_disps->[0]);
|
my ($h, $v) = get_display_current_dimensions($app, $matching_disps->[0]);
|
||||||
my $disp_name = $matching_disps->[0]->{'name'};
|
my $disp_name = $matching_disps->[0]->{'name'};
|
||||||
show_debug("Multiple display configuration: Den room");
|
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";
|
$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 ($h, $v) = get_display_current_dimensions($app, $matching_disps->[0]);
|
||||||
my $disp_name = $matching_disps->[0]->{'name'};
|
my $disp_name = $matching_disps->[0]->{'name'};
|
||||||
show_debug("Multiple display configuration: Media room");
|
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}";
|
$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'});
|
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 {
|
sub show_debug {
|
||||||
my ($str) = @_;
|
my ($str) = @_;
|
||||||
# UNCOMMENT TO DEBUG # print "[DEBUG] $str\n";
|
# UNCOMMENT TO DEBUG # print "[DEBUG] $str\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,15 +3,18 @@
|
|||||||
|
|
||||||
# Font
|
# Font
|
||||||
font-family = Iosevka Term
|
font-family = Iosevka Term
|
||||||
font-size = 13
|
font-size = 15
|
||||||
|
|
||||||
# Theme
|
# Theme
|
||||||
theme = MaterialOcean
|
# theme = MaterialOcean
|
||||||
|
theme = 0x96f
|
||||||
|
|
||||||
# Cursor
|
# Cursor
|
||||||
cursor-color = #aa2222
|
cursor-color = #aa2222
|
||||||
cursor-opacity = 0.6
|
cursor-opacity = 0.8
|
||||||
cursor-style = block
|
cursor-style = block
|
||||||
|
cursor-style-blink = false
|
||||||
|
shell-integration-features = no-cursor
|
||||||
|
|
||||||
# Window
|
# Window
|
||||||
window-decoration = false
|
window-decoration = false
|
||||||
|
@ -117,7 +117,7 @@ require('onedark').load()
|
|||||||
-- See `:help vim.o`
|
-- See `:help vim.o`
|
||||||
|
|
||||||
if vim.g.neovide then
|
if vim.g.neovide then
|
||||||
vim.o.guifont = "Iosevka Term:h13"
|
vim.o.guifont = "Iosevka Term:h15"
|
||||||
vim.g.neovide_scale_factor = 1.0
|
vim.g.neovide_scale_factor = 1.0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
27
root.bashrc
27
root.bashrc
@ -3,14 +3,23 @@
|
|||||||
# --------------------------------
|
# --------------------------------
|
||||||
# Shell RC
|
# 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
|
# Variables
|
||||||
#
|
#
|
||||||
export EDITOR=n
|
|
||||||
export PATH=~/bin:$PATH
|
export PATH=~/bin:$PATH
|
||||||
|
|
||||||
|
#
|
||||||
|
# Editor setup
|
||||||
|
#
|
||||||
|
export PATH=/opt/neovim:$PATH
|
||||||
|
export EDITOR=nvim
|
||||||
|
|
||||||
|
function n () {
|
||||||
|
/opt/neovim/nvim $* || nvim $*
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Aliases
|
# Aliases
|
||||||
#
|
#
|
||||||
@ -18,20 +27,10 @@ alias ls='ls -al --color'
|
|||||||
alias q=exit
|
alias q=exit
|
||||||
alias a=clear
|
alias a=clear
|
||||||
alias h=history
|
alias h=history
|
||||||
alias e=$EDITOR
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Functions
|
# Functions
|
||||||
#
|
#
|
||||||
function myvim () {
|
|
||||||
gvim $1 >& /dev/null &
|
|
||||||
disown %1
|
|
||||||
}
|
|
||||||
|
|
||||||
function n () {
|
|
||||||
/opt/neovim/nvim $* || nvim $*
|
|
||||||
}
|
|
||||||
|
|
||||||
function hgrep () {
|
function hgrep () {
|
||||||
history | grep $1
|
history | grep $1
|
||||||
}
|
}
|
||||||
@ -42,10 +41,10 @@ function pgrep () {
|
|||||||
|
|
||||||
function u2d () {
|
function u2d () {
|
||||||
~mahesh/git/snips/get_neovim.sh
|
~mahesh/git/snips/get_neovim.sh
|
||||||
~mahesh/git/snips/get_wezterm.sh
|
# ~mahesh/git/snips/get_wezterm.sh
|
||||||
cd
|
cd
|
||||||
if [ -e /etc/arch-release ]; then
|
if [ -e /etc/arch-release ]; then
|
||||||
pacman -Syu
|
pacman --sync --refresh --sysupgrade --noconfirm
|
||||||
elif [ -e /etc/debian_version ]; then
|
elif [ -e /etc/debian_version ]; then
|
||||||
apt update && apt full-upgrade -y && apt autoremove -y
|
apt update && apt full-upgrade -y && apt autoremove -y
|
||||||
else
|
else
|
||||||
|
@ -17,9 +17,19 @@ PS1='${debian_chroot:+($debian_chroot)}\[\033[01;92m\]$(hostnamectl hostname)\[\
|
|||||||
#
|
#
|
||||||
# Variables
|
# Variables
|
||||||
#
|
#
|
||||||
#export EDITOR=vim
|
|
||||||
export EDITOR=nvim
|
|
||||||
export PATH=~/bin:~/.local/bin:$PATH
|
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
|
# Aliases
|
||||||
@ -28,18 +38,11 @@ alias ls='ls -altrh --color'
|
|||||||
alias q=exit
|
alias q=exit
|
||||||
alias a=clear
|
alias a=clear
|
||||||
alias h=history
|
alias h=history
|
||||||
alias e=$EDITOR
|
|
||||||
alias n=$EDITOR
|
|
||||||
alias gn='neovide --fork'
|
alias gn='neovide --fork'
|
||||||
|
|
||||||
#
|
#
|
||||||
# Functions
|
# Functions
|
||||||
#
|
#
|
||||||
function myvim () {
|
|
||||||
gvim $1 >& /dev/null &
|
|
||||||
disown %1
|
|
||||||
}
|
|
||||||
|
|
||||||
function pyedit () {
|
function pyedit () {
|
||||||
gedit $1 >& /dev/null &
|
gedit $1 >& /dev/null &
|
||||||
disown %1
|
disown %1
|
||||||
@ -56,3 +59,7 @@ function pgrep () {
|
|||||||
function start_tmux () {
|
function start_tmux () {
|
||||||
TERM=screen-256color tmux -u new -A -s DevEnv
|
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_existing /sys/class/net/wlp4s0/operstate up}📶 ${addr wlp4s0}${else}\
|
||||||
${if_up eth0}🌎 ${addr eth0}${else}\
|
${if_up eth0}🌎 ${addr eth0}${else}\
|
||||||
network down ${endif}${endif}${endif}${endif}${endif}${endif} \
|
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))'} \
|
🔊 ${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}% \
|
${if_existing /sys/class/power_supply/ADP0/online 1}🔌${else}🔋${endif} ${battery_percent}% \
|
||||||
📅 ${time %Y %h %d} \
|
📅 ${time %Y %h %d} \
|
||||||
@ -58,6 +58,7 @@ ${if_existing /sys/class/power_supply/ADP0/online 1}🔌${else}🔋${endif} ${ba
|
|||||||
--[[
|
--[[
|
||||||
Reference
|
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 600 weather fips4105192520 | grep Tempera | awk '{print $2}'}°F | \
|
||||||
${execi 1 cat /tmp/dwl.tags.out} | \
|
${execi 1 cat /tmp/dwl.tags.out} | \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user