bspwm config for big monitor

This commit is contained in:
Anish Lakhwara 2024-11-27 23:19:50 -08:00
parent 8d2f747337
commit e9b337128e
3 changed files with 33 additions and 19 deletions

View file

@ -92,7 +92,6 @@
manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview="manix '{}'" | xargs manix manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview="manix '{}'" | xargs manix
'') '')
(pkgs.writeScriptBin "monitor" '' (pkgs.writeScriptBin "monitor" ''
# hotplug
connect() { connect() {
# Turn it on if it was off # Turn it on if it was off
xrandr --output HDMI-2 --auto xrandr --output HDMI-2 --auto
@ -105,6 +104,24 @@
xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect
'') '')
(pkgs.writeScriptBin "big-monitor" ''
connect() {
# Turn it on if it was off
xrandr --output HDMI-2 --auto --primary
# Disable normal display
xrandr --output eDP-1 --off
# Use a nice background
feh --bg-scale ~/Downloads/stephen-walker-onIXxjH56AA-unsplash.jpg
# Reload Polybar
~/.config/bspwm/rc.d/polybar
}
disconnect() {
xrandr --output HDMI-2 --off
}
xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect
'')
(pkgs.writeScriptBin "disconnect-keyboard" '' (pkgs.writeScriptBin "disconnect-keyboard" ''
# keyboard on curve is busted # keyboard on curve is busted
get_keyboard_id() { get_keyboard_id() {

View file

@ -29,8 +29,8 @@ bspc config presel_feedback_color "#bd93f9"
bspc config split_ratio 0.71 bspc config split_ratio 0.71
# Extra padding for polybar # Extra padding for polybar
bspc config -m primary top_padding 34 bspc config top_padding 34
bspc config -m primary bottom_padding 0 bspc config bottom_padding 0
# Rules # Rules
bspc rule -r '*' bspc rule -r '*'

View file

@ -1,8 +1,8 @@
{ self, config, pkgs, lib, ... }: { self, config, pkgs, lib, ... }:
let let
tex = (pkgs.texlive.combine { tex = (pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-basic inherit (pkgs.texlive)
dvisvgm dvipng# for preview and export as html scheme-basic dvisvgm dvipng # for preview and export as html
wrapfig amsmath ulem hyperref capt-of; wrapfig amsmath ulem hyperref capt-of;
#(setq org-latex-compiler "lualatex") #(setq org-latex-compiler "lualatex")
#(setq org-preview-latex-default-process 'dvisvgm) #(setq org-preview-latex-default-process 'dvisvgm)
@ -13,13 +13,9 @@ let
rev = "502f212d83bc67e8f0499574546b99ec6c8e16f9"; rev = "502f212d83bc67e8f0499574546b99ec6c8e16f9";
sha256 = "1wx9nzq7cqyvpaq4j60bs8g7gh4jk8qg4016yi4c331l4iw1ymsa"; sha256 = "1wx9nzq7cqyvpaq4j60bs8g7gh4jk8qg4016yi4c331l4iw1ymsa";
}; };
in in {
{
# TODO modularize # TODO modularize
imports = [ imports = [ ./battery-low-timer.nix ./cal-alarms.nix ];
./battery-low-timer.nix
./cal-alarms.nix
];
# Secrets used by home-manager modules # Secrets used by home-manager modules
age.secrets.fastmail.file = "${self}/secrets/fastmail.age"; age.secrets.fastmail.file = "${self}/secrets/fastmail.age";
@ -29,7 +25,8 @@ in
age.secrets.mossnet.owner = "anish"; age.secrets.mossnet.owner = "anish";
# Taskwarrior private key # Taskwarrior private key
age.secrets.taskwarrior-private.file = "${self}/secrets/taskwarrior-private.age"; age.secrets.taskwarrior-private.file =
"${self}/secrets/taskwarrior-private.age";
age.secrets.taskwarrior-private.owner = "anish"; age.secrets.taskwarrior-private.owner = "anish";
# We don't plug USBs into servers # We don't plug USBs into servers
@ -56,14 +53,14 @@ in
XDG_BIN_HOME = "\${HOME}/.local/bin"; XDG_BIN_HOME = "\${HOME}/.local/bin";
XDG_DATA_HOME = "\${HOME}/.local/share"; XDG_DATA_HOME = "\${HOME}/.local/share";
PATH = [ PATH = [ "\${XDG_BIN_HOME}" ];
"\${XDG_BIN_HOME}"
];
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
#unstable.sublime-music #unstable.sublime-music
unstable.nheko # olm-3.2.16 is now insecure
# some reason I can't set insecure packages that will be respected
nheko
unstable.signal-desktop unstable.signal-desktop
unstable.tuba unstable.tuba
unstable.newsflash unstable.newsflash