From 5de43bb3740eef3f040da93eea1fe08c9bc26263 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Wed, 11 May 2022 10:40:49 +0900 Subject: Update lab config --- awesome/.config/awesome/rc.lua | 35 ++++++++++++--- awesome/.config/awesome/themes/srcery/theme.lua | 1 - awesome/.config/awesome/vicious | 2 +- dev/.ssh/config | 14 +++--- nix/awesome.nix | 2 +- nix/configuration.nix | 21 ++++----- nix/devel.nix | 2 +- nix/games.nix | 16 ++++--- nix/overgrowth.nix | 57 +++++++++++++++++++++++++ nixos/.Xdefaults | 2 +- nixos/.config/systemd/user/mbsync.service | 2 +- 11 files changed, 117 insertions(+), 37 deletions(-) create mode 100644 nix/overgrowth.nix diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua index adf9ee3..44a017e 100644 --- a/awesome/.config/awesome/rc.lua +++ b/awesome/.config/awesome/rc.lua @@ -317,7 +317,7 @@ local function set_wallpaper(s) -- Wallpaper if beautiful.wallpaper then local wallpaper = beautiful.wallpaper - if s.geometry.width > 3000 then + if s.geometry.width > 2880 then wallpaper = beautiful.wallpaper_wide end if type(wallpaper) == "function" then @@ -342,12 +342,8 @@ screen.connect_signal("property::geometry", set_wallpaper) awful.screen.connect_for_each_screen(function (s) set_wallpaper(s) -- Each screen has its own tag table. - if s.geometry.width > 3000 then - awful.tag({"1", "2", "3", "4", "5", "6", "7", "8", "9"}, s, - awful.layout.suit.tile.bottom) - else - awful.tag({"1", "2", "3", "4", "5", "6", "7", "8", "9"}, s, - awful.layout.suit.fair) + awful.tag({"1", "2", "3", "4", "5", "6", "7", "8", "9"}, + s, awful.layout.suit.fair) end -- Create a promptbox for each screen @@ -483,6 +479,31 @@ local globalkeys = awful.util.table.join( awful.key({modkey}, "[", function () awful.screen.focus_relative(1) end, {description = "focus the previous screen", group = "screen"}), + awful.key({modkey}, "0", + function () + for s in screen do + if s.geometry.width > 2880 then + local geo = s.geometry + s.phy_width = geo.width + s:fake_resize(geo.x, geo.y, 1920, geo.height) + s.fake = screen.fake_add(geo.x + 1920, geo.y, + s.phy_width - 1920, geo.height) + end + end + end, + {description = "add fake screens", group = "screen"}), + awful.key({modkey, "Shift"}, "0", + function () + for s in screen do + if s.fake ~= nil then + local geo = s.geometry + s:fake_resize(geo.x, geo.y, s.phy_width, geo.height) + s.fake:fake_remove() + s.fake = nil + end + end + end, + {description = "add fake screens", group = "screen"}), awful.key({modkey}, "u", awful.client.urgent.jumpto, {description = "jump to urgent client", group = "client"}), awful.key({modkey}, "Tab", diff --git a/awesome/.config/awesome/themes/srcery/theme.lua b/awesome/.config/awesome/themes/srcery/theme.lua index 0773480..3a46f6d 100644 --- a/awesome/.config/awesome/themes/srcery/theme.lua +++ b/awesome/.config/awesome/themes/srcery/theme.lua @@ -141,7 +141,6 @@ theme.layout_cornernw = layout'cornernw' theme.layout_cornerne = layout'cornerne' theme.layout_cornersw = layout'cornersw' theme.layout_cornerse = layout'cornerse' -theme.master_count = 3 theme.awesome_icon = abspath'awesome.png' diff --git a/awesome/.config/awesome/vicious b/awesome/.config/awesome/vicious index 81f8a80..afb6fff 160000 --- a/awesome/.config/awesome/vicious +++ b/awesome/.config/awesome/vicious @@ -1 +1 @@ -Subproject commit 81f8a8077437d32fd31de87493be5ce346d7b6cc +Subproject commit afb6fffafc629e3c0b57d444be6a8618db8698fc diff --git a/dev/.ssh/config b/dev/.ssh/config index 681714a..e2c9e31 100644 --- a/dev/.ssh/config +++ b/dev/.ssh/config @@ -1,8 +1,12 @@ AddKeysToAgent yes -Host comlake - HostName ictlab.usth.edu.vn - User phongng - Port 22222 +Host loang + HostName 37.205.11.127 + User cnx + Port 2211 + +Host rack + HostName 10.20.18.56 + User cnx + Port 4071 RequestTTY yes - RemoteCommand ssh comlake diff --git a/nix/awesome.nix b/nix/awesome.nix index d5375be..19b8903 100644 --- a/nix/awesome.nix +++ b/nix/awesome.nix @@ -41,7 +41,7 @@ clipbuzz keynav playerctl pulsemixer xclip xdotool xorg.xkill aerc amfora calcurse dante khard ncdu ranger ueberzug vim_configurable arandr audacious liferea scrot rxvt-unicode zathura - firefox gajim libreoffice mepo nheko obs-studio tor-browser-bundle-bin + firefox libreoffice mepo-x11 nheko obs-studio tor-browser-bundle-bin nextcloud-client transmission-gtk ]; diff --git a/nix/configuration.nix b/nix/configuration.nix index 33b4ace..5b1f698 100644 --- a/nix/configuration.nix +++ b/nix/configuration.nix @@ -28,28 +28,23 @@ networking = { hostName = "nix"; + hosts = { + "0.0.0.0" = [ "9gag.com" "voz.vn" ]; + }; nameservers = [ "9.9.9.11" "149.112.112.11" ]; - extraHosts = '' - 0.0.0.0 9gag.com - ''; networkmanager.enable = true; - # The global useDHCP flag is deprecated, therefore explicitly set - # to false here. Per-interface useDHCP will be mandatory in the future, - # so this generated config replicates the default behaviour. - useDHCP = false; - interfaces.enp1s0.useDHCP = true; - interfaces.wlp2s0.useDHCP = true; + interfaces = { + enp1s0.useDHCP = true; + wlp2s0.useDHCP = true; + }; # Configure network proxy if necessary # proxy.default = "http://user:password@proxy:port/"; # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; # Open ports in the firewall. - # firewall.allowedTCPPorts = [ ... ]; - # firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # firewall.enable = false; + firewall.allowedUDPPorts = [ 4001 ]; }; # Set your time zone. diff --git a/nix/devel.nix b/nix/devel.nix index cdf09a7..1be5435 100644 --- a/nix/devel.nix +++ b/nix/devel.nix @@ -22,11 +22,11 @@ }; ipfs = { + enableGC = true; user = "sea"; dataDir = "/home/sea/.ipfs"; # autoMount = true; localDiscovery = true; - enableGC = true; }; }; } diff --git a/nix/games.nix b/nix/games.nix index 0ef6905..2921486 100644 --- a/nix/games.nix +++ b/nix/games.nix @@ -1,17 +1,21 @@ { config, pkgs, ... }: -{ +let + overgrowth = pkgs.callPackage ./overgrowth.nix { + aux-data = "/home/sea/Games/Overgrowth"; + }; +in { environment.systemPackages = with pkgs; [ - hedgewars scorched3d teeworlds # _20kly strategy + scorched3d zeroad # hedgewars _20kly strategy astromenace chromium-bsu # scrolling - azimuth cdogs-sdl taisei # shmup + taisei # shmup bastet moon-buggy n2048 # text - blackshades redeclipse xonotic-glx # fps - blobwars openclonk superTux # platformer + blackshades xonotic-glx # fps + blobwars superTux teeworlds # platformer bonzomatic # engine extremetuxracer gl117 gltron superTuxKart # vehicle flare freedroidrpg hyperrogue # slash frozen-bubble pinball xbill # coffeebreak - orthorobot # neverball puzzle + neverball # puzzle ]; } diff --git a/nix/overgrowth.nix b/nix/overgrowth.nix new file mode 100644 index 0000000..5b59134 --- /dev/null +++ b/nix/overgrowth.nix @@ -0,0 +1,57 @@ +{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, makeDesktopItem +, libGL, libGLU, SDL2, SDL2_net, gtk2, glib +, openal, libogg, libvorbis, libtheora +, libjpeg, freeimage, freetype, bzip2 +, aux-data ? "" }: + +let + desktopItem = makeDesktopItem { + name = "overgrowth"; + desktopName = "Overgrowth"; + icon = "overgrowth"; + exec = "overgrowth"; + path = aux-data; + categories = [ "Game" ]; + }; +in stdenv.mkDerivation rec { + pname = "overgrowth"; + version = "unstable-2022-04-29"; + + src = fetchFromGitHub { + owner = "WolfireGames"; + repo = pname; + rev = "dbe069e42e1cea27654a8fb618fdde77f41ac257"; + sha256 = "sha256-81VKN0mU8XFdOZb6jrii2FeyVXCUiytcF2pgdO0je0s="; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ + libGL libGLU SDL2 SDL2_net gtk2 glib + openal libogg libvorbis libtheora + libjpeg freeimage freetype bzip2 + ]; + + cmakeFlags = [ + "-S../Projects" + "-DAUX_DATA=${aux-data}" + "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include" + "-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include" + ]; + hardeningDisable = [ "format" ]; + + installPhase = '' + install -D build/Overgrowth.bin.* $out/bin/overgrowth + install -D Projects/OGIcon.png\ + $out/share/icons/hicolor/1024x1024/apps/overgrowth.png + install -D ${desktopItem}/share/applications/overgrowth.desktop \ + $out/share/applications/overgrowth.desktop + ''; + + meta = { + description = "Third person ninja rabbit fighting game"; + homepage = "https://overgrowth.wolfire.com"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.McSinyx ]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixos/.Xdefaults b/nixos/.Xdefaults index b9581ea..869589d 100644 --- a/nixos/.Xdefaults +++ b/nixos/.Xdefaults @@ -29,7 +29,7 @@ URxvt.jumpScroll: true URxvt.font: xft:Latin Modern Mono:size=15:autohint=true URxvt.termName: rxvt-unicode-256color URxvt.perl-ext-common: default,font-size,autocomplete-ALL-the-things -URxvt.font-size.step: 1 +URxvt.font-size.step: 3 URxvt.keysym.M-C-slash: perl:aAtt:word-complete URxvt.keysym.M-question: perl:aAtt:fuzzy-complete URxvt.keysym.M-quotedbl: perl:aAtt:undo diff --git a/nixos/.config/systemd/user/mbsync.service b/nixos/.config/systemd/user/mbsync.service index ca4a07b..85c522f 100644 --- a/nixos/.config/systemd/user/mbsync.service +++ b/nixos/.config/systemd/user/mbsync.service @@ -5,7 +5,7 @@ ConditionPathExists=%h/.mbsyncrc After=network.target [Service] -ExecStart=/run/current-system/sw/bin/mbsync primary school legacy +ExecStart=/run/current-system/sw/bin/mbsync primary school Type=oneshot [Install] -- cgit 1.4.1