Compare commits

...

8 Commits

8 changed files with 56 additions and 31 deletions

View File

@ -1,3 +1,3 @@
swayidle -w \
timeout 600 'systemctl hybrid-sleep' &
timeout 6000 'systemctl hybrid-sleep' &

View File

@ -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)

View File

@ -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";
}

View File

@ -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

View File

@ -117,7 +117,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

View File

@ -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

View File

@ -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
}

View File

@ -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} | \