From 3ce094b91e31f11f9457258f78b7f5ab2c43ad7c Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Tue, 8 Jun 2021 23:07:38 +0300 Subject: [PATCH] Automatically add cups printer --- modules/default.nix | 2 +- modules/workspace/git.nix | 2 +- modules/workspace/kde/default.nix | 1 - modules/workspace/misc.nix | 1 + modules/workspace/print-scan.nix | 12 - .../print-scan/Brother_HL-3170CDW_series.ppd | 715 ++++++++++++++++++ modules/workspace/print-scan/default.nix | 30 + 7 files changed, 748 insertions(+), 15 deletions(-) delete mode 100644 modules/workspace/print-scan.nix create mode 100755 modules/workspace/print-scan/Brother_HL-3170CDW_series.ppd create mode 100644 modules/workspace/print-scan/default.nix diff --git a/modules/default.nix b/modules/default.nix index 63f0b98..1f0d317 100755 --- a/modules/default.nix +++ b/modules/default.nix @@ -51,7 +51,7 @@ builtins.listToAttrs (builtins.map (path: { ./workspace/locale.nix ./workspace/mako.nix ./workspace/misc.nix - ./workspace/print-scan.nix + ./workspace/print-scan ./workspace/simple-osd-daemons.nix ./workspace/ssh.nix ./workspace/sway diff --git a/modules/workspace/git.nix b/modules/workspace/git.nix index 19d45f8..6922e9c 100644 --- a/modules/workspace/git.nix +++ b/modules/workspace/git.nix @@ -4,7 +4,7 @@ userEmail = "balsoft@balsoft.ru"; userName = "Alexander Bantyev"; extraConfig.pull.rebase = true; - ignores = [ ".envrc" ".direnv" ".#*" ]; + ignores = [ ".envrc" ".direnv" "*~" ]; signing = { signByDefault = true; key = "687558B21E04FE92B255BED0E081FF12ADCB4AD5"; diff --git a/modules/workspace/kde/default.nix b/modules/workspace/kde/default.nix index 63dbe88..7b7b635 100644 --- a/modules/workspace/kde/default.nix +++ b/modules/workspace/kde/default.nix @@ -13,7 +13,6 @@ with pkgs.my-lib; KDE_SESSION_VERSION = "5"; QT_SCALE_FACTOR = "1"; QT_AUTO_SCREEN_SCALE_FACTOR = "0"; - DE = "kde"; QT_QPA_PLATFORMTHEME = "kde"; KDEDIRS = "/run/current-system/sw:/run/current-system/sw/share/kservices5:/run/current-system/sw/share/kservicetypes5:/run/current-system/sw/share/kxmlgui5"; diff --git a/modules/workspace/misc.nix b/modules/workspace/misc.nix index 798c819..91b05bc 100644 --- a/modules/workspace/misc.nix +++ b/modules/workspace/misc.nix @@ -5,6 +5,7 @@ NIX_AUTO_RUN = "1"; LESS = "MR"; SYSTEMD_LESS = LESS; + DE = "generic"; }; home-manager.users.balsoft = { diff --git a/modules/workspace/print-scan.nix b/modules/workspace/print-scan.nix deleted file mode 100644 index 4d76c45..0000000 --- a/modules/workspace/print-scan.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, config, ... }: -{ - services.printing = { - enable = true; - drivers = [ pkgs.gutenprint ]; - }; - - hardware.sane.enable = true; - services.saned.enable = true; - - environment.systemPackages = [ pkgs.gnome3.simple-scan ]; -} diff --git a/modules/workspace/print-scan/Brother_HL-3170CDW_series.ppd b/modules/workspace/print-scan/Brother_HL-3170CDW_series.ppd new file mode 100755 index 0000000..80f8bd3 --- /dev/null +++ b/modules/workspace/print-scan/Brother_HL-3170CDW_series.ppd @@ -0,0 +1,715 @@ +*PPD-Adobe: "4.3" +*% This program is free software; you can redistribute it and/or modify it +*% under the terms of the GNU General Public License as published by the Free +*% Software Foundation; either version 2 of the License, or (at your option) +*% any later version. +*% +*% This program is distributed in the hope that it will be useful, but WITHOUT +*% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +*% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +*% more details. +*% +*% You should have received a copy of the GNU General Public License along with +*% this program; if not, write to the Free Software Foundation, Inc., 59 Temple +*% Place, Suite 330, Boston, MA 02111-1307 USA +*% + + +*%================================================ +*% Copyright(C) 2006 Brother Industries, Ltd. +*% "Brother HL-4070CDW BR-Script3" +*%================================================ + +*%==== General Information Keywords ======================== +*FormatVersion: "4.3" +*FileVersion: "1.08" +*LanguageEncoding: ISOLatin1 +*LanguageVersion: English +*Manufacturer: "Brother" +*PCFileName: "BR4070_2.PPD" +*Product: "(Brother HL-4070CDW)" +*PSVersion: "(3010.106) 3" +*ShortNickName: "Brother HL-4070CDW BR-Script3" +*ModelName: "Brother HL-4070CDW BR-Script3" +*NickName: "Brother HL-4070CDW BR-Script3 , Postscript-Brother 20130226 (OpenPrinting LSB 3.2)" + +*%==== Basic Device Capabilities ============= +*LanguageLevel: "3" +*TTRasterizer: Type42 +*ColorDevice: True +*DefaultColorSpace: CMYK +*FileSystem: True +*?FileSystem:" +save + /devname (%disk0%) def + /ret false def + 0 1 7{ + devname exch 48 add 5 exch put + devname devstatus { + 0 ne {/ret true def}if + pop pop pop pop pop pop pop + }if + }for + ret {(True)}{(False)} ifelse = flush +restore +" +*End + +*Throughput: "20" +*FreeVM: "2700000" + +*%==== Emulations and Protocols ========== +*Protocols: PJL TBCP + +*SuggestedJobTimeout: "0" +*SuggestedWaitTimeout: "300" +*PrintPSErrors: True + +*%==== PostScript Patches ========== +*%*JobPatchFile 1: "statusdict/setusbbinary known{statusdict begin true setusbbinary end}if" + +*%==== JCL Features ========================== +*JCLBegin: "<1B>%-12345X@PJL JOB<0A>" +*JCLToPSInterpreter: "@PJL ENTER LANGUAGE = POSTSCRIPT <0A>" +*JCLEnd: "<1B>%-12345X@PJL EOJ <0A><1B>%-12345X" + +*%==== Installable Options =================== + +*OpenGroup: InstallableOptions/Options Installed + +*OpenUI *OptionTrays/Number of Input Trays: PickOne +*DefaultOptionTrays: 2Trays +*OptionTrays 1Trays/ 1: "" +*OptionTrays 2Trays/ 2: "" +*?OptionTrays:" +save + <>setpagedevice currentpagedevice/BRFeeder get + 1 eq{(2Trays)}{(1Trays)}ifelse + = flush +restore +" +*End +*CloseUI: *OptionTrays + +*CloseGroup: InstallableOptions + +*UIConstraints: *OptionTrays 1Trays *InputSlot Tray2 +*UIConstraints: *InputSlot Tray2 *OptionTrays 1Trays + + +*%==== Media Selection ====================== + +*OpenUI *PageSize: PickOne +*OrderDependency: 30 AnySetup *PageSize +*DefaultPageSize: A4 +*PageSize Letter/Letter: "<< /PageSize [612 792] /ImagingBBox null >> setpagedevice" +*PageSize Legal/Legal: "<< /PageSize [612 1008] /ImagingBBox null >> setpagedevice" +*PageSize Executive/Executive: "<< /PageSize [522 756] /ImagingBBox null >> setpagedevice" +*PageSize A4/A4: "<< /PageSize [595 842] /ImagingBBox null >> setpagedevice" +*PageSize A4Long/A4 Long: "<< /PageSize [595 1147] /ImagingBBox null >> setpagedevice" +*PageSize A5/A5: "<< /PageSize [420 595] /ImagingBBox null >> setpagedevice" +*PageSize A6/A6: "<< /PageSize [297 420] /ImagingBBox null >> setpagedevice" +*PageSize Env10/Com-10: "<< /PageSize [297 684] /ImagingBBox null >> setpagedevice" +*PageSize EnvMonarch/Monarch: "<> setpagedevice" +*PageSize EnvDL/DL: "<< /PageSize [312 624] /ImagingBBox null >> setpagedevice" +*PageSize EnvDLRotated/DL Long Edge: "<< /PageSize [624 312] /ImagingBBox null >> setpagedevice" +*PageSize EnvC5/C5: "<> setpagedevice" +*PageSize EnvISOB5/B5 : "<< /PageSize [499 709] /ImagingBBox null >> setpagedevice" +*PageSize EnvISOB6/B6 : "<< /PageSize [354 499] /ImagingBBox null >> setpagedevice" +*PageSize B5/JIS B5: "<< /PageSize [515.0 727.0] /ImagingBBox null >> setpagedevice" +*PageSize FanFoldGermanLegal/Folio: "<< /PageSize [612 936] /ImagingBBox null >> setpagedevice" +*PageSize 2.75x3/Organizer J: "<< /PageSize [198 360] /ImagingBBox null >> setpagedevice" +*PageSize Bible/Organizer K: "<< /PageSize [270 486] /ImagingBBox null >> setpagedevice" +*PageSize Statement/Organizer L: "<< /PageSize [396 612] /ImagingBBox null >> setpagedevice" +*PageSize OrgM/Organizer M: "<< /PageSize [611 792] /ImagingBBox null >> setpagedevice" +*PageSize 3x5/3x5: "<< /PageSize [216 360] /ImagingBBox null >> setpagedevice" +*PageSize Postcard/Postcard: "<< /PageSize [284 419] /ImagingBBox null >> setpagedevice" +*CloseUI: *PageSize + +*OpenUI *PageRegion: PickOne +*OrderDependency: 40 AnySetup *PageRegion +*DefaultPageRegion: A4 +*PageRegion Letter/Letter: "<< /PageSize [612 792] /ImagingBBox null >> setpagedevice" +*PageRegion Legal/Legal: "<< /PageSize [612 1008] /ImagingBBox null >> setpagedevice" +*PageRegion Executive/Executive: "<< /PageSize [522 756] /ImagingBBox null >> setpagedevice" +*PageRegion A4/A4: "<< /PageSize [595 842] /ImagingBBox null >> setpagedevice" +*PageRegion A4Long/A4 Long: "<< /PageSize [595 1147] /ImagingBBox null >> setpagedevice" +*PageRegion A5/A5: "<< /PageSize [420 595] /ImagingBBox null >> setpagedevice" +*PageRegion A6/A6: "<< /PageSize [297 420] /ImagingBBox null >> setpagedevice" +*PageRegion Env10/Com-10: "<< /PageSize [297 684] /ImagingBBox null >> setpagedevice" +*PageRegion EnvMonarch/Monarch: "<> setpagedevice" +*PageRegion EnvDL/DL: "<< /PageSize [312 624] /ImagingBBox null >> setpagedevice" +*PageRegion EnvDLRotated/DL Long Edge: "<< /PageSize [624 312] /ImagingBBox null >> setpagedevice" +*PageRegion EnvC5/C5: "<> setpagedevice" +*PageRegion EnvISOB5/B5 : "<< /PageSize [499 709] /ImagingBBox null >> setpagedevice" +*PageRegion EnvISOB6/B6 : "<< /PageSize [354 499] /ImagingBBox null >> setpagedevice" +*PageRegion B5/JIS B5: "<< /PageSize [515.0 727.0] /ImagingBBox null >> setpagedevice" +*PageRegion FanFoldGermanLegal/Folio: "<< /PageSize [612 936] /ImagingBBox null >> setpagedevice" +*PageRegion 2.75x3/Organizer J: "<< /PageSize [198 360] /ImagingBBox null >> setpagedevice" +*PageRegion Bible/Organizer K: "<< /PageSize [270 486] /ImagingBBox null >> setpagedevice" +*PageRegion Statement/Organizer L: "<< /PageSize [396 612] /ImagingBBox null >> setpagedevice" +*PageRegion OrgM/Organizer M: "<< /PageSize [611 792] /ImagingBBox null >> setpagedevice" +*PageRegion 3x5/3x5: "<< /PageSize [216 360] /ImagingBBox null >> setpagedevice" +*PageRegion Postcard/Postcard: "<< /PageSize [284 419] /ImagingBBox null >> setpagedevice" +*CloseUI: *PageRegion + +*DefaultImageableArea: A4 +*ImageableArea Letter/Letter: "12.0 12.12 599.88 780.0" +*ImageableArea Legal/Legal: "12.0 12.12 599.88 996.0" +*ImageableArea Executive/Executive: "11.99 12.12 510.0 744.0" +*ImageableArea A4/A4: "12.0 12.24 583.08 829.92" +*ImageableArea A4Long/A4 Long: "12.0 12.12 583.08 1134.96" +*ImageableArea A5/A5: "12.0 11.88 407.4 582.96" +*ImageableArea A6/A6: "12.0 12.6 285.48 408.0" +*ImageableArea Env10/Com-10: "12.0 12.12 284.88 672.0" +*ImageableArea EnvMonarch/Monarch: "12.0 12.12 266.76 528.0" +*ImageableArea EnvDL/DL: "12.0 12.24 299.88 612.0" +*ImageableArea EnvDLRotated/DL Long Edge: "12.0 12.12 611.76 300.0" +*ImageableArea EnvC5/C5: "12.0 12.24 446.76 636.96" +*ImageableArea EnvISOB5/B5 : "12.0 12.48 486.72 696.96" +*ImageableArea EnvISOB6/B6 : "12.0 12.24 342.12 486.96" +*ImageableArea B5/JIS B5: "12.0 12.48 502.92 714.96" +*ImageableArea FanFoldGermanLegal/Folio: "12.0 12.12 599.88 924.0" +*ImageableArea 2.75x3/Organizer J: "12.0 12.12 185.88 348.0" +*ImageableArea Bible/Organizer K: "12.0 12.12 257.88 474.0" +*ImageableArea Statement/Organizer L: "12.0 12.12 383.88 600.0" +*ImageableArea OrgM/Organizer M: "12.0 12.12 599.88 780.0" +*ImageableArea 3x5/3x5: "12.0 12.12 204.00 348.00" +*ImageableArea Postcard/Postcard: "12.12 12.0 270.1 406.92" + +*%==== Information About Media Sizes ======== + +*DefaultPaperDimension: A4 +*PaperDimension Letter/Letter: "612 792" +*PaperDimension Legal/Legal: "612 1008" +*PaperDimension Executive/Executive: "522 756" +*PaperDimension A4/A4: "595 842" +*PaperDimension A4Long/A4 Long: "595 1147" +*PaperDimension A5/A5: "420 595" +*PaperDimension A6/A6: "297 420" +*PaperDimension Env10/Com-10: "297 684" +*PaperDimension EnvMonarch/Monarch: "279 540" +*PaperDimension EnvDL/DL: "312 624" +*PaperDimension EnvDLRotated/DL Long Edge: "624 312" +*PaperDimension EnvC5/C5: "459 649" +*PaperDimension EnvISOB5/B5 : "499 709" +*PaperDimension EnvISOB6/B6 : "354 499" +*PaperDimension B5/JIS B5: "516 729" +*PaperDimension FanFoldGermanLegal/Folio: "612 936" +*PaperDimension 2.75x3/Organizer J: "198 360" +*PaperDimension Bible/Organizer K: "270 486" +*PaperDimension Statement/Organizer L: "396 612" +*PaperDimension OrgM/Organizer M: "612 792" +*PaperDimension 3x5/3x5: "216 360" +*PaperDimension Postcard/Postcard: "284 419" + +*%==== Custom Page Sizes ==================== +*NonUIOrderDependency: 40 AnySetup *CustomPageSize +*VariablePaperSize: True +*LeadingEdge Short: "" +*DefaultLeadingEdge: Short +*MaxMediaWidth: "612" +*MaxMediaHeight: "1152" +*HWMargins: 13 13 13 13 +*CustomPageSize True: " + <> setpagedevice + pop pop pop + << /PageSize [ 5 -2 roll ] /ImagingBBox null >> + setpagedevice +" +*End +*ParamCustomPageSize Width: 1 points 198 612 +*ParamCustomPageSize Height: 2 points 329 1152 +*ParamCustomPageSize WidthOffset: 3 points 0 0 +*ParamCustomPageSize HeightOffset: 4 points 0 0 +*ParamCustomPageSize Orientation: 5 int 0 3 + +*%==== 5.13 Media Handling Features ============================ +*OpenUI *BRMediaType/Media Type: PickOne +*OrderDependency: 28 AnySetup *BRMediaType +*DefaultBRMediaType:Plain +*BRMediaType Plain/Plain Paper: "<>setpagedevice" +*BRMediaType Recycled/Recycled Paper: "<>setpagedevice" +*BRMediaType Thin/Thin Paper: "<>setpagedevice" +*BRMediaType Thick/Thick Paper: "<>setpagedevice" +*BRMediaType ThickPaper2/Thicker Paper: "<>setpagedevice" +*BRMediaType BOND/Bond Paper: "<>setpagedevice" +*BRMediaType Env/Envelopes: "<>setpagedevice" +*BRMediaType EnvThick/Env. Thick: "<>setpagedevice" +*BRMediaType EnvThin/Env. Thin: "<>setpagedevice" +*BRMediaType Label/Label: "<>setpagedevice" +*BRMediaType PostCard/Postcard: "<>setpagedevice" +*CloseUI: *BRMediaType + +*OpenUI *InputSlot: PickOne +*OrderDependency: 29 AnySetup *InputSlot +*DefaultInputSlot: AutoSelect +*InputSlot AutoSelect/Auto Select: "<> setpagedevice" +*InputSlot Tray1/Tray1: "<> setpagedevice" +*InputSlot Tray2/Tray2: "<> setpagedevice" +*InputSlot MPTray/MP Tray: "<> setpagedevice" +*CloseUI: *InputSlot + +*RequiresPageRegion All:True + +*OpenUI *ManualFeed: Boolean +*OrderDependency: 19 AnySetup *ManualFeed +*DefaultManualFeed: False +*ManualFeed True: "<> setpagedevice" +*ManualFeed False: "<> setpagedevice" +*CloseUI: *ManualFeed + +*%=== Duplex ================================ +*OpenUI *Duplex: PickOne +*OrderDependency: 25 AnySetup *Duplex +*DefaultDuplex: None +*Duplex DuplexTumble: "<>setpagedevice" +*Duplex DuplexNoTumble: "<>setpagedevice" +*Duplex None: "<>setpagedevice" +*CloseUI: *Duplex + +*%=== Output Bin ============================= + +*% === Collate ========== +*%=== JobHold ================================ + +*OpenUI *BRJobHold/Job Spooling: PickOne +*OrderDependency: 21 AnySetup *BRJobHold +*DefaultBRJobHold: None +*BRJobHold None/Off: "<>setpagedevice" +*BRJobHold Private/Secure Print: "<>setpagedevice" +*CloseUI: *BRJobHold + +*OpenUI *BRJobPIN/Password: PickOne +*OrderDependency: 22 AnySetup *BRJobPIN +*DefaultBRJobPIN: HoldKey0 +*BRJobPIN HoldKey0/None: "<> setpagedevice" +*BRJobPIN HoldKey1/1002: "<> setpagedevice" +*BRJobPIN HoldKey2/2833: "<> setpagedevice" +*BRJobPIN HoldKey3/3410: "<> setpagedevice" +*BRJobPIN HoldKey4/4791: "<> setpagedevice" +*BRJobPIN HoldKey5/0052: "<> setpagedevice" +*BRJobPIN HoldKey6/9612: "<> setpagedevice" +*BRJobPIN HoldKey7/0438: "<> setpagedevice" +*BRJobPIN HoldKey8/7328: "<> setpagedevice" +*BRJobPIN HoldKey9/0006: "<> setpagedevice" +*CloseUI: *BRJobPIN + +*OpenUI *BRUser/User Name: PickOne +*OrderDependency: 91 AnySetup *BRUser +*DefaultBRUser: UserSystem +*BRUser UserSystem/System Name: " +" +*End +*CloseUI: *BRUser + +*OpenUI *BRJobName/Job Name: PickOne +*OrderDependency: 92 AnySetup *BRJobName +*DefaultBRJobName: JobNameSystem +*BRJobName JobNameSystem/System Name: "" +*BRJobName JobName1/1: "%%BRTitle: 1 +" +*End +*BRJobName JobName2/2: "%%BRTitle: 2 +" +*End +*BRJobName JobName3/3: "%%BRTitle: 3 +" +*End +*BRJobName JobName4/4: "%%BRTitle: 4 +" +*End +*BRJobName JobName5/5: "%%BRTitle: 5 +" +*End +*BRJobName JobName6/6: "%%BRTitle: 6 +" +*End +*BRJobName JobName7/7: "%%BRTitle: 7 +" +*End +*BRJobName JobName8/8: "%%BRTitle: 8 +" +*End +*BRJobName JobName9/9: "%%BRTitle: 9 +" +*End +*CloseUI: *BRJobName + +*%==== 5.14 Finishing Features ================================= +*%%%%% Resolution and Appearance Control %%%%% +*DefaultResolution: 600dpi + +*OpenUI *CAPT/Print Quality:PickOne +*OrderDependency: 10 AnySetup *CAPT +*DefaultCAPT: Fine +*CAPT Fine/Normal (600 x 600 dpi): "<> setpagedevice" +*CAPT SuperFine/Fine (2400 dpi class): "<> setpagedevice" +*?CAPT: " + currentpagedevice /BRApt get 2 eq + {(SuperFine)} + { + currentpagedevice/HWResolution get 0 get 600 eq{(Fine)}{(Draft)}ifelse + }ifelse = flush +" +*End +*CloseUI: *CAPT + +*OpenUI *TonerSaveMode/Toner Save: PickOne +*DefaultTonerSaveMode: Off +*OrderDependency: 10 AnySetup *TonerSaveMode +*TonerSaveMode Off/Off: " + statusdict/tonersave known{statusdict begin false tonersave end}if +" +*End +*TonerSaveMode On/On: " + statusdict/tonersave known{statusdict begin true tonersave end}if +" +*End +*CloseUI: *TonerSaveMode + +*OpenUI *Sleep/Sleep Time [Min.]: PickOne +*DefaultSleep: PrinterDefault +*OrderDependency: 10 AnySetup *Sleep +*Sleep PrinterDefault/Printer Default: "" +*Sleep 2minutes/2: "statusdict/powersavetime known{statusdict begin 2 powersavetime end}if" +*Sleep 10minutes/10: "statusdict/powersavetime known{statusdict begin 10 powersavetime end}if" +*Sleep 30minutes/30: "statusdict/powersavetime known{statusdict begin 30 powersavetime end}if" +*CloseUI: *Sleep + +*%==== BR-Script Color Original UI ================================== + +*OpenUI *BRPrintQuality/Color/Mono: PickOne +*OrderDependency: 15 AnySetup *BRPrintQuality +*DefaultBRPrintQuality: Auto +*BRPrintQuality Auto/Auto: " + <>setpagedevice + <>setpagedevice + <>setpagedevice" +*BRPrintQuality Color/Color: " + <>setpagedevice + <>setpagedevice + <>setpagedevice" +*BRPrintQuality Black/Mono: " + <>setpagedevice + <>setpagedevice + <>setpagedevice" +*?BRPrintQuality: " + save + currentpagedevice /BRProcessColor get 1 eq + {(Black)}{(Color)}ifelse + = flush + restore +" +*End +*CloseUI: *BRPrintQuality + +*% RGB Gamma Correction Information =============== +*OpenUI *BRGammaValue/Gamma Correction: PickOne +*OrderDependency: 130.0 AnySetup *BRGammaValue +*DefaultBRGammaValue: G22 +*BRGammaValue G18/1.8: " + <>setpagedevice + <>setpagedevice +" +*End +*BRGammaValue G22/2.2: " + <>setpagedevice + <>setpagedevice +" +*End +*BRGammaValue Off/Off: " + <>setpagedevice +" +*End +*CloseUI: *BRGammaValue + +*% Color Mode Information =============== +*OpenUI *BRColorMode/Color Mode: Boolean +*OrderDependency: 131.0 AnySetup *BRColorMode +*DefaultBRColorMode: False +*BRColorMode True/Vivid: " + <>setpagedevice +" +*End +*BRColorMode False/Normal: " + <>setpagedevice +" +*End +*CloseUI: *BRColorMode + +*% Improve Gray Color Information =============== +*OpenUI *BRImprovedGray/Improve Gray Color: Boolean +*OrderDependency: 132.0 AnySetup *BRImprovedGray +*DefaultBRImprovedGray: False +*BRImprovedGray True/On: " + <>setpagedevice +" +*End +*BRImprovedGray False/Off: " + <>setpagedevice +" +*End +*CloseUI: *BRImprovedGray + +*% UCRGCR Information =============== +*OpenUI *UCRGCRForImage/Enhance Black Printing: Boolean +*OrderDependency: 133 AnySetup *ScreenLock +*DefaultUCRGCRForImage: False +*UCRGCRForImage True/On: " + statusdict begin true ucrgcrforimage end +" +*End +*UCRGCRForImage False/Off: " + statusdict begin false ucrgcrforimage end +" +*End +*CloseUI: *UCRGCRForImage + +*% Halftone Screen Lock Information =============== +*OpenUI *ScreenLock/Halftone Screen Lock: Boolean +*OrderDependency: 90 AnySetup *ScreenLock +*DefaultScreenLock: True +*ScreenLock True/On: " + <>setuserparams +" +*End +*ScreenLock False/Off: " + <>setuserparams +" +*End +*CloseUI: *ScreenLock + +*% Reduced Image =============== +*OpenUI *BRReducedImage/High Quality Image Printing: Boolean +*OrderDependency: 131.0 AnySetup *BRReducedImage +*DefaultBRReducedImage: False +*BRReducedImage True/On: " + <>setpagedevice +" +*End +*BRReducedImage False/Off: " + <>setpagedevice +" +*End +*CloseUI: *BRReducedImage + +*OpenUI *BRLanguageLevel/BR-Script Level: PickOne +*OrderDependency: 15 AnySetup *BRLanguageLevel +*DefaultBRLanguageLevel: L3 +*BRLanguageLevel L1/1: "userdict begin /languagelevel 1 def end" +*BRLanguageLevel L2/2: "userdict begin /languagelevel 2 def end" +*BRLanguageLevel L3/3: "" +*CloseUI: *BRLanguageLevel + +*%==== 5.17 Gray Levels and Halftoninig ======================== +*AccurateScreenSupport: False +*ScreenFreq: "60.0" +*ScreenAngle: "0.0" +*DefaultScreenProc: Dot +*ScreenProc Dot: "{1.0 add 180 mul 1 add sin 0.001 add exch 1.0 add 180 mul 2 add sin mul}" + +*DefaultTransfer: Null +*Transfer Null: "{}" +*Transfer Null.Inverse: "{1 exch sub}" + +*%==== 5.18 Color Issues ======================================= +*% BlackSubstitution -> Original UI + +*%==== 5.19 Color Separation Keywords ========================== +*DefaultColorSep: ProcessBlack +*ColorSepScreenFreq ProcessBlack.71lpi.600dpi/71 lpi / 600 dpi: "70.7107" +*ColorSepScreenFreq CustomColor.71lpi.600dpi/71 lpi / 600 dpi: "70.7107" +*ColorSepScreenFreq ProcessCyan.71lpi.600dpi/71 lpi / 600 dpi: "63.2456" +*ColorSepScreenFreq ProcessMagenta.71lpi.600dpi/71 lpi / 600 dpi: "63.2456" +*ColorSepScreenFreq ProcessYellow.71lpi.600dpi/71 lpi / 600 dpi: "66.6667" +*ColorSepScreenFreq ProcessBlack.60lpi.300dpi/60 lpi / 300 dpi: "60" +*ColorSepScreenFreq CustomColor.60lpi.300dpi/60 lpi / 300 dpi: "60" +*ColorSepScreenFreq ProcessCyan.60lpi.300dpi/60 lpi / 300 dpi: "60" +*ColorSepScreenFreq ProcessMagenta.60lpi.300dpi/60 lpi / 300 dpi: "60" +*ColorSepScreenFreq ProcessYellow.60lpi.300dpi/60 lpi / 300 dpi: "60" +*ColorSepScreenFreq ProcessBlack.53lpi.300dpi/53 lpi / 300 dpi: "53.033" +*ColorSepScreenFreq CustomColor.53lpi.300dpi/53 lpi / 300 dpi: "53.033" +*ColorSepScreenFreq ProcessCyan.53lpi.300dpi/53 lpi / 300 dpi: "47.4342" +*ColorSepScreenFreq ProcessMagenta.53lpi.300dpi/53 lpi / 300 dpi:"47.4342" +*ColorSepScreenFreq ProcessYellow.53lpi.300dpi/53 lpi / 300 dpi: "50.0" +*ColorSepScreenAngle ProcessBlack.71lpi.600dpi/71 lpi / 600 dpi: "45.0" +*ColorSepScreenAngle CustomColor.71lpi.600dpi/71 lpi / 600 dpi: "45.0" +*ColorSepScreenAngle ProcessCyan.71lpi.600dpi/71 lpi / 600 dpi: "71.5651" +*ColorSepScreenAngle ProcessMagenta.71lpi.600dpi/71 lpi / 600 dpi: "18.4349" +*ColorSepScreenAngle ProcessYellow.71lpi.600dpi/71 lpi / 600 dpi: "0.0" +*ColorSepScreenAngle ProcessBlack.60lpi.300dpi/60 lpi / 300 dpi: "45" +*ColorSepScreenAngle CustomColor.60lpi.300dpi/60 lpi / 300 dpi: "45" +*ColorSepScreenAngle ProcessCyan.60lpi.300dpi/60 lpi / 300 dpi: "15" +*ColorSepScreenAngle ProcessMagenta.60lpi.300dpi/60 lpi / 300 dpi: "75" +*ColorSepScreenAngle ProcessYellow.60lpi.300dpi/60 lpi / 300 dpi: "0" +*ColorSepScreenAngle ProcessBlack.53lpi.300dpi/53 lpi / 300 dpi: "45.0" +*ColorSepScreenAngle CustomColor.53lpi.300dpi/53 lpi / 300 dpi: "45.0" +*ColorSepScreenAngle ProcessCyan.53lpi.300dpi/53 lpi / 300 dpi: "71.5651" +*ColorSepScreenAngle ProcessMagenta.53lpi.300dpi/53 lpi / 300 dpi: "18.4349" +*ColorSepScreenAngle ProcessYellow.53lpi.300dpi/53 lpi / 300 dpi: "0.0" +*End + +*InkName: ProcessBlack/Process Black +*InkName: CustomColor/Custom Color +*InkName: ProcessCyan/Process Cyan +*InkName: ProcessMagenta/Process Magenta +*InkName: ProcessYellow/Process Yellow + +*%==== 5.20 Font Related Keywords ============================== +*DefaultFont: Courier +*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM +*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM +*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM +*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM +*Font Bookman-Demi: Standard "(001.004S)" Standard ROM +*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM +*Font Bookman-Light: Standard "(001.004S)" Standard ROM +*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM +*Font Courier: Standard "(002.004S)" Standard ROM +*Font Courier-Bold: Standard "(002.004S)" Standard ROM +*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM +*Font Courier-Oblique: Standard "(002.004S)" Standard ROM +*Font Helvetica: Standard "(001.006S)" Standard ROM +*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM +*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM +*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM +*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM +*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM +*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM +*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM +*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM +*Font Palatino-Bold: Standard "(001.005S)" Standard ROM +*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM +*Font Palatino-Italic: Standard "(001.005S)" Standard ROM +*Font Palatino-Roman: Standard "(001.005S)" Standard ROM +*Font Times-Bold: Standard "(001.007S)" Standard ROM +*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM +*Font Times-Italic: Standard "(001.007S)" Standard ROM +*Font Times-Roman: Standard "(001.007S)" Standard ROM +*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM +*Font ZapfDingbats: Special "(001.004S)" Special ROM +*Font Symbol: Special "(001.007S)" Special ROM +*Font Alaska: Standard "(001.005)" Standard ROM +*Font AlaskaExtrabold: Standard "(001.005)" Standard ROM +*Font AntiqueOakland: Standard "(001.005)" Standard ROM +*Font AntiqueOakland-Bold: Standard "(001.005)" Standard ROM +*Font AntiqueOakland-Oblique: Standard "(001.005)" Standard ROM +*Font ClevelandCondensed: Standard "(001.005)" Standard ROM +*Font Connecticut: Standard "(001.005)" Standard ROM +*Font Guatemala-Antique: Standard "(001.005)" Standard ROM +*Font Guatemala-Bold: Standard "(001.005)" Standard ROM +*Font Guatemala-Italic: Standard "(001.005)" Standard ROM +*Font Guatemala-BoldItalic: Standard "(001.005)" Standard ROM +*Font LetterGothic: Standard "(001.005)" Standard ROM +*Font LetterGothic-Bold: Standard "(001.005)" Standard ROM +*Font LetterGothic-Oblique: Standard "(001.005)" Standard ROM +*Font Maryland: Standard "(001.005)" Standard ROM +*Font Oklahoma: Standard "(001.005)" Standard ROM +*Font Oklahoma-Bold: Standard "(001.005)" Standard ROM +*Font Oklahoma-Oblique: Standard "(001.005)" Standard ROM +*Font Oklahoma-BoldOblique: Standard "(001.005)" Standard ROM +*Font Utah: Standard "(001.005)" Standard ROM +*Font Utah-Bold: Standard "(001.005)" Standard ROM +*Font Utah-Oblique: Standard "(001.005)" Standard ROM +*Font Utah-BoldOblique: Standard "(001.005)" Standard ROM +*Font UtahCondensed: Standard "(001.005)" Standard ROM +*Font UtahCondensed-Bold: Standard "(001.005)" Standard ROM +*Font UtahCondensed-Oblique: Standard "(001.004)" Standard ROM +*Font UtahCondensed-BoldOblique: Standard "(001.005)" Standard ROM +*Font BermudaScript: Standard "(001.005)" Standard ROM +*Font Germany: Standard "(001.005)" Standard ROM +*Font SanDiego: Standard "(001.005)" Standard ROM +*Font US-Roman: Standard "(001.005)" Standard ROM +*?FontQuery: " +save +count 1 gt + {exch dup dup + =string cvs (/) print print (:) print + FontDirectory exch known + {pop(Yes)} + {(fonts/)AppendName exch pop mark exch + {}=string filenameforall counttomark + 0 gt + {cleartomark(Yes)} + {cleartomark(No)}ifelse + }ifelse + = + }if + (*) = flush +restore +" +*End +*?FontList: " +save + FontDirectory{pop ==}forall + (fonts/*) + {dup length 6 sub 6 exch getinterval cvn == + }=string filenameforall + (*) = flush +restore +" +*End + + +*%==== 5.21 Printer Messages =================================== +*% +*% Printer Message +*% +*PrinterError: "service call" +*PrinterError: "cover open" +*PrinterError: "end of ink" +*PrinterError: "out of maintenance paper" +*PrinterError: "out of paper" +*PrinterError: "paper jam" +*PrinterError: "manual feed time out" +*PrinterError: "load paper letter size" +*PrinterError: "load paper legal size" +*PrinterError: "load paper B5 size" +*PrinterError: "load paper A4 size" +*PrinterError: "offline" + +*Status: "idle" +*Status: "busy" +*Status: "waiting" +*Status: "printing" +*Status: "warming up" +*Status: "PrinterError: service call" +*Status: "PrinterError: cover open" +*Status: "PrinterError: end of ink" +*Status: "PrinterError: out of paper" +*Status: "PrinterError: paper jam" +*Status: "PrinterError: manual feed time out" +*Status: "PrinterError: load paper letter size" +*Status: "PrinterError: load paper legal size" +*Status: "PrinterError: load paper B5 size" +*Status: "PrinterError: load paper A4 size" +*Status: "PrinterError: offline" + +*% Input Sources (format: %%[ status: ; source: ]%% ) +*Source: "Serial" +*Source: "Parallel" +*Source: "EtherTalk" +*Source: "LPR" +*Source: "PrintServer" +*Source: "Internal" + +*Message: "%%[ exitserver: permanent state may be changed ]%%" +*Message: "%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%" +*Message: "\FontName\ not found, using BR-03B." +*%==== 5.22 System Management ================================== +*Password: "0" +*ExitServer: " + serverdict begin 0 exitserver +" +*End +*Reset: " + clear cleardictstack + serverdict begin 0 exitserver + systemdict /quit get exec + " +*End + diff --git a/modules/workspace/print-scan/default.nix b/modules/workspace/print-scan/default.nix new file mode 100644 index 0000000..820ac0f --- /dev/null +++ b/modules/workspace/print-scan/default.nix @@ -0,0 +1,30 @@ +{ pkgs, config, ... }: +let + brother_printer = pkgs.linkFarm "Brother_HL-3170CDW_series" [{ + name = "share/cups/model/hl3170cdw.ppd"; + path = ./Brother_HL-3170CDW_series.ppd; + }]; +in { + services.printing = { + enable = true; + drivers = [ + brother_printer + ]; + }; + + hardware.printers = { + ensureDefaultPrinter = "Brother_HL-3170CDW_series"; + ensurePrinters = [{ + name = "Brother_HL-3170CDW_series"; + deviceUri = "usb://Brother/HL-3170CDW%20series?serial=E71798K6J706416"; + model = "hl3170cdw.ppd"; + }]; + }; + + programs.system-config-printer.enable = true; + + hardware.sane.enable = true; + services.saned.enable = true; + + environment.systemPackages = [ pkgs.gnome3.simple-scan ]; +}