code
stringlengths
0
56.1M
repo_name
stringlengths
3
57
path
stringlengths
2
176
language
stringclasses
672 values
license
stringclasses
8 values
size
int64
0
56.8M
# Environment setup ## RimWorld dependencies The `.csproj` file has been configured to automatically detect standard Windows, Linux, and macOS Steam install locations, and should link dependencies regardless of the project's location on your hard drive. If that works for you, you don't need to read any farther. These are the paths RimJobWorld will look for the RimWorld dlls: - `../_RimWorldData/Managed/` (Custom) - `C:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\` (Windows) - `$(HOME)/.steam/steam/SteamApps/common/RimWorld/RimWorldLinux_Data/Managed/` (Linux) - `$(HOME)/Library/Application Support/Steam/steamapps/common/RimWorld/RimWorldMac.app/Contents/Resources/Data/Managed/` (macOS) ### Custom project location If you choose to place the RimJobWorld project somewhere other than your RimWorld mods directory, you'll need to create a symlink in the RimWorld mods directory that points to the RimJobWorld project. Here are some examples of creating symlinks on different platforms: - Linux and macOS: Open the terminal and run this command (filling in the actual paths): `ln -s "~/where/you/put/rjw" "/your/RimWorld/Mods/rjw"` - Windows: Run the Command Prompt as administrator, then run this command: `mklink /D "C:\Your\Rimworld\Mods\rjw" "C:\Where\you\put\rjw"` ### Custom RimWorld install If you're using a custom RimWorld install, you'll want to create a symlink called `_RimWorldData` next to the `rjw` folder that points `RimWorldWin64_Data`, `RimWorldLinux_Data`, or `RimWorldMac.app/Contents/Resources/Data`, as appropriate. Refer to the previous section for how to create a symlink on your platform. In the end your file structure should look like this: - `where/you/put/` - `rjw/` - `RimJobWorld.Main.csproj` - ... - `_RimWorldData/` *(symlink)* - `Managed/` - `Assembly-CSharp.dll` - ... ## Deployment Notice Deployment scripts now make use of PowerShell 7+, instead of Windows PowerShell 5.1, allowing for cross platform execution. Please see [this document](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.2) if you don't have the new PowerShell on your device.
Korth95/rjw
CONTRIBUTING.md
Markdown
mit
2,231
@ECHO OFF SET ThisScriptsDirectory=%~dp0 SET PSSctiptName=Deploy OLD.ps1 SET PowerShellScriptPath=%ThisScriptsDirectory%%PSSctiptName% PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%PowerShellScriptPath%'";
Korth95/rjw
Deploy/Deploy OLD.bat
Batchfile
mit
219
# Configurable variables $repo = '..' $packing = 'rjw_packing' $outputFormat = '..\..\RJW-{0}.7z' $internalPath = 'RJW' $pathsToRemove = '.git', '.gitattributes', '.gitattributes', '.gitignore', '1.1\Source', '1.2\Source', '1.3\Source', '1.4\Source', '1.5\Source', 'Deploy' [Console]::ResetColor() # Progress Bar Variables $Activity = "Deploying" $Id = 1 # Complex Progress Bar $Step = 0 $TotalSteps = 6 $StatusText = '"Step $($Step.ToString().PadLeft($TotalSteps.ToString().Length)) of $TotalSteps | $Task"' # Single quotes need to be on the outside $StatusBlock = [ScriptBlock]::Create($StatusText) # This script block allows the string above to use the current values of embedded values each time it's run # Read environvemt $Task = "Collecting info..." $Step++ ##Write-Progress -Id $Id -Activity $Activity -Status (& $StatusBlock) -CurrentOperation " " -PercentComplete ($Step / $TotalSteps * 100) $startupPath = Get-Location $7z = (GET-ItemProperty 'HKLM:\SOFTWARE\7-Zip').Path + '7z.exe' $packingRjw = $packing + "\" + $internalPath Push-Location -Path $repo try { [string]$version = git describe --tags } catch { [string]$version = "" } if ($version -eq "") { $manifest = "./About/Manifest.xml" [string]$version = (Select-Xml -Path $manifest -XPath '/Manifest/version' | Select-Object -ExpandProperty Node).innerText } $output = $outputFormat -f $version Pop-Location # Cleanup $Task = "Cleanup..." $Step++ Write-Progress -Id $Id -Activity $Activity -Status (& $StatusBlock) -CurrentOperation " " -PercentComplete ($Step / $TotalSteps * 100) if (Test-Path $packing) { Remove-Item -Recurse -Force $packing } if (Test-Path $output) { Remove-Item $output } # Prepating data $Task = "Copying..." $Step++ Write-Progress -Id $Id -Activity $Activity -Status (& $StatusBlock) -CurrentOperation " " -PercentComplete ($Step / $TotalSteps * 100) $items = Get-ChildItem -Force -Path $repo $items | Foreach-Object -Begin { $i = 0 } -Process { $i++ if (-Not ($pathsToRemove -contains $_.Name)) { Copy-Item -Recurse $_.FullName -Destination ($packingRjw + "\" + $_.Name) } $p = $i * 100 / $items.Count Write-Progress -Id ($Id+1) -ParentId $Id -Activity 'Copying' -Status ('{0:0}% complete' -f $p) -PercentComplete $p } Write-Progress -Id ($Id+1) -ParentId $Id -Activity "Copying" -Status "Ready" -Completed # removing files from subfolders $Task = "Excluding..." $Step++ Write-Progress -Id $Id -Activity $Activity -Status (& $StatusBlock) -CurrentOperation " " -PercentComplete ($Step / $TotalSteps * 100) foreach ($path in $pathsToRemove) { $p = $packingRjw + '\' + $path if (Test-Path $p) { Remove-Item -Recurse -Force $p } } # archiving $Task = "Archiving..." $Step++ Write-Progress -Id $Id -Activity $Activity -Status (& $StatusBlock) -CurrentOperation " " -PercentComplete ($Step / $TotalSteps * 100) Push-Location -Path $packing & $7z a -r -bsp1 ($startupPath.Path+'\'+$output) + $internalPath | Foreach-Object -Begin { Write-Progress -Id ($Id+1) -ParentId $Id -Activity 'Archiving' -Status "Starting..." -PercentComplete 0 } -Process { $line = $_.Trim() if ($line -ne "") { [int]$p = 0 [bool]$result = [int]::TryParse($line.Split('%')[0], [ref]$p) if ($result) { Write-Progress -Id ($Id+1) -ParentId $Id -Activity 'Archiving' -Status $line -PercentComplete $p } } } Write-Progress -Id ($Id+1) -Activity "Archiving" -Status "Ready" -Completed Pop-Location # cleanup $Task = "Cleanup..." $Step++ Write-Progress -Id $Id -Activity $Activity -Status (& $StatusBlock) -CurrentOperation " " -PercentComplete ($Step / $TotalSteps * 100) if (Test-Path $packing) { Remove-Item -Recurse -Force $packing } Write-Progress -Id $Id -Activity $Activity -Status (& $StatusBlock) -Completed # If running in the console, wait for input before closing. if ($Host.Name -eq "ConsoleHost") { Write-Host "Done" Write-Host "Press any key to continue..." $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp") > $null }
Korth95/rjw
Deploy/Deploy OLD.ps1
PowerShell
mit
4,054
@ECHO OFF SET scriptDir=%~dp0 SET psScript=Deploy.ps1 SET pwshScriptPath=%scriptDir%%psScript% pwsh -NoProfile -ExecutionPolicy Bypass -Command "& '%pwshScriptPath%'";
Korth95/rjw
Deploy/Deploy.bat
Batchfile
mit
169
# Configurable variables $repo = '..' $packing = 'rjw_packing' $outputFormat = Join-Path -Path '..\..' -ChildPath 'RJW-{0}.7z' $internalPath = 'RJW' $pathsToRemove = '.git', '.gitattributes', '.gitignore', (Join-Path -Path '1.1' -ChildPath 'Source'), (Join-Path -Path '1.2' -ChildPath 'Source'), (Join-Path -Path '1.3' -ChildPath 'Source'), 'Deploy' [Console]::ResetColor() # Progress Bar Variables $Activity = "Deploying" $Id = 1 # Complex Progress Bar $Step = 0 $TotalSteps = 6 $StatusText = '"Step $($Step.ToString().PadLeft($TotalSteps.ToString().Length)) of $TotalSteps | $Task"' # Single quotes need to be on the outside $StatusBlock = [ScriptBlock]::Create($StatusText) # This script block allows the string above to use the current values of embedded values each time it's run # Read environvemt $Task = "Collecting info..." $Step++ ##Write-Progress -Id $Id -Activity $Activity -Status (& $StatusBlock) -CurrentOperation " " -PercentComplete ($Step / $TotalSteps * 100) $startupPath = Get-Location if ($IsWindows) { $7z = (GET-ItemProperty 'HKLM:\SOFTWARE\7-Zip').Path + '7z.exe' } else { $7z = &which 7z } $packingRjw = Join-Path -Path $packing -ChildPath $internalPath Push-Location -Path $repo try { [string]$version = git describe --tags } catch { [string]$version = "" } if ($version -eq "") { $manifest = Join-Path -Path '.\About' -ChildPath 'Manifest.xml' [string]$version = (Select-Xml -Path $manifest -XPath '/Manifest/version' | Select-Object -ExpandProperty Node).innerText } $output = $outputFormat -f $version Pop-Location # Cleanup $Task = "Cleanup..." $Step++ Write-Progress -Id $Id -Activity $Activity -Status (& $StatusBlock) -CurrentOperation " " -PercentComplete ($Step / $TotalSteps * 100) if (Test-Path $packing) { Remove-Item -Recurse -Force $packing } if (Test-Path $output) { Remove-Item $output } # Prepating data $Task = "Copying..." $Step++ Write-Progress -Id $Id -Activity $Activity -Status (& $StatusBlock) -CurrentOperation " " -PercentComplete ($Step / $TotalSteps * 100) $items = Get-ChildItem -Force -Path $repo $items | Foreach-Object -Begin { $i = 0 } -Process { $i++ if (-Not ($pathsToRemove -contains $_.Name)) { Copy-Item -Recurse $_.FullName -Destination (Join-Path -Path $packingRjw -ChildPath $_.Name) } $p = $i * 100 / $items.Count Write-Progress -Id ($Id+1) -ParentId $Id -Activity 'Copying' -Status ('{0:0}% complete' -f $p) -PercentComplete $p } Write-Progress -Id ($Id+1) -ParentId $Id -Activity "Copying" -Status "Ready" -Completed # removing files from subfolders $Task = "Excluding..." $Step++ Write-Progress -Id $Id -Activity $Activity -Status (& $StatusBlock) -CurrentOperation " " -PercentComplete ($Step / $TotalSteps * 100) foreach ($path in $pathsToRemove) { $p = Join-Path -Path $packingRjw -ChildPath $path if (Test-Path $p) { Remove-Item -Recurse -Force $p } } # archiving $Task = "Archiving..." $Step++ Write-Progress -Id $Id -Activity $Activity -Status (& $StatusBlock) -CurrentOperation " " -PercentComplete ($Step / $TotalSteps * 100) Push-Location -Path $packing & $7z a -r -bsp1 (Join-Path -Path $startupPath.Path -ChildPath $output) + $internalPath | Foreach-Object -Begin { Write-Progress -Id ($Id+1) -ParentId $Id -Activity 'Archiving' -Status "Starting..." -PercentComplete 0 } -Process { $line = $_.Trim() if ($line -ne "") { [int]$p = 0 [bool]$result = [int]::TryParse($line.Split('%')[0], [ref]$p) if ($result) { Write-Progress -Id ($Id+1) -ParentId $Id -Activity 'Archiving' -Status $line -PercentComplete $p } } } Write-Progress -Id ($Id+1) -Activity "Archiving" -Status "Ready" -Completed Pop-Location # cleanup $Task = "Cleanup..." $Step++ Write-Progress -Id $Id -Activity $Activity -Status (& $StatusBlock) -CurrentOperation " " -PercentComplete ($Step / $TotalSteps * 100) if (Test-Path $packing) { Remove-Item -Recurse -Force $packing } Write-Progress -Id $Id -Activity $Activity -Status (& $StatusBlock) -Completed # If running in the console, wait for input before closing. if ($Host.Name -eq "ConsoleHost") { Write-Host "Done" Write-Host "Press any key to continue..." $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp") > $null }
Korth95/rjw
Deploy/Deploy.ps1
PowerShell
mit
4,287
#!/usr/bin/env bash set -e scriptDir=$(pwd) scriptName="Deploy.ps1" scriptPath=$scriptDir/$scriptName echo "Reminder: p7zip and PowerShell Core are required." pwsh -NoProfile -ExecutionPolicy Bypass -Command "& '$scriptPath'"
Korth95/rjw
Deploy/Deploy.sh
Shell
mit
227
Multiplayer: https://github.com/Parexy/Multiplayer ===================================================== not working: -whoring desync: -? =====================================================
Korth95/rjw
Multiplayer.txt
Text
mit
193
OwO what's this? RimjobWorld is a sex mod that overhauls Rimworld loving, mating and pregnancy mechanics. Mod supports various sex/hentai fetishes. Mod is highly configurable and most feature turned off by default, so you can go from vanilla experience to your wild fantasies. Many additional features(submods) can be found on LL forum and discord. You can support current Dev(Me) here: [SubscribeStar](https://subscribestar.adult/Ed86) [Ko-fi](https://ko-fi.com/caffeinated_ed) for crypto bros: USDT(TRC20):TAS9QbvuF6AquJ98TqG653bPDugC2a6mnk USDT(ERC20):0x6c61085700f4ad941df80234fbfb8a861b14b0de [Mod git]{https://gitgud.io/Ed86/rjw} Feedback: [Discord]{https://discord.gg/CXwHhv8} [LoversLab Forum]{https://www.loverslab.com/files/file/7257-rimjobworld/} Requirements: Hugslib ([Steam](https://steamcommunity.com/sharedfiles/filedetails/?id=818773962)) ([GitHub](https://github.com/UnlimitedHugs/RimworldHugsLib)) Installation: (if updating - Delete all files from previous RJW versions) Unpack the the content from the downloaded archive into "...steam/steamapps/common/Rimworld/Mods/RJW" You will see this folder structure - Rimworld/Mods/RJW/About Start Game Activate mod & the other required mods Restart game Load Order: -Rimworld Core (that's the game) --Hugslib ---your mods --RimJobWorld ---addons for RimJobWorld Contributing: use TABS not SPACES for xml/cs, please? do comments in code for other people(me?) P.S. im not a pro C# programmer or git user, so i might do weird stuff ;)
Korth95/rjw
README.md
Markdown
mit
1,558
5.5.0.2 fix demon parts removal error leanavy: Rewrote RelationChecker to work with same-gender parents, using new method that check only DirectPawnRelation Wrote patch for PawnRelations_Humanlike to link relationWorkers Fixed missing second parent in Dialog_NamePawn ElToro: Allowed female bestiality for fenced animals bestiality changes to SexAppraiser allowed slaves in RMB menu Vegapnk: Default scaling by bodysize is on for genitalia display added a modder-only field BodySizeOverride that changes display It checks for sex-driver whether the pawn died, got downed or had genitals changed or removed. null-checks for "Reduce_Rest_Need" 5.5.0.1 amevarashi: -Fixes for the RMB_Menu rework -Fixed nullref in RMB_Mechanitor.GenerateCategoryOption when the target is not a pawn -Removed hidden pawns from RMB_Menu targets -Removed unspawned pawns from RMB_Menu targets -In rjw dev mode show the reason if pawn removed from interaction targets 5.5.0 removed PC incompability tag, apperantly now it only breaks hediffs like other editors edited tips so, extrimists get (unlikely) slightly less offended because incomatibility with lost forest, also we are not sad KarubonWaito: Simplified Chinese amevarashi: Remove CnP and BnC compatibility RMB menu refactor - should give you reasons why there no sex interactions Sombrahide: Vanilla Psycasts Expanded - Puppeter Patch a flock of birds: Sex Part Rework -Major refactor of sex parts. Breaks saves and submods, but should be less bug-prone. -Removed flank bodypart. Udders are now just another kind of breast. -Added a simple sexual fluid system - parts can now define their own fluids, filth and effects on consumption. -Pawns can now consume insect jelly straight from the tap. -Cleaned up part stats screen. -Size description of harvested parts is now relative to baseline human size. -Added info about harvested parts to inspect. -Fixed egg production in artificial ovipositors (none currently exist but if they did they'd be fixed). -Fixed succubi failing to drain energy if they or their partner lacked a food need. -Removed some unused, nameless hediffs that were clogging up the dev mode menu and couldn't be filtered out 5.4.1 typo fixes fix labels and descriptions for anal bread/rape thoughts add dev msg for pregnancy/egg abortion for immortals improved age detection with life stages (ve androids) amevarashi: Assembly versioning Tory: Anamoly update Hikaro: Ukrainian translation 5.4.0 added modicon changed/moved egg size calculation code from genitals/impantation to Hediff_InsectEgg.ChangeEgg fix Egg size slider not working for egg generation translation strings for insect eggs hediff jikulopo & co: support for 1.5 5.3.9 fix (for now/ for ever?) receiver usedCondom not being set for receiver jobdriver, thus impregnating initiator improved rmb, hero now, again, skips most checks, direct control - not improve egg fertilization - DoublePenetration fertilizes both genitals and anus (not either) improve egg implanting Gargule: EggingFixes: -No more fertilizing ass through mouth -No more egging things that souldn't be egged -No more egging when it shouldn't happen 5.3.8 Ed86 Still being with you anon18392 Fix confusing log entries generated by fingering and handjob rapes FlirtyNymph Makes hero pawn check for opinion theshold when trying to have sex with RMB, without this it feels like cheating since target pawns will accept casual sex even if they are rivals which doesnt make sense. Makes RMB rape consider the would_fuck check because it feels a bit willy-nilly to be able to RMB rape everyone regardless of hero pawns preferences or game settings ghostclinic3YTB Allow nympho frustrated rape to be toggled Crow Notifications for animal pregnancies can now be disabled via option (in RJW-pregnancy settings) A-flock-of-birds Reverted quickie -> hookup report change Added target info to Quickie and JoinInBed Fixed capitalisation in rape jobs Added nympho check to xxx.is_prude Refactored poly checks to be more reusable Swapped IsSingleOrPartnersNotHere for HasNonPolyPartner(onCurrentMap: true) in the consensual sex WorkGiver Account for precepts when determining polyamory/prudishness 5.3.7.1 fix pregnancy error for races that block malnutrition hediff changed sexuality card to use modid instead of string fix oral bestiality rulepack typo ghostclinic3YTB Allow jobs to be marked for quickie interruption in xml file 5.3.7 added part property "FertilityToggle" for genitals added FertilityToggle prop for archotech genitals changed archotech fertility hediffs to not mention archotech changed archotech fertility toggle button to work for all genitals with "FertilityToggle" fix debug message in JobGiver_ComfortPrisonerRape 5.3.6.1 fix sex settings menu 5.3.6 Ed86: being with you Vegapnk: Relations for Insect-Egg Babies ghostclinic3YTB: separate orgam meter from job duration Hydrogen: Chinese 5.3.5.1 fix nre for empires/bionic body parts 5.3.5 increased size of pregnancy settings menu, should scale with options probably? moved GetSpecialApparelScoreOffset() from bondage gear to harmony patch, which can probably affect pawn desire to wear bondage by own will Tory: CE bulk patch Zsar: Added option to configure Ovipositor capacity Vegapnk: Added configurable gene-inheritance for egg pregnancies Changes: if both implanter and fertilizer are humans, egg gets genes stored according to vanilla logic On birth, kid gets genes Settings to put this behavior on/off (default on) General Cleanup and some refactoring Separating behavior in different methods, for easier patching and readability Valorantplayer993: Performance improvement on CompRJW - CompTick 5.3.4 fix futa reverse interactions to be 50/50, instead of 10/90 Taleir: csproj-refactoring Fixes a null reference exception in sex jobs on interruption fix pregnancy transpiler for latest Humanoid Alien Races Fix sex interruption on loading a save with sex in progress divineDerivative: Compatibility with Way Better Romance AntiJaoi: Ukraininan support 5.3.3.3 reverted d6da0ef9? fixed human/animal pregnancy error - needs some testing on you 5.3.3.2 added fix for pregnancy last name generation with non humans 5.3.3.1 fix toggles for x-slut traits not saving 5.3.3 reduced ChangeSex error to warning fixed human/animal pregnancy error added toggles for x-slut traits 5.3.2 replace AllowTeenSex with AllowYouthSex removed 2year difference requirement for youth sex nugerumon: Biotech: Check for fertile penis instead of male gender when compiling list of pawns that could fertilize ovum gterl: Genital_Helper: use tags to search for mouth, tongue and stomach Endismic: Fixed submissive quirks also added to dominant pawns Taleir: Improvements to the "knotting" job. https://gitgud.io/Ed86/rjw/-/merge_requests/253 Genital_Helper optimizations and cleanup. https://gitgud.io/Ed86/rjw/-/merge_requests/248 anon18392: Fix: Silence false positive errors when biotech disabled 5.3.1 replaced racegroupdef limitedSex with teenAge, added adultAge added AllowTeenSex mod settings anon18392: Allow feeding babies in bed without Biotech enabled Taleir: uh... stuff https://gitgud.io/Ed86/rjw/-/merge_requests/243 5.3.0.12 remove legacy age toggle a flock of birds: har-fix klorpa: Spelling and Spacing Fixes 5.3.0.11 set [1.4 FORK] EdB Prepare Carefully incompatible fixed reverse anal/vaginal rulepacks a flock of birds: Added letters for when a pawn gains a trait from sex (only important pawns, can be disabled in basic settings) Gaining the hypersexual trait now requires a pawn to be high on humpshroom as well as addicted Renamed hypersexuality trait to hypersexual (better matches vanilla naming conventions) and necrophiliac to necrophile (to match zoophile) If anal, rimming and anal fisting all have their weights set to 1 in sex settings, pawns can no longer have the buttslut quirk and can no longer gain the buttslut trait from sex (no good way to prevent them from spawning with it though) Likewise for the podophile and cumslut quirks/traits Trying to add an incompatible quirk via dev mode now generates a log message explaining why it failed Other Notes Reasoning for the new hypersexual requirement is that it makes more sense to gain a trait from an altered state of mind than the altered baseline which they might not even notice. You could also reason that a pawn going through withdrawal could get it though. Added an RJWHediffDefOf class to save on database lookups for humpshroom stuff Fixed capitalisation on "induced libido" label on the off chance it ever appears mid-sentence somewhere 5.3.0.10 a flock of birds: Fertility integration fix EndsM: Chinese translation 5.3.0.9 jetolska: Fix bestiality DNA being always human in biotech Fix gaining podopile/cumslut quirk crashing flock of birds: Fixed error on mechrape, improved pregnancy approach interaction selection logic 5.3.0.8 fix animal age check a flock of birds: Actually fixed pawns never reaching ahegao from consensual sex Actually fixed pawns not respecting the preferences of their podophile/impregnation fetishist partners in consensual sex 5.3.0.7 removed sex age settings added min sex age to racedefs change phantasy_pregnancy to grow child until reproductive OR adult lifestage fix error when trying to transfer nutrition for succ from pawn without rest need EndsM: chinese translation a flock of birds: RJW fertility now factors in Biotech fertility if possible Pregnancy approach is factored in to RJW pregnancy calculations for consensual sex RJW fertility is used instead of Biotech's fertility stat for things like checking if a pawn can spawn pregnant Same-gender lovers can select a pregnancy approach if they have the appropriate bits The fertility tooltip in the health tab is slightly more informative Fixed an error when a child reaches a new life stage without Biotech installed Pawns born from non-Biotech pregnancies are no longer always called Baby RJW's install IUD operation is hidden in favour of its vanilla equivalent if using Biotech pregnancy Genderless pawns no longer mess up the "Pawn is sterile" explanation for why pregnancy approach is not available Pregnancy approach now affects the likelihood of vaginal sex being chosen rather than directly multiplying pregnancy chance. Fixed another error caused by non-biotech children turning three Fixed error spam caused by opening the worktab with a non-biotech child in the colony Fixed pawns never reaching ahegao from consensual sex Fixed pawns not respecting the preferences of their podophile/impregnation fetishist partners in consensual sex 5.3.0.6 ... added missing backstories 5.3.0.5 fixed pregnancy icon tooltip error fixed nymphs for 1.4 removed C# backstories, can now use xml to change many nymphs stuff enabled homekeeper nymphs nymphs now can have any bodytype, not only thin EndsM: chinese translation 5.3.0.4 fixed rjw child backstories for 1.4 added toggle to use biotech pregnancy for females in bestiality and human-human pregnancies *humanlike pregnancy and child growth to adult without dlc will cause errors, probably safe to ignore feet/cum/butt slut traits added cumslut(fellatio),buttslut(anal) quirks changed footslut at apply to reciever cumslut,buttslut,footslut now have 5% to be gained after appropriate sex added isRevese bool to sexprops so modders can find if interaction has (InteractionTag.Reverse) faster/easier fixed namespace in HackMechPregnancy, so it should work in older versions of visual studio 5.3.0.3 with biotech dlc hacking mechanoid pregnancy now spawn player faction mechanoids instead of neutral mechanitor can hack pregnancy without operations / ultra meds added dlc PregnantHuman detection to pawn IsPregnant() fix mech genital patch if no dlc found fix typo in Tips, removed brothel mentioning 5.3.0.2 added biotech mechs to implanting pregnancy added mech genitals to biotech mechs 5.3.0.1 fix FeelingBroken being broken a flock of birds: Temp fix for render error on gene interface Less time is spent ticking genitals on unimportant worldpawns 5.3.0 1.4 support 1.3 support not 5.2.4 make rjwtab pawns, pawnTableDef fields public 5.2.3 rjw designators box and icon are now disabled by default added drop down menu for rjwtab with colonists, animals, property designators KeirLoire: lowercase label for drugs 5.2.2 fixes for udder stuff, added udder bondage blocking fix wip tab warnings fix masturbation spot finder 4f9ff58a anon18392: Move Udder from Body to Flank(new) to fix surgery -Add new BodyPartDef Flank as location for udders. -Implement Recipe_RemoveUdder which targets hediffs on the Flank. -Allows for harvesting udders from pawns Add Multi surgeries for insect/animal parts -Allow adding an m/f ovipositor to existing genitals -Allow adding an insect anus to an existing anus -Allow adding an udder to an existing udder 5.2.1 fix parts size update for childrens 5.2.0 rjw maintab with some basic functionality not really a fix for casual sex error maybe fix for maybe error if theres no valid masturbation spot disabled sex thinknodes for fogged pawns, should reduce tps impact on animals breeding in huge maps fix parts size update (wrong size after surgery etc) re-add sex meditation focus source code Dubs670: new settings for egg capabale body parts: minEggsproduced and maxEggsproduced, setting the min and max of eggs generated in a single step. fixes a bug in MakeFuta which was not available in case of females with ovipositors 5.1.0 removed content remove title addition for pregnancy added condom check for receiver, so it should prevent impregnating initiator... unless its group sex ... then F(not like rjw supports group sex) changed pregnancy code to do checks on multiple pregnancies mech/ovi pregnancy now remove all pregnancies instead of 1st one split is_slave check into vanilla and modded slaves added patch to pregnancy hediffs so they dont outright error when added through dev mode, outcome? who knows added bestiality tag to necro, so you can enjoy good time with corpses of your pets added genspawn patch to re/add pawn parts on pawn spawn mwcr: Psyfocus gain from sex now depends on having sex meditation focus, instead of having hypersexuality trait 5.0.3 added content added props display for vagina, breast hediffs fix vagina type hediffs props not working 5.0.2 added content changed bio icon to rjw logo added Sex meditation icon VanillaPsycastsExpanded 5.0.1 fix manifest for mod loader 5.0 its probably wise(who am i kidding? you probably wont even read this) to start a new game and wait for sub mods to update, unless you like walls of red text disabled unused workigers removed whoring removed sexability removed degeneracy that should not be removed milking wip code removed bukkake/cum overlays removed stds 4.9.9 fix post pregnancy baby genital stuff split Bra size and Bra cup korean translation 4.9.8 reduced humpshroom growth time 15->6 (like ideo shrooms) can now plant humpshrooms in deco pots, so everyone can enjoy this glowwy phallus shaped shroom in their bedrooms added designators unset when guest/prisoner/slave leave map fix for 4.9.4.3 -changed interaction requirement to check CustomHandler AND sub/dom requirements 4.9.7 changed BestialityForFemale to behave like other sex jobs instead of 2 stage reverse fuckery fixed rape mentalstate interrupting sex when finished and breaking aftersex thingys added STDImmune prop for slime parts added STDImmune prop for archotech parts added ability to set custom child stories in race support typo fix in "install rodent agina" amevarashi: masturbation typos fixes Twonki: Added Orgasm-Counter to Sexprops Haseiliu: Fix? fertility for animals(allow juveniles to reproduce) XenoMorphie: Enable Cross-Platform Deployment (Linux, macOS & Windows 7+) 4.9.6.1 fixed? slave children faction inheritance marked MedievalTalents incompatible due to pregnancy breaking marked Real Faction Guest incompatible due to pregnancy/ pawngenerator hijack and messing up children 4.9.6 changed pregnancy check to be optional/ pregnancy should be visible for abortion moved paternity check behind pregnancy check/ visible pregnancy done paternity check now shows father in hediff tip added pregnancy abortion for mech implants* changed "Reroll sexuality" button to "Reroll" fixed Disable_bestiality_pregnancy_relations cheat option not being saved added cheat option to Disable_MeditationFocusDrain for frustrated pawns added cheat option to Disable_RecreationDrain for bad sex fix "female" invite to bed bestiality rmb not saving interaction support for 1.3 Mech_Termite 4.9.5.8 fix masturbation counters and semen overlay 4.9.5.7 reverted SexUtility.LogSextype(); position, so dirtytalk/speakup should work again? 4.9.5.6 fix? pawns in warcaskets cant pass loving check, no sex for horny! fix some apparel (warkaskets) breaking rjw nude drawer, so it wont crash but youll get weird shit 4.9.5.5 fixed pregnancy error disabled would_fuck spam 4.9.5.4 fix rmb interaction randomization fix masturbation errors added masturbation social logs, rulepacks Caufendra Sunclaws age scaling improvement for non-human age scaling (shorter lifespans and also longer but below 500years) advanced age scaling uses the "reproductive" lifestage to determine adulthood since Rimworld don't have the notion of adult baked in its lifestages added setting to toggle advanced age scaling (enabled by default) (right under hero mode) 4.9.5.3 Caufendra Sunclaws - Breastjob fixes ? probably - Gender detection fixes ? - Part preference calculations fix for tongue/beak/mouth variants 4.9.5.2 fix anal, oral egg implanting/pregnancy Ed86 added deepthroating / oral rape interaction for fe/male ovi oral egg implanting/fertilizing 4.9.5.1 put SexualizeGenderlessPawn log spam under rjwdev mode replaced legacy part adder racename.Contains("droid") to AndroidsCompatibility.IsAndroid(pawn) exclude prf drones from sexualization genitalless drones and considered asexual fix pregnancy miscarry warning added isReceiver to sexprops fixed pregnancy detection for futa on futa action Caufendra Sunclaws: - fixing fovi - fixing cocoon - LogModule update - Reverse interaction detection fix for fovi - Csproj /w detection of RIMWORLD env variable - Sex Appraiser age scale rebalanced for immortal races - Reverse detector fix for futa - Harmony update to 2.2 nugerumon: whore bed room update performance improvement by analyzing room only once mwcr: Prevent Null Reference when RJW-EX not active. Added simple RJW-EX discovery 4.9.5 fix errors in trait inheritance which could break pregnancy changed udders to also apply to body(animals) bodypart, which should stop spam message in log when pawn created added ai sex thinknode checks when ai tries to exit map/form caravan/enter transporter added error message to rmb when no interaction found, rather than red error moved necro to separate interactions chinese translation CaufendraSunclaws: fixed footjobs fix some parts being blocked for necro ADHD_Coder Add double penetration interation to snakes and such Animals should now have indirect relations such as grandparent or cousin. 4.9.4.5 reverted fix for f ovis to be recognized as penetrative orgasn 4.9.4.4 fix rmb necro added Dead pawnstate to vaginal, anal, dbl p interactions, so they can be used by necrophiles CaufendraSunclaws: fix for f ovis to be recognized as penetrative orgasn 4.9.4.3 added "hands", "arm" defname check for interactions Hands parts changed interaction requirement to check CustomHandler AND sub/dom requirements fix interaction error with necro russian 4.9.4.2 merged rmb strings for rape enemy, rape cp, in just rape "fixed" rmb strings for animal rape, so you wont get options for bread anymore disabled birthing with no ideo until tynan fixes error spam 4.9.4.1 fix non rape giving negative joy fix rmb error, force end previous job, sometimes some why previous job was not interrupted(sleep etc) 4.9.4 maybe fixed rare sex job driver error maybe fixed rare gizmo error fixed egg pregnancy fixed ovi genital tickers, and simplebaby ticker fix colonists orgasm impregnating mechanoids changed SatisfyPersonal, split satisfaction into sex satisfaction, joy satisfaction. changed get_satisfaction_circumstance_multiplier to get multipliers for both violent and (new)non violent sex joy gains from orgasm can now be negative(normal pawn getting raped, masochist not getting raped, rapist not raping, etc), maybe someday zoo? removed ahegao from sex_need thought, now its separate thought and last half day, reduced ahegao mood bonus 12->8, requires sex be at 95+% and joy 95+% or 3 stage broken pawn psychopaths get heart mote when getting raped, will still hate rapist tho added psychopaths for "bloodlust_stole_some_lovin" thought replaced old wimp checks with TraitDef.Named("Wimp") reduced whoring prices for wimps added toggle to cheats menu to Disable relations(mother/father/siblings) from bestiality pregnancy. reenabled rmb animal rape/breeding disabled ai leading ropable animals to bed changed animal rape to use breeding interactions disabled rmb breeding for Rope'able animals changed bestiality service to only work on penetratable organs changed bestiality hj to only work on penetrating organs fix boobitis std fixed cum/nutrition/thirst transfer a flock of birds: Whoring thoughts are applied in their own method called by think_about_sex instead of a delegate in a constructor in the JobDriver's iterator method Added a DefOf class for whoring thoughts Cleaned up existing code Fixed the project refusing to build if the user doesn't have an unused NuGet targets file buried in some specific dot-ridden subdirectory of 0trash jhagatai: Korean translation update for 4.9.3 4.9.3 fixed pregnancy hediffs removed miscarry randomizations and mp sync/lag enabled abortion for unchecked pregnancies safe mechanoid implant option only available for checked pregnancies fix missing pregnancy settings localizations strings fix interaction tail error 4.9.2 fixed ovi's not producing eggs disabled spammy interaction logger 4.9.1 fix knotting not working for reverse interractions fix RaceSupportDef error on save added toggle for limp nymph raids - uses raid points, since someone wanted them, pretty disappointing experience, Ed86 would personally rate them 2/10: -1 for being nymphs -2 for being naked(only applies with rimnude) 4.9.0 not save compatible, start new game or else! your pawns logs will be broken, you will be presented with errors, you pc will burn, your vtuber waifu will ntr you, and who knows what else interactions overhaul: interactions are now not hardcoded in rjw and can be dynamically added, so you can have as many interactions in your game as your pc can handle for modders - interactions now has various tags and filters, so you can now get an some idea what is happening in animation, like what parts are used etc, rather than just roll dice and try to make a guess like it was before pregnancy patch to work with new interactions so you cant finally know who impregnates who - reciever/bottom/sub male/futa can impergnate initiator/dom female/futa (reverse mating press, futa x futa, etc) rmb overhaul: rmb are now brokedown into 3 patches(masturbation,sex,rape) and not hardcoded, so you can order pawn to use any interaction in your game as long as they meet conditions for interaction like have correct parts, big enough size etc, except MechImplant and None sex and rape brokedown in 2 groups ()[staight] and (reverse), where initiator gets serviced/services receiver ... well usually, so you can roleplay being submissive and breedable femboy and after adding few dozens interactions, rmb menu wold still fit in your screen masturbation now have interactions/options on what parts to use to satisfy self, so you can give yourself/pawn selftitjob, autofelatio or go vanilla disabled rmb animal rape, maybe implement it later added interaction template xml with XMLSchema for interaction creating/xhanging, Use Visual Studio Code + XML Extension(redhat.vscode-xml) for validation edited and broke down all interactions in to sep xmls fixed nymph raids, so they are back at "normal" strength after rewrite significantly weakened them removed testing incidents made StringListDef's public disabled bondage for tribals as ideo desirable fix? parts length description with weird bodysize modifier(40 size horse penises yay!) removed sexprops give/reciever fix typo in crosbreed description time dilation on parts hediffs, it should work ok... probably changed pregnancy/egg tick to better handle time dilation, so unless you have like x100 time dilation it should work ok... probably childrens now generated without ideo, so you'll need to convert them, and without (vanilla)backstory, uses moded anyway so w/e? added knotting after sex added option for alternative need_sex calculation/thresholds, technically its correct one but, reduces rjw triggers by 1 notch, so world is boring and less rapey NamingIsHard: enable players to control the number of parental traits can be inherited by babies CaufendraSunclaws: rewrite interactions system(confused, yet satisfied, Ed86 noises) rewrite nymphs events(confused Ed86 noises, was it worth it?) rewrite quirks(??? its rummored to be better, but Ed86 doesnt know or care, You go figure it out) 4.8.2 update mp api to 0.3 update harmony to 2.1.1 removed pawnJobDriverGet, partnerJobDriverGet from SexProps since they dont work added AnimalGenetics to incompatible mods changed bondage arms layer to draw on top of legs layer fixed bodypart incorrectly scale after transplantation changed rjw parts props Knoted -> Knotted 4.8.1.2 fix slave/prisoner breeding pregnancy error when baby is animal 4.8.1.1 fixed condoms not being applied after used removed variables from JobDriver_Sex: (applied after start())usedCondom, (applied in JobDriver_SexBaseInitiator start()) isRape, isWhoring fixed cum/semen being applied with condoms on initiator fixed cum/semen not being applied after core sex fixed implantable egg fertilization fixed std not being applied aftersex 4.8.1 added bondage apparel layers added rmb floatmenu option, where partner refuses sex with initiator, so people can stop asking why "have sex" option isnt working added option for same animaltype matin crossbreed added human->animal egglayer fertilizing added slider for animal sex cd readded legacy age sliders changed RulePackDef defName beakjobRP -> BeakjobRP Korean 4.8.0.4 changed SatisfyPersonal() to SatisfyPersonal(SexProps props, float satisfaction = 0.4f) changed Sex_Beatings() to Sex_Beatings(SexProps props) changed get_satisfaction_circumstance_multiplier() to get_satisfaction_circumstance_multiplier(SexProps props) changed CountSatisfiedQuirks() to CountSatisfiedQuirks(SexProps props) changed Roll_to_hit(pawn, Partner) to Roll_to_hit(); removed SexProps.violent added SexProps.isRapist added SexProps.pawnJobDriverGet() added SexProps.partnerJobDriverGet() replaced some checks isRape with isRapist added varibles set/inheritance to partners SexProps when initializing rjw sex -sexType = Sexprops.sexType, -isRape = isRape, 4.8.0.3 fixed reversed Sexprops/sexoutcome 4.8.0.2 fix? starting bodyparts(things) error with SOS2 or other start with no colonists fix masturbation errors fix semenhelper error fix gizmo error descriptions for SexProps 4.8.0.1 fix worldgen error 4.8.0 (and yes this will break rjw addons) moved bed related checks from xxx to Bed_Utility moved whoring related methods to whoring helper moved bed related methods to bed helper moved aftersexthoughts to separate helper, split many methods into smaller methods moved path related checks to pather utility split succubus related functions into separate methods since i figured how to save constructs, changed most functions to call Sexprops rather than (pawn,partner,...., etc) changed orgasm() to function properly and impregnate, do cum stuff, transfer nutrition when triggered rather than after sex changed breedingforfemale to call mating job, so rather than reverse fuckery now animal is initiator changed parts detection to use filtered lists bound to pawns that are updated on 1st rquest/gameload/part add/loss, rather than going through all hediffs everytime added fuctions to pawn extension for easier calls pawn.GetGenitalsList() etc added sexutility.SexInterractions with all valid rjw interractions added rjwSextype rjwSextypeCollection list with all sextypes added check for torso(whole body)BPR moved wild mode, hippie mode and debug toggles under dev mode toggle breakdown of CheckTraitGain breakdown of records handling methods changed SaveStorage.DataStore.GetPawnData(pawn) to pawn.GetRJWPawnData() remove satisfy() removed sexutility.sexActs changed rmb extending from AddHumanlikeOrders to ChoicesAtFor, so hopefully some mods that patch AddHumanlikeOrders wont shit them selves disabled breeding selection for animal invite, now you can only invite it and it will do w/e it wants disabled guilt for player initiated rape/ beatings inetegrated Aftersex with AftersexMasturbation changed age checks to pawn growth and reproduction lifestage removed option to disable pregnancy trait filter removed parts stacking removed disable kidnapping patch, use my workshop mod added chest,genitals,anus bodypartgroups fix implant eggs not saving their label/size on save/load added tongue check for cuni,rim,69 fixed birthing with double udders/featureless chests 4.7.2.5 fix egglayers pregnancies 4.7.2.4 fix egg progress not being saved 4.7.2.3 removed statOffsets for archo parts spanish PortugueseBrazilian 4.7.2.2 disabled test random interactions selection instead of scored one 4.7.2.1 fix eggs gestation 4.7.2 fix mechimplanting added Name="RJW_EggUnfertilized_Default" to ThingDef's of rjw eggs multiplied cum on body amount by 10 fix for pregnancies with races without gestationPeriodDays (mechanoids etc) fixed eggnancies for races with no gestationPeriodDays fix error pregnancy, while looking at hediff debug, while birthing more that 1 pawn changed HumpShroom to fungus korean 4.7.1.1 fix patch error for newborn pawn missing pawn.styles - droids etc chinese 4.7.1 added gender check when missing genitals to CheckPreference, so next time Mesa looses genitals - can still be considered for sex added patch to fix for vanilla pawn generator making newborns with beards and tattoos added - rape marking pawn guilty for 1 day if partner not maso/slave/prisoner/CP fix? error when pawn get downed from cuminflation or wounds after sex and cant interract/tame animal after sex childrens born from colony prisoner/slave will inherit mother factions and prisoner/slave status added resizable props to demon,slime,bio,archo parts added buttons to resize parts in rjw bio menu removed gay trait from child trait inheritance nugerumon: Fix empty line in inspect string, hide whoring overlays/buttons on non-player beds 4.7.0 1.3 support: added countsAsClothingForNudity for bondage added 1.3 IsSlave tag for slavery detection disabled rmb for prisoners and slaves disabled ability to set prisoners and slaves as hero added SlaveSuppression for bondage moved would_fuck debug menu to bio rjw icon, since oldone is removed in 1.3(removed SocialCardUtilityPatch transpiler) added button to export would_fuck scores to csv fix semen overlay fix settings menu fix pawn creation ui widget fix sex pawn drawing fix aftersex pawn drawing added PartnerPawn to JobDriver_Sex to reduce checks in Partner.get{} fix? added null check for JobGiver_RapeEnemy when debug enabled and no rapeEnemyJobDef found fixed Hediff_SimpleBaby Merge branch 'Tory-Dev-patch-82770' Include unofficial 1.3 version of Prepare Carefully to incompatibleWith Merge branch 'a-flock-of-birds-Dev-patch-31845' Fixed humanlikes requiring animals to be over sex_free_for_all_age regardless of lifestage 4.6.9 passive whoring for prisoners added RJW_NoBuy tag to bondage and natural parts, natural parts no longer spawn in vanilla traders patch to filter tradable stuff by tag RJW_NoBuy, so you cant sell rjw stuff to any(vanilla) trader just because its 15+ silver worth increased condom price to 2 switched usedcondoms sellable->buyable set Demon parts to be untradable set SlimeGlob to be untradable set pegdick to be untradable changed SexPartAdder & LegacySexPartAdder classes to public 4.6.8.2 fix meditation error more description to GoToModSettings anime tree support(meditation) descriptions to Hediff_RapeEnemyCD functionality, if anyone want to edit it changed label of MeditationFocusDef Sex to start with capital motd1233: fix thread error on loading icon 4.6.8.1 fix updatepartposition() error fix for modContentPack is null on one of the surgeries from PolarisBloc korean for 1.1, 1.2 4.6.8 changed nymphs <PawnKindDef> to <PawnKindDef Name="RJW_NymphStandard"> moved parts eggs production ticks to separate function so they dont have to sync whole part tick in mp, but only rng disabled rmb colonist_CP_rape when option is disabled in setting allow nymphs to meditate at things with SEX meditation focus (ex: porn magazines) moved udders from "chest" bodypart to "torso"/"wholebody"/null legacy sexualizer - cowgirls now spawn with normal breasts and 50% udders added HasUdder toggle to race support - adds 1 udder to female pawn added code to add(operation recipe) single part/hediff(if it doesnt exist) added recipes to add 1 udder or remove from torso(does not create udder part, doesnt work for animals, fix someday, maybe) added titanic breast preset to char editor chinese lang update gmasterslayer: Replace the random number generator with the Box-Muller translation. Box-Muller allows for randomly generating numbers that adhere to standard distribution. Part sizes will now fit standard distribution meaing that 'average' part size is now truely average. Extreme ends of the part size severity curve will now be increasingly less likely to be generated, while increasing the normal aka 'average'. klorpa: typo fixes motd1233: Restore vanilla's pregnancy indicators in animal tab and caravan/transport dialogs which were disappeared. 4.6.7.4 fix gizmo error if pawn has no Need_Rest moved satisfaction bonuses for nerco and zoo to SatisfyPersonal, so its now triggered on orgasm 4.6.7.3 fix masturbation errors 4.6.7.2 fix sex loop if vanilla overrides disabled fix partAdders error 4.6.7.1 fix part addder error from race support patches set orgasm modifier for animals x4->x1 4.6.7 added sexgizmo, separate enjoyment tickers, orgasms, toggle for neverending sex(or until pawn collapses from exhaustion), button to trigger beating during rape moved satisfaction to orgasm method added partAdders to race support - overwrites normal rjwparts adding/generation, so now you can create cute 9 dick-tailed foxes with hydraulic penis arms, levitating with the power of their anuses(probably). Youll need to create custom parts that wont be moved during saveload self fix added filter to not move/fix rjw parts on certain bodyparts replaced HediffDef.Named("Hediff_Submitting") checks with xxx.submitting added toggles to disable fapping in chastity belts and/or with bound hands more sextypes for transfer nutrition and succubus mana moved beatings into separate method removed "sex ability" from all calculations changed whoring prices to be affected by whoring experience rather than sex ability fixed condom removing error for medieval mods nugerumon: Hippie Mode whoring bed code/reservation improvements 4.6.6 fixed jobs ending before they actually should (and not getting aftersex toil) debug info for whoring pricing reduce pregnancy detection recipes exp gains fixed min age check that prevented animals breeding set base impregnation chance for same species egg layers to 100% added rmb deeptalk social "cheat" option added sapper nymphs fix? for colonist prisoner pregnancy, maybe? disabled age_factor log message 4.6.5b fix polyamory/polygamy checks returning always false 4.6.5a fix [HarmonyPostfix],[HarmonyPrefix] tags 4.6.5 moved some sex checks from SexTick loop to single check at sex start added missing SexTick for whoring removed health check for nonhumans to initiate sex fixed error when birthing eggs from dead pawn added Animal on animal volume modifier chinese translation stuff you probably dont care: renamed bunch of harmony patches methods to more descriptive than "this_is_postfix" pawn request generator update wip interactions: ↲ interactions generator ↲ abstract interactions ↲ rmb label nugerumon: allow other polyamory/polygamy mods 4.6.4 removed patreon link (if you have it on your site or post, replace it with SubscribeStar https://subscribestar.adult/Ed86) fix rmb violate corpse vaginal eggnancy now removes "normal" pregnancies DeterminePaternity now requires 1 medicine nugerumon: whore bed fps performance tweaks display whore bed price factor only in infocards of humanoid beds 4.6.3 fixed oral egg pregnancy breakin all pregnacies fixed whoring thoughts error spam for whores without bed added anal egg pregnancy toggle 4.6.2a fixed desync for rmb sex options 4.6.2 added sync for rmb socialize and masturbation, disabled options for sex until i figure out how to sync them, maybe this year fix rmb lag in multiplayer fix settings egg strings Nabber: egg implantation changes nugerumon: Add toggle to beds to (dis)allow whoring Mewtopian: Fix alien ages, not by changing ScaleToHumanAge but by letting old humans have some lovin 4.6.1 fix error during SelectSextype detection for non predefined interactions public class RaceGroupDef 4.6.0 changed IUD to reduce chance of pregnancy by 99% instead of setting fertility to 0, changed iud descriptions switched eggs generation from father+implanter to implanter, any pawn with fertile pp/male ovi now can fertilize eggs, outcome will be implanter kind or what is in predefined egg (in case of animal implanter) changed postfix_TrySpawnHatchedOrBornPawn to affect only vanilla pregnancy, eggs hatcher, and rjw pregnancies changed mech implant description(not sure its used anywhere but w/e) disabled stun after rape if rape beating disabled removed egg requirement for male insects to rape pawns Interaction overhaul: removed consensual interactions from rape and bestiality breakdown Oral sexacts into rimming,fellatio,cunnilingus,sixtynine split consensual interactions into male/female, give/receive, top/bottom... your get the idea...probably? :RJWVodka: added female rape interactions(someone should rewrite descriptions, actually most descriptions should probably be rewritten, but Ed is a Trashboat and doesnt speak english[This is machine translation to your primitive monkey language by your supervising AI overlord]) added ability to add custom interactionDefs for sex added ability to set rulepacksDefs for each interactionDef *should someday rewrite rmb code to filter interactions by sex type instead of being hardcoded nuganee: Add options hint to black designations square. mwcr: Add newer jobs to list of jobs interruptable for quickie 4.5.6 disabled sex rulepacks (2nd part of message in pawn log) changed interaction defs rulestrings, so they more descriptive about sex changed rmb options to use rjw's interactionDef label strings (someone should probably fix grammar someday) added rape interaction defs, so you can now dominantly give blowjobs and stuff removed cocoon requirement for anal egging added few more patches to disable nymph meditation disabled rape cp for animals remove double debug message for rapin added RJW_ prefix for brothel tab defs, so they dont conflict with other mods mwcr: Hide command gizmos for other players and non-heroes in HC mode 4.5.5 1.2 enabled patch for wordoflove to use rjw orientation checks backported below changes to 1.1, hopefully last patch for 1.1 changed distance (cells) check to be ...erm... more human understandable(at least now i know how it works!) increased default maxDistanceCellsRape => 100, maxDistancePathCost => 1000, you should probably go to settings and change/increase it manually to default(at least CellsRape) added more logs for tracing rape and why pawns are excluded from target list reversed PawnBeauty social bonus for purpose of rape, so PawnBeauty effects are nulified for kind pawns, and work as penalty for everyone else(more likely to rape) changed mating override patch so animals will mate even with animal_on_animal disabled fix ovi's having no fluid amount set and therefore no cum on pawn, newly generated ovi's now use penis x2 fluid modifier mwcr: widget optimisations 4.5.4 changed mod structure to move away from 1.0-1.1(this is probably last version/update for rw1.1) changed RandomRape descriptions hi-res egg textures fixed semen warning spam fixed mating reservation error spam reduced min pregnancy time modifier 10->5% typos fixes by Casiy Rose 4.5.3 changed insect eggs to new glowing ones by SlicedBread added new HediffDef_MechImplants so mods can define what mechanoid pregnancies birth instead of always Mech_Scyther prop fixes 4.5.2 set PrepareCarefully as incompatible fix rape error fix consensual nonbed sex check added Tapered prop to DogPenis added more props missing props source mwcr: Added capitalization of pregnancy letters. 4.5.1 changed UsedCondom to AnimalProductRaw removed NymphosCanPickAnyone option, will probably remove other options too with time added parts props(: knots, etc), maybe will have some usage in future increased size penalties for breasts size 1.4+ added titanic breasts size(to reflect hyper lact max max effect) changed targetfinders to filter distance to target in 2 paths, distance in cells(fast), distance in path(slow) split sex distance check in 3 options for casual and rape sex, path check added distance check options and descriptions added los check to whoring cheated thought changed 'something' with poly partners(likely need total overhaul) moved casualsex target selectors to casualsexhelper 4.5.0 allow birthing to be done if pawn dies due to pain during contractions stage added natural parts resize (for kids growing) based on bodysize, probably broken af if you try transplant it until pawn fully grown... or not... who knows changed masturbation in bed on happen in owned bedroom/prison cell, (prison)barracks now need frustrated for exhibitionist quirk merged masturbation spot finder with quickies changed quick sex target finder scores: -added per door bonus/penalty for sexspot searching? so corridors or rooms with lots of doors would be less desirable, unless exhibitionist -necrophiles now gain bonus from nearby corpses +20 -removed prisoner cell bonus -added +5 bonus to cells that has beds -added -100 score penalty to doorways, unless exhibitionist -added -10 penalty to Barracks, Laboratory, RecRoom, DiningRoom, Hospital, PrisonBarracks, PrisonCell cells unless pawn is exhibitionist, then +10 hide already added quirks from quirk add menu fix got_anal_bred not being removed when pawn become zoo Merge branch 'AddTips' into 'Dev' 4.4.12 fixed pregnancy error fix egg pregnancy with unidentified eggs made quirk public set slime breast FluidType to none 4.4.11 fix aftersex thoughts 4.4.10 fixed error caused by downing or killing pawn before sex over added horny_or_frustrated requirement for random_rape MentalState fixed errors in debug pregnancy/add pregnancy hediff/birth fixed father relations overwrite mother, so self-fertilized female is always mother moved postbirth humanlike baby patches/fixes from PawnGenerator patch to TrySpawnHatchedOrBornPawn PawnUtility postfix patch, which should cover rjw pregnancies and hatching/ovi 4.4.9 fixed/changed mechanoid detection for implanting to "Mech_", (yay pikeman you can no use your pike on colonists too) added override for mech implanting sextype, so it shouldnt error with no valid types added is_mechanoid() check for mech implanting sextype, so you probably better keep your pawns off tamed mechanoids and droids, unless... fixed mech impregnation removing previous mech pregnancy fixed error when searching for targets to do quickies with pawns that have no relations like droids and stuff removed RJW_EggOrassanFertilized, since its now sep mod maybe? fixed mp desync when pawn broken with PC chinese 4.4.8 added Ovi egg pregnancy support to races changed implanted eggs to actually birth eggs that hatch(for non humanlikes) moved some post birth baby code to PawnGenerator(so humanlikes can be birthed through eggs) fixed egg birthing during sex(disabled, so it wont interrupt sex with error) removed nihal race patch reduced pregnancy hunger to 30% added ability to make other races kinddefs into rjw "Nymphs" better pregnancy nymph filter, so kids cant by nymphs fix labels for big/large implants/penises fix size changer typo fixed? part size to use race bodysize instead of owner bodysize(which is probably was broken for childrens) 4.4.7 added option to show extended(sizes) RjwParts info reduced TalkTopicSex from 80% to 8% Merge branch 'Dev' into 'Dev' added phantasy pregnancy toggle(faster child growth) added sliders to change pregnancy duration removed hardcoded archo fertility bonus changed immortal pregnancy to silently miscarry changed Archotech fertility enhancer from 25% to 100% added vomitmtb to mid pregnancy stage changed vomitmtb to 2/4/6 per pregnancy stage added double hunger rate during pregnancy increased pain during contractions to 50% fix anal rape thoughts re-added debuffs for avg/large parts readded Manipulation penalties to breasts increased penalties for "hydraulic breasts" reduced penalties for bionics and archotech fixed rape flag not being set in rmb sex scores disabled log spam of Sex satisfaction multiplier FacialAnimation_compatibility chinese 4.4.6 fix? bestiality/mating checks typo fix in override_matin setting unforbid insect jelly in home area moved Raccoon to sep race group added rmb for hero to socialize fix? error for transfer nutrition for pawns without props brazillian portuguese german 420san: Allow rape to trigger during raids dastardlii: Added Sex Satisfaction Stat Added stat modifiers for Royalty implants. Fixed Missing Surgeries Remove old, broken EPOE integration (Was injecting recipes with Harmony instead of using defs) Updated prosthetic recipe defs to include abstract master defs for convenience Crafting benches for prosthesis are now defined in the defs Fixed Consciousness being applied to SexAbility in the inverse direction. Move circumstantial satisfaction bonuses (rape/masochism/broken...) to their own function. Fixed bonus satisfaction for broken pawns being applied all the time instead of only during violent sex. Changed sex satisfaction handling for broken pawns and violence to match old behavior while using new the stat Moved satisfaction effects from humpshroom withdraw from C# to XML 4.4.5 changed humpshroom and nympho trait descriptions to show their effect on psyfocus reduced mood buffs from sex by ~2 changed mating/loving patch so, should it fail, it should stop before rjw override kick in reverted baby bio age set to 0 on birth, so you can have your 14yo babies changed rape stripping to only work when colonist involved russian, chinese translations TDarksword: add (flat) breasts to males (racesupport?) add udders to Donkeys, Horses and Yaks 4.4.4 changed min whore price modifier to 0.1% at 12% age Merge branch 'setup-streamlining' into 'Dev' added apparel in thingCategories Containsining ("vibrator", "piercing", "strapon") to be drawn during sex russian chinese simpl 4.4.3 added hybrid/predefined pregnancies changed other mods detection so it doesnt rely on mod names added 1.2 tag 4.4.2 changed pregnancy check variables names set default rape stripping and complex pregnancies to false fix pregnancy? on birth: -remove implant hediffs and restore part -remove immortal hediff -set babies biological age to 0 fix hemipenis detection german translation typo fixes 4.4.1 added https://subscribestar.adult/Ed86 so you can send me all your money there added forced can_rape check for rmb, which ignores pawn sexneed, so now all you degenerate rapist can rape pawns non stop added race sexdrive modifier to race support(*looks at hentai space cats*) added option to strip rape victims changed Vigorous Quirk to reduce sex rest drop by half instead of by 1 changed Vigorous Quirk description changed SexulaizeGenderlessPawn to SexualizeGenderlessPawn fixed? teleport fucking fixed mod menu rectangles heights, sidescroll fix has_genitals checking wrong bodypartrecord 4.4.0 translations: chinese, korean 4.4.0 changed rmb faction detection to not error on rw1.2 support for yet another simple slavery 1.1 added sounds volume settings fixed default mod settings for when ppl upgrade added rmb to change masturbation "pose" fixed error when trying to rmb sex with drafted pawn wip tags for interactions? removed bondage merged Masturbate_Bed and Masturbate_Quick into Masturbate job driver merged quickie receiver into loved job driver rename jobdef RJWMate -> RJW_Mate set miscarry, abort, kill, to discard babies before removing pregnancy hediff doubled cocoon healing, added 50 heat/cold insulation fixed immortal? pawns/eggers loosing genitals after being resurrected fix for possible royalty pregnancy bug with titles spam fix for pregnancy losing father, when father discarded fixed xml eggsize setting not working added eggsize slider to pregnancy settings disabled fertilization of broken eggs disabled prostrating for pawns with ovis when they are about to lay eggs fixed? droid? aftersex cleanup so it shouldnt error because lack of need? 4.3.3 disable rmb for guests fixed targeted masturbation fixed bestiality firing casual sex and vice versa fixed got_anal_raped, got_anal_raped_byfemale not being removed from pawn when becoming masochist korean 4.3.2 changed rjw widget to not show designators when rape/bestiality options disabled disabled rmb when pawn is having sex added rmb menu for rape and breeding, since 80% interactions are consensual, rape/breeing menu is pretty empty until someone writes more interactions, or redesign whole system? split DetermineSextype into few functions added Sexprops to sex drivers moved available parts for sex detection to sep method better description for changesex royalty worldgen error fix? for pawn trying trying to solicit while having sex/going to bed with client changed debug prefix naming korean translation Abraxas: Update sizes for Implants Update CE size_setter Tirem12: Normal/anal rape Thoughts distinction 4.3.1 rmb - fix hero mode check rmb - fix CP rape check rmb - added conditions for normal rape - target must be rapable/vulnerable enough, rapist vulnerability must be less than or equal to victim 4.3.0 removed workgivers doubled whoring tab room Column size support for Nightmare Incarnation Succubuses rmb menu backstories for civil/tribal childrens Korean Translation file for RJW-2.4.6 translation fixes Mewtopian: Add granular cup size, length, girth, and weight to parts. Scale part size measurements by body size. Mitt0: rape-debugging toggle price-range-room-bonus tip 4.2.6 changed trait beauty check to PawnBeauty stat added mating jobdriver, so it doesnt spam rape messages when animals mate fixed cocoon and restraints removal recipes changed nymph join "colony" to "settlement" fix for drawing pawn on diff map during sex post whoring fixes: reduced base whoring prices by 2 changed 20% whoring price gender bonus from female to futa reduced whore prices past 1st half-life typo fix for whoring tab Mitt0: whoring fixes brothel-tab-improvements interruptable-jobs for quickies 4.2.5 raised hard nymph raid to 1k fix for pregnancy maybe another for transfer nutrition disabled bobitis updater and breast growth/shirnk recipes 4.2.4 chinese translation set Rjw sexuality to force reset to Vanilla on game launch unless individuality or psychology installed anal egg pregnancy for cocooned pawns fix? for nutrition transfer error when pawn has needs but no food need fix for insect birthing error 4.2.3 fix error in ChangePsyfocus with ROMA and animals 4.2.2 changed ChangePsyfocus to first check for royalty dlc b4 doing anything fix for error when sex is interrupted changed sexneed to reduce psyfocus only at frustrated level by -0.01 typo fix german translation korean translation 4.2.1 fix for sexneed checks preventing some sex when frustraited fixed whoring tab toggles fix sick whore not giving failed solicitation thoughts fixed whores prisoners/slaves getting payed by colonists removed whore beds added Morbid meditation focus to necrophiliacs added Sex meditation focus -nyphomaniacs can use Sex meditation focus -humpshrooms can be used as Sex meditation focus, 100% eff -humpshrooms restore 100% focus on consumption added 1% psyfocus regen per sextick (~8-15% total) in non solo sex for: -necrophiles for violating corpse -zoophiles for sex with animal if they have natural meditation focus -nymphs -succubuses x2 horny pawns loose 1% psyfocus per 10 needtick (~25s) frustrated/ahegao pawns loose 5% psyfocus per 10 needtick (~25s) changed cocooning to hostile targets, it maybe even work disabled whoring widget disabled milking widget checks merged widget permission checks into 1 function updated nymph backstories to make some sense added CompEggLayer check for -human pregnancies so it should fertilize eggs instead of causing normal/rjw pregnancy -bestiality - no pregnancy or fertilization set birthing "nymph" parent kinddef to default to colonist, so they wont be birthed adult set droids without genitals always be asexual, animal with individuality and psychology now also apperantly asexual hidden animals sexuality in social wouldfuck check since its always asexual set asexual pawns to return 50% sex need ChineseSimplified for version 4.2.0. more korean? fixes for archotech parts descriptions typos some tips and description changes by DianaWinters geoper: quickie job filters support for Simple Slavery[1.1] Renewed merged whoring tab toggles 4.2.0 fix error for semen applying fix quickes errors with forbidden zones changed oversized size name to: -breasts - massive -penis - towering -vag/anus - gigantic reduced moving penalties of oversized anus/vag overhaul of genital_helper: -functions now return all parts instead of 1st they can find, -functions now accept premade parts list, which should speed things up a bit -removed old genitals enum checks since parts can be added by any mod now and that would fail -replaced inside code of get_penis/vag functions with get_penis/vag_all later removed -(PS. mods that uses genital_helper are broken and need to be at least recompiled) changed some rjw logs requirement for RW dev to RJW dev changed eggs to cap speed penalty at 10% per egg for pawns with ovis decreased starting egg severity to 0.01 changed immortals to always miscarry pregnancies rather than being infertile too lazy to make immortals toggle, disable support code patch to remove DeathAcidifier from babies removed obsolete english,chinese,korean translations added korean translation? 4.1.5a fix immortals error 4.1.5 changed bukkake to apply real ejaculation amount shown in part hediff instead of bodysize based add job filters for quickie target selection, so forced or probably important jobs wont be interrupted set max nymph spawn limit for raids to 100 disabled birthing while being carried disabled individuality/psychology sexuality warning spam for animals, because they likely have none fix for psychology sexuality resetting added recheck for psychology sexuality change midgame disabled breeding rape alerts for animal vs animal changed breeding to still consider pregnant humanlikes set pregnancy Miscarry only trigger with 40+% Malnutrition immortals set to infertile geoper: Sex on spot fixes 4.1.4 new tips, yay! moved setup beating ticks to setup_ticks ImprovedSleepingSpot: raised rest effectiveness raised surgery chance sleeping spots: -reduced comfort from sleeping in dirt to 0.1 -increased rest effectiveness to minimum of 0.8 -removed imunity nerf -removed surgery nerf increasesd RJW_DoubleBed stats increased ejaculation amounts for big creatures(work only on new pawns) fixed necro error changed brothel button to icon pawn with aphrodisiac effect now counts as nymph for would_fuck calculation set default FapEverywhere to false added workgiver to masturbate in chair/other sittable furniture replaced direct control with cheat option, disabled cheat overrides in mp separated all nymph events into separate toggles fix oversized breast implants using setmax instead offset manipulation added bondage_gear_def exclusion for drawing pawn during sex, so bondage should be drawed added bondage apparel category added pregnancy filter to breeding, so animal stop breeding pregnant receivers adjusted sexuality reroll and quirks to need rw.dev instead of rjw.dev fix for better infestartion raping enemy duty merged Chinese translatio0n merged sex on spot by geope 4.1.3 fix bestialityFF and whoring pathing to SleepSpot 4.1.2 fix royalty bed patch 4.1.1 update apis and 1.1 multiplayer changed jobrivers moved motes and sounds to sep functions overhauled sextick fixed rjw pawn rotation handler so rjw can now actually affect pawns facing direction fixed doggy orientation for FF bestilaity added mutual thrust during loving looks like fixed bestiality for female jobdriver, so it wont freeze if you forbid doors, probably fixed(or broken, untested) whore servicing clients reduced breast oversized size penalty to -40% movement added breast back breaking size -80% movement, you will probably need some bionics to move probably made natural parts not impact(reduce?) pawn price probably disabled sexualization of genderless non animals/humanlikes disabled beatings for animal vs animal sex, no more blood for blood god fixed error caused by killing pawn while it still doing breeding added DefaultBodyPart to parts added patch to fix broken parts locations on world load after breaking them with with pawnmorpher, or other mod that changes bodies added patch to fix broken parts after breaking them with prepare carefully set default egg bornTick to 5000 so its gives 1 min for testing egg implanting and birthing increased parts tick 60(1sec) -> 10000(~3min) give some loving chance(based on SecondaryLovinChanceFactor) for orientation check in would_fuck even if orientation_factor is 0, so pawns still might consider opposite orientation if they VERY like someone 4.1.0 changed jobs to select sextype at the beginning of sex instead of after added start(), end() to masturbation, rape corpse, casual sex added toggles for override vanilla loving with casual sex, matin with breeding fix sex jobdriver Scribe_References added JobDriver_washAtCell to DubsBadHygiene patch, disabled for now, not sure if it should exist removed "RJW" from pregnancy options in Pregnancy Settings disabled Initialize function for ProcessVanillaPregnancy and ProcessDebugPregnancy since it already should be done in Create function cleaned that mess with rape alerts, added silent mode, disable option now disables them set beating to always use gentle mode for animal vs animal fixed whoring and sex need thoughts not working at minimum pawn sex age patch for FertileMateTarget to detect rjw pregnancies so animals wont mate already pregnant females set parts update interval to 60 ticks added code for rjw parts to delete them selves when placed at null/whole body (PC) update for individuality 1.1.7 moved syr trait defs to xxx instead of somewhere in code changed egg pregnancy to produce insectjelly only if baby or mother is insect changed nymphbackstories to use SkillDefOf added rape enemy job to DefendHiveAggressively Mewtopian: -Add size to racegroupdefs Toastee: -paternity test 4.0.9 changed insect egg pregnancy birth to spawn forbidden insect jelly disabled hooking with visitors for slaves set slaves to obey same rules as prisoners disabled fapping for slaves(like prisoners) unless they are frustrated slaves now counted as prisoners for whoring (thought_captive) added slaves to bondage equip on probably disabled pregnancies for android tiers droids fixed quirks descriptions for 1.1, added colortext to quirks fixed nymph generator for 1.1 added chance to spawn wild nymph added 2 nymph raids: -easy 10% - you can do them -hard 01% - they can do you changed "No available sex types" from error to warning added patch/toggle to disable kidnaping changed parts adder so pawns with age less than 2 dont spawn with artificial parts(not for race support) 4.0.8 fix for casual hookin 4.0.7 since no one reads forum, added error/warning for Prepare Carefully users and another Merge whoring fix 4.0.6 removed old sexuality overrides patches Merge whoring fix set Aftersex to public fixed error when designated tamed animal goes wild 4.0.5 adde sexdrive to HumpShroomEffect fixed bestiality and whoring follow scrip sometimes gets interruped and cause notification spam Merge branch 'patch-1' into 'Dev' fix: error when child growing to teenager 4.0.4 fixes for casualsex and whoring disabled vanilla orientation rolls and quirk adding for droids fix for droids getting hetero sexuality instead of asexual fixed rjw parts resetting in storage added fluid modifier, maybe someday use in drugs or operations added previous part owner name, maybe one day you stuff them and put on a wall added original owner race name 4.0.3 disabled breastjobs with breasts less than average added autofellatio(huge size) check, in case there ever will be descriptions for masturbation added workgiver for soliciting, (disabled since its mostlikely fail anyway) moved hololock to FabricationBench changed condoms to not be used during rape, unless CP has them job_driver remaster disabled settings Rjw_sexuality.RimJobWorld changed options to reset to vanilla instead of rjw added option to disable freewill for designated for comfort/mating pawns changed rape target finders to select random pawn with above average fuckability from valid targets instead of best one set rjw sex workgivers visible, so ppl can toggle them if game for some reason didnt start with them on pregnancy code cleaning cleaned pawngenerators fixed mech pregnancy removed hediff clearing for humanlike babies(which should probably make them spawn with weird alien parts?) fixed missing parts with egg birthing humanlikes added hint to Condom description changed mentalstate rape, to work for non colonists and last like other mentalstates or until satisfied set GaramRaceAddon as incompatible as im sick of all the people complaining about asexuality error after GaramRaceAddon breaking pawn generator/saves and all C# mods that loaded after it fixed check that failed adding rjw parts if there is already some hediff in bodypart added RaceProps.baseBodySize modifier to fluid production roll, so big races probably produce more stuff 4.0.2 remove debug log spam on parts size change changed default Rjw_sexuality spread to Vanilla reduced LoveEnhancer effect by 50% for rjw changed cocoon hediff to: - not bandage bleeding(which doesnt make sense) but instead rapidly heal up, can still die if too much bleeding - tend only lethal hediffs, presumably infections, chronic only tended if there danger for health support for unofficial psychology/simple slavery, Consolidated Traits - 1.1. untested but probably working renamed xml patches rearranded defs locations in xmls changed fap to masturbation added masturbation at non owned bed moved sex workgivers into on own worktype category, so royalty can also have sex removed workgivers from worktab(cept cleanself, its moved to cleaning category) disabled cell/things scaners for workgivers some other workgiver fixes changed RJW_FertilitySource/Reproduction to RJW_Fertility(should stop warning from med tab) aftersex thoughts with LoveEnhancer - pawn now considered masochists/zoophile aftersex thoughts - removes masochist HarmedMe thought with rape beating enabled removed ThoughtDef nullifiers and requirements from bestiality/rape added negative MasochistGotRapedUnconscious thougth (its not fun when you are away during your own rape) reduced masochist raped mood bonus typo and misc fixes more tips merged merge requests with public classes and some fixes 4.0.1 since LostForest intentionally breaks rjw, support for it removed and flagged it as incompatible, you should probably remove that malware added LoveEnhancer effect for normal lovin' fixed SlimeGlob error 4.0.0 added parts size changing/rerolling, works only in character editor and another Mech_Pikeman fix disabled eggs production if moving capacity less than 50% disabled eggs production for non player pawns on non player home map disabled egg message spam for non colonists/prisoners fixed operations on males flagging them as traps fixed crash at worldgen when adding rjw artificial techhediffs/parts to royalty, assume they are happy with their implants and new life fixed gaytrait VanillaTraitCheck fixed error in can_get_raped check when toberaped is set to 0 fixed pawn generator patch sometimes spawning pawns without parts in 1.1 fixed bionic penis wrong size names fixed error when applying cum to missing part split rape checks in WorkGiver_Rape to show JobFailReason if target cant be raped or rapist cant rape removed RR sexualities cleaned most harmony patches changed Hediff_PartBase into Hediff_PartBaseNatural, implants changed to Hediff_PartBaseArtifical, so purists/transhumansts should be satisfied changed mod data storage use from hugslib to game inbuild world storage changed penis big-> penis large someversionnumber 5 v1.1 patch patch patch patch patch set default sexability to 1 another fix for pikeman added horse to equine race group and another hugs/harmony update someversionnumber 4 v1.1 patch patch patch patch update for new harmony someversionnumber 3 v1.1 patch patch patch harmony, hugslib update changed Hediff_PartBase class Hediff_Implant to HediffWithComps replaced RationalRomance with vanilla sexuality, now default added hediff stages for parts sizes added patch to nerf vanilla sleeping spots into oblivion added fixed ImprovedSleepingSpot removed broken ImprovedSleepingSpot added RjwTips, maybe it even works changed descriptions for parts items to not say severed added tech and categories tag for implants set archotech reward rate to RewardStandardHighFreq set archotech deterioration rate to 0, like other archo stuff added descriptionHyperlinks for hediffs added support for Pikeman mechanoid someversionnumber 2 v1.1 patch patch fixed bondage/prostetic recipes fixed translation warning fixed sold x thoughts removed CompProperties_RoomIdentifier from beds fixed humpshroom error even more hediff descriptions hediff descriptions update implants thingCategories someversionnumber 1 v1.1 patch added additional option to meet SatisfiesSapiosexual quirk satisy int>= 15 added manipulation > 0 check for pawnHasHands check added egg production to ovis fixed crocodilian penis operation needing HemiPenis changed Udder to UdderBreasts changed Hemipenis to HemiPenis changed Submitting after rape trigger only for hostile pawns rjw parts rewrite -disabled broken breast growth -disabled broken cardinfo -remove old size hediffs, recipes,thingdefs -remove old size CS rjw parts rewrite parts data now stored in comps and can be transfered from pawn to pawn -parts are resized based on owner/reciver bodysize -parts can store data like cum/milk stuff -parts data can be affected by stuff like drugs and operations v1.1 ---------------------------------------------------------- 3.2.2 removed bondage sexability offsets, should probably completely remove all traces of sexability some changes to target finding can_fuck/fucked/rape checks, removed sexability checks added armbinder hands block stuff added condoms to Manufactured category 3.2.1 added prostrating hediff for colonists or 600 ticks stun for non colonists after rape changed mechGenitals to mechanoid implanter put max cap 100% to fertility modifier for children generation, so you don't get stupid amount of children's because of 500% fertility changed condom class to ResourceBase so its not used for medicine/operation stuff PinkysBrain: fixed mechanoind bodysize warning Funky7Monkey: Add Fertility Pills 3.2.0 added toggle to show/hide rjw parts fixed? quirk skin fetish satisfaction fixed 10 job stack error with mental randomrape removed equine genitals from ibex fixed rapealert with colonist option fixed added quirks not being saved fixed? orientation/ quirk menu not being shown in rjwdev fixed sexuality window being blank in caravans/trade added chastity belt(open), can do anal added chastity cage, cant do penis stuff added hediffs for cage/belt split genital blocking code into penis/vag blocking added ring gag(open), can do oral replaced gag with ball gag, cant do oral added blocking code for oral(blocks rim,cuni,fel,69) 3.1.1 reverted broken whoring 3.1.0 fixed humanlike baby birth faction warning enabled birthing in caravans moved postbirth humanlike baby code to sep method added above stuff to egg birthing (untested), egg humanlike babies should work like normal babies from humanlike pregnancy simplified Getting_loved jobdriver, hopefully nothing broken changed rjw patching to not completely fail if recipes/workbenches/rjw parts removed by other (medieval/fantasy) mods, there can still be errors with pawn generation but w/e slight edit cheat options descriptions fixed designators save/load issues menu for quirk adding, works at game start,hero,rjwdevmode disabled condom usage for non humans and pawns with impregnation fetish 3.0.2 enable sex need decrease while sleeping fixed ThinkAboutDiseases apply thought to wrong pawn set fertility/Reproduction priority to 199 fixed error when using condoms with animals 3.0.1 RatherNot: Pregnancy search fixed (caused pregnancy check to fail for every pregnancy but mechanoids) 3.0.0 changed CnP & BnC birth stories to non disabled child, since those mods dont fix their stories/cached disabled skills added baby state, no manipulation flag to BnC set babies skills to 0 merged rape roll_to_hit into sex_beatings patch for ThoughtDef HarmedMe so it wont trigger for masochists during rape or social fights added option to reduce rape beating to 0-1% added option to select colonist orientation when game starts added option to disable cp rape for colonists whore tab toggle, somewhat working fix? for would_fuck size_preference with has_penis_infertile aka tentacles fix for debug humanlike pregnancy birth RatherNot: Merge branch 'moddable_pregnancies' into 'Dev' Merge branch 'traits_generation_rework' into 'Dev' Merge branch 'trait_loop_fix' into 'Dev' 2.9.5 reverted loadingspeed up since in seems incompatible with some races fixed error with breeding on new (unnamed) colony fixed error with animal beating, since they have no skills 2.9.4 Mewtopian: Change RaceGroupDef to use lists of strings instead of lists of defs to avoid load order issues with adding custom parts the another mod defines. Also added some consistency checks and fixed chances logic. 2.9.3 updated condoms stuff for recent version fixed condoms defs errors, yes your can eat them now moved condoms getting to jobdriver that actually starts servicing set condoms getting to room where sex happens, potentially working for non whoring in future, maybe added some parts to vanilla animals small mod loading speed increase added maxquirks settings revert Boobitis text changes since it doesnt compile Mitt0: Add condoms for whoring Mewtopian: Merge branch 'TweakBoobitis' into 'Dev' Merge branch 'FixDoubleUdderIssue' Merge branch 'ReformQuirks' Change most fetish quirks to cause a fixed size positive attraction/satisfaction bump rather than subtle up and down tweaks. All quirks are the same commonality and everyone gets 1-5 of them. Added race based quirks (and tags to support them). Added thought for sex that triggers quirk. Changed quirk descriptions to use pawn names like traits do. 2.9.2 replaced faction check with hostility check in animal mating patch, so animals can mate everything that is not trying to kill them patch now always override vanilla mating added toggle to silence getting raped alerts added toggle to disable CPraped, breed alerts Merge branch 'Zombie_Striker/rjw-master' -typo fixes -Made it so non-violent pawns wont beat cp 2.9.1 disabled RaceGroupDef log spamm fixed ai error when trying to find corpse to fuck changed rape corpse alert to show name of corpse instead of Target fixed error when fucking corpse fix for futa animals mating, bonus - futa animal will mate everything that moves with wildmode on removed BadlyBroken check for got raped thoughts fix for DemonTentaclesPenis defname set chance to gain masochist trait when broken 100% => 5% changed begging for more thought to only work of masochists 2.9.0 added rape check for comfort designator, if rape disabled, pawn cant be marked for comfort added AddTrait_ toggles to settings patch to allow mating for wild animals (animal-on-animal toggle) change/update description of Enable animal-on-animal added dubs hygiene SatisfyThirst for cocooned pawns added debug whoring toggle RJW_wouldfuck show caravan/member money disabled colonist-colonist whoring race support for some rimworld races added isslime, isdemon tags for racegroups fix for RaceGroupDef filteredparts Merge branch 'ImproveRaceGroupDefFinding' into 'Dev' by Mewtopian Merge branch 'FixRapeEnemyNullPointer2' into 'Dev' by Mewtopian Merge branch 'FixMoreNymphStuff' into 'Dev' by Mewtopian 2.8.3 changed roll_to_skip logs to be under DebugLogJoinInBed option changed RJW_wouldfuck check to display prisoners, tamed/ wild animals split better infestation patch into separate file fixed custom races checks breaking pregnancy and who knows what else fix whore tab for factionless pawns(captured wild/spacers) -filter pawns by faction(colonist/non colonists) --filter pawns by name enable rjw widget for captured wild pawns and spacers? parts chance lists for races 2.8.2 added missing Mp synchronisers changed racegroupdefs removed race db/defs renamed specialstories xml to whorestories 2.8.1 cleanup whoring jobgiver changed designator description from Enable hookin' to Mark for whoring fix for whoring tab not showing prisoners split GetRelevantBodyPartRecord return in 2 rows so it easier to find out which .Single() causes error if any changed sorting of debug RJW WouldFuck to by name reenable curious nymphs backstories added age factor to sex need so it wont decrease below 50% if humanlike age below min sex age fix for hookup chance being reversed 2.8.0 whoring tab: -changed whoring tab to show all pawns -changed column descriptions -changed comfort prisoner column into prisoners/slaves -added experience column fix for designators, need to save game for them to update/fix removed ModSync, since it never worked and probably never will FeelingBroken: -changed FeelingBroken to apply to whole body instead of torso -FeelingBroken no longer applies to slimes -FeelingBroken applies to succubuses again, 400% harder to break than normal pawn -Broken stage adds nerves trait +8% MentalBreaks -Extremely broken stage adds nerves trait +15% MentalBreaks -changed Stages to broken body to Feeling broken, and removed "body" from stages -renamed Feeling broken classes to something sensible -added trait modifiers to speed of gain/recovery Feeling broken" --Tough trait gain twice slower and looses twice faster, Wimp - reverse --Nerves trait +200%, +150%, -150%, -200% added idol to whore backstories, removed Soldier, Street(wtf is that?) disabled add multipart recipes if there is no parts persent fixed rape thought amnesia? increased rape thought limit 5->300, set limit for same pawn to 3 increased stacklimit 1->10 of unhappy colonist whore thought added force override sexuality to Homosexual if pawn has Gay trait Mewtopian: Add boobitis, a mechanite plague that spreads through chest-to-chest contact and causes permanent breast growth if left untreated. changed the way races added into rjw, old patches will no longer work 2.7.3 changed trait gain only during appropriate sex, rapist => rape, zoo => bestiality, necro => necro Merge branch 'feature/brothel-tab' by Mitt0 fix for rape check 2.7.2 fixed error when trying to breed/rapecp and there no designators set 2.7.1 fixed beastilality error/disabled virginity 2.7.0 added designators storage, which should increase designator lookup by ~100 times, needs new game or manual designators resetting prevent demons, slimes and mechanoids from getting stds reduced maximum slider value of maxDistancetowalk to 5000, added check if it is less than 100 to use DistanceToSquared instead of pather, which should have less perfomance impact, but who knows is its even noticeable changed whoring and breeder helpers back to non static as it seems somehow contribute to lag disabled additional checks if pawn horny, etc in random rape, so if pawn gets that mental, it will actually do something fix for rape radius check error removed 60 cells radius for rape enemy disabled workgivers if direct control/hero off fix for ability to set more than 1 hero in mp update to widgets code, up to 6000% more fps renamed records yet another fix for virginity 2.6.4 changed IncreasedFertility/DecreasedFertility to apply to body, so it wont be removed by operation added patch for animal mating - instead of male gender - checks for penis disabled hooking for animals fixed 0 attraction/relations checks for hooking fix for virginity check fix for ovi not removing fertility, now both ovi remove it fix for breast growth/decrease defs AddBreastReduction by Mewtopian 2.6.3 added check to see if partner willing to fuck(since its consensual act) removed same bed requirement for consensual sex fixed direct control consensual sex condition check fixed direct control rape condition check fixed SocialCardUtilityPatch debugdata and extended/filtered with colonist/noncolonist/animals would_fuck check Merge branch 'debugData' into 'Dev', patch to SocialCardUtility to add some debug information for dev mode 2.6.2 fix for MultiAnus recipes 2.6.1 split cluster fuck of widget toggles into separate scripts fixed CP widget disabled widget box for non player/colony pawns added 50% chance futa "insect" to try fertilize eggs rather than always implanting 2.6.0 'AddBreastGrowthRecipes' by Mewtopian added trait requirement to CP/Bestiality description added toggle to disable hookups during work hours added adjustable target distance limiter for ai sex, based on pathing(pawns speed/terrain) cost, so pawns wont rush through whole map to fuck something, but will stay/check within (250 cost) ~20 cells, whoring and fapping capped at 100 cells added relationship and attraction filter for hookups(20, 50%), (0, 0% for nymphs) added debug override for cp/breed designators for cheaters added auto disable when animal-animal, bestiality disabled readded SexReassignment recipedef for other mods that are not updated fixed? error when trying to check relations of offmap partner fixed std's not (ever) working/applying, clean your rooms fixed animal designator error fixed warning for whoring RandomElement() spam changed necro, casual sex reservations from 1 to 6 changed aloneinbed checks to inbed to allow casual group sex(can only be initiated by player) some other changes you dont care about 2.5.1 fix error in Better Infestations xml patch, so it shouldnt dump error when mod not installed 2.5.0 overhauled egg pregnancies, old eggs and recipes were removed changed egging system from single race/patch/hardcode dependent to dynamic new system, rather than using predefined eggs for every race, generates generic egg that inherits properties of implanter and after being fertilized switches to fertilizer properties any pawn with female ovi can implant egg with characteristics of implanter race any pawn with male ovi can fertilize egg changing characteristics to ones of fertilizer race added settings to select implantation/fertilization mode - allow anyone/limit to same species added multiparent hive egg, so hivers can fertilize each other eggs regardless of above settings patch for better infestations to rape and egg victims changed insect birth to egg birth set demon parts tradeability to only sellable, so they shouldnt spawn at traders fix for ability to set multiple heros if 1st dies and get resurrected added hero ironman mode - one hero per save merged all repeating bondage stuff in abstract BondageBase added <isBad>false</isBad> tag to most hediffs so they dont get removed/healed by mech serums and who knows what moved contraceptive/aphrodisiac/humpshroom to separate /def/drugs changed humpshroom to foodtype, so it can be filtered from food pawn can eat added negative offset to humpshroom, so its less likely to be eaten added humpshroom to ingredients(no effect on food) changed rape enemy logic - animal will rape anyone they can, humans seek best victim(new: but will ignore targets that is already being raped) android compatibility: -no quirks for droids, always asexual orientation -no fert/infert quirk for androids -no fertility for (an)droids -no thoughts on sexchange for droids -sexuality reroll for androids when they go from genderless/asexual thing to depraved humanlike sexmachine -ability for androids to breed non android species with archotech genitals, outcome is non android 2.4.0 added new rjw parts class with multi part support, maybe in future sizes and some other stuff, needs new game or manually updating pawn healthtab rjw hediffs changed all surgery recipes, added recipes for multi part addition, only natural(red) parts can be added, parts cant be added if there is artificial part already added parts stacking toggle to debug settings added "penis", "pegdick", "tentacle" to has_multipenis check for double penetration sex fixed ability to add/remove parts to slimes, which should not be added blocks_anus condition to chastity belt, so pawn wont have sex at all, probably changed description CP rape -> comfort rape, so now fbi knocking you door chance is reduced by 0.01% improved virginity detection, now also checks for children relations added archotech_breasts to genital helper, maybe to be used in future added check of partner for vanilla lovin fix sex with partner ignoring would_fuck conditions disabled submit button for droids enabled drafting of droids in hero HC added toggles to disable fapping added sex filter for males and females - all/homo/nohomo 2.3.2 added thought GotRapedUnconscious fix vanilla animal pregnancy-> bestiality patch 2.3.1 fixed mark for breeding designator added disablers for servicing and milk designators when pawn is no longer colonist 2.3.0 added patch for nymphs to ignore "CheatedOnMe"(disabled by default) fixed necro patch ObservedRottingCorpse -> ObservedLayingRottingCorpse, which probably was not updated from B18? change to some bondage descriptions added hooking settings for: -visitors vs visitors -prisoner vs prisoner -reverse nymph homewreck(nymphs say no to sex, even if it bites them later) fixed bug that allowed setting multiple heroes re-enabled cum overlays, disabled add semen button in mp fixed overlays memory fill, overlays no longer has dif sizes, i think i've probably reduced cum amount disabled slimes cumming on themselves archo FertilityEnhancer, increases egg pregnancy gestation rate by 50% archo FertilityEnhancer, increases pregnancy gestation rate by 25% when archo FertilityEnhancer on, pawn age is ignored and fertility set to 100 reduced fertility bonus from increased fertility 50->25 reduced fertility bonus from archo fertility enhancer 60->25 added mp sync for bio - resexualization added mp sync for bio - archotech mode switch added "normal"(not ench and not blocked fertility) mode for archotech parts added sexuality change button for hero disabled slime parts change in mp fixed comfort and breeding designators stuck in "on" after releasing prisoner fixed? using xml race_filter, was applying breasts to males made installing flat chests to males not change them to traps 2.2.0 patch for pregnancy, less debug log spam futa / install part, exposed core operations cleaning fixed gizmo crash with hero HC reverted artificial parts from addedparts back to implants added hideBodyPartNames to remove part recipes added side scroll for basic and pregnancy settings randomtyping: Add mod settings to control hookups 2.1.2 randomtyping: Fix a crash in JoinInBed with offmap/dead lovers on nymphos. Add a mod option, disabled by default, to turn on spammy logging to help track down these issues. 2.1.1 fix for mating added option for bestiality to birth only humans or animals 2.1.0 added HaveSex workgiver to start sex with pawns in same bed fix for pregnancy checked/hacked state hardcore hero mode - disable controls for non hero pawns disable controls for non owned heros fix for implants to be counted toward transhumanist thoughts randomtyping: Pawns who don't have partners might hook up with other pawns who don't have partners. At least partners who are around right now... Nymphos no longer cheat on partners or homewreck. Pawns will consider AllPawns, not just FreeColonists, so that they can bang guests too. Haven't tested with prisoners but come on it's only like 98% likely to have a bug. Significantly increased the distance pawns will travel to find a hookup Added vanilla Got Some Lovin' thought to partners after casual sex Bug fix for xxx.HasNonPolyPartner() when neither RomanceDiversified or Psychology are active; it should have returned true when the pawn had any partner instead of false. vulnerability change to 3.5% per melee level instead of 5%. Don't add Got Some Lovin to whores while whoring. Add some limited casual sex mechanics and better hookups with partners! Give humpshroom addicts going through withdrawl a tiny amount of satisfaction so they aren't completely disabled. Make humpshroom grow in a reasonable amount of time, reduced price 2.0.9.2 fix for hero widget 2.0.9.1 disabled part removing patch, figure out someday how to add support to weird races, enjoy bleeding/frostbite mechanoids meanwhile 2.0.9 changed rand unity to verse slapped SyncMethod over everything rand added predictable seed, maybe figure out how it works someday rewrote widgets code(FML) desynced hero controls disabled hero controls for non owned hero disabled all workgivers for non owned hero disabled submit for non owned hero disabled all widgets when hero is imprisoned/enslaved disabled whoring in multiplayer, maybe fix it someday or not disabled mod settings in multiplayer disabled fix for stuck designators when prisoner join colony, refix someday later, maybe, clicking red designator should be enough to fix it disabled auto self cleaning(semen) for hero fix for insect pregnancy generating jelly at current map instead of mother's fix for recipe patcher, patch now works only for humanlikes and animals fix for gave virginity thought fix for error caused by factionless nymphs fix for miscarrying mechanoid pregnancies, no easy wayout added TookVirginity thought, maybe implement it some day, this year, maybe added parts remover for non humanlikes or animals, no more mechanoids frostbite? added patch for animal mating, remove vanilla pregnancy and apply rjw, maybe moved GetRapedAsComfortPrisoner record increase from any rape to rape cp only changed widget ForComfort description, added hero descriptions changed description of GetRapedAsComfortPrisoner record 2.0.8 fix for error when other mods remove Transhumanist trait fix for cum on body not being applied for futas disabled jobgivers for drafted pawns, so pawns should not try sexing while drafted renamed CumGenerator to CumFilthGenerator added girl cum/filth, maybe someday will have some use changed cum filth to spawn for penis wielders and girlcum for vagina, double mess for futas, yay!? slimes no longer generate cum filth cum on body no longer applied on receiving slimes, goes into their food need support for modsync version checking, probably broken, remove later? support for modmanager version checking 2.0.7 added ability to change slime parts at will(50% food need) for slime colonists/prisoners fixes for CnP/BnC changing gender of hero will result positive mood rather than random reduced FeelingBroken mood buff 40->20 2.0.6a fix for error when removing parts reduced SlimeGlob market value 500->1 2.0.6 multiplayer api, probably does nothing reorganized sources structure, moved overlays, pregnancy, bondage etc to mudules/ disabled semen overlays added operations support for all races, probably needs exclusion filters for mechanoids and stuff hidded restraints/cocoon operation if those hediffs not present removed needless/double operations from animals and humans fixed parts operation recipes changed sterilization -> sterilize rjw bodyparts can no longer be amputated 2.0.5b added toggle to select sexuality distribution: -RimJobWorld(default, configurable), -RationalRomance, -Psychology, -SYRIndividuality made slime organs not operable fix for egg pregnancies error changed egg birth faction inheritance: -hivers = no changes -human implanter+human fertilizer = implanter faction -human implanter+x = null(tamable) faction -animal implanter+ player fertilizer = null(tamable) faction -animal implanter+ non player fertilizer = implanter faction fixed VigorousQuirk description 2.0.5a fixes for sex settings descriptions disabled nymph think tree for non player colonists simplified? egg fertilization code changed pregnancy so if father is slime, baby will be slime disabled asexual orientation for nymphs(Rational romance can still roll asexual and stuff) renamed trait nymphomaniac => hypersexuality so it covers both genders 2.0.5 fix error for pawns not getting comps (MAI, RPP bots) fix for error when pawn tries to love downed animal fixed? non reversed interaction from passive bestiality fix error by egg considered fertilized when it isnt added kijin to cowgirl type pawn breast generation(excluding udders) changed animal pather so animal doesnt wait for pawn to reach bed changed nutrition increase from sex now requires oral sex and penis RimWorld of Magic: -succubus/warlock gain 10% mana from oral/vag/anal/dbl sex -succubus/warlock gain 25% rest, partner looses 25% rest -succubus immune to broken body debuff support for dubsbadhygiene -semen can be removed by washing - 1 at a time -all semen can be removing by using shower, bath, hottub -with dubsbadhygiene clean self workgiver disabled -oral sex increases DBH thirst need Zweifel merge (with my edits) -added slider to adjust semen on body amount (doesn't affect filth on ground) -increased base amount of semen per act, slowed down drying speed ~ 3 days -increased minimum size of overlays, so also smaller amounts should be visible now -fixed semen not being shown when pawn is sleeping -private parts semen is now also shown when pawn is positioned sideways 2.0.4 fixed abortion fix for cum error when having sex at age 0 changed pregnancy so slimes can only birth slimes changed(untested) egg pregnancy to birth implanter/queen faction for humanlikes, insect hive for insect hivers, non faction for other animals(spiders?) changed custom race genital support from pawn.kindDef.defName to pawn.kindDef.race.defName added filter/support for egging races(can implant eggs and fert them without ovis) support for nihal as egging test race added selffertilized property to eggs, implanted eggs will be fertilized by implanter 2.0.3 disabled non designated targets for breeders disabled rape beating for non human(animal) rapists changed male->futa operations jobstrings from Attaching to Adding added filters for featureless breast, no penis/vag/breast/anus excluded mechanoids for getting quirks some bondage compatibility stuff changed egging impregnation, so if insect can implant at least one egg it'll do so moved some settings from basic settings menu to debug, should not tear mod settings anymore... for now changed pregnancy detection, pregnancies now need check to determine what kind of pregnancy it is changed abortions so they cant be done until player do pregnancy check added operation to hack mechanoid, so it wont try to kill everyone once birthed changes to menu descriptions and new pregnancy description 2.0.2 added checks for infertile penis(aka tentacles and pegdick), so maybe slimes will rape and breed and stuff... or everything will be broken and rip the mod renamed cum options and descriptions, added option for cum overlays added item commonality of 0 to hololocks and keys, so maybe zombies wont drop them changed chains modifiers from -75% to 35% max removed relations: dom/sub/breeder changed insect restraints to cocoon, cocoon will tend and feed pawn mech pregnancy birth now destroys everything inside torso, failed to add blood ... oh well, we are family friendly game after all changed birthed ai from assault colony to defend ship, so it wont leave until everything is dead reduced births needed for incubator quirk to 100 2.0.1 bearlyAliveLL support for lost forest Zweifel bukkake addon ekss: Changes to bondage gear -allows hediff targeted to body parts -allows restriction of selected body part groups from melee actions, in combination with 0 manipulation restricts from using weapons too -changed harmony patch for on_remove function to allow bondage gear without hololock -changes to existing bondage items, their hediffs will be shown on relevant body parts -added one new gear for prisoners -PostLoadInit function to check and fix all bondage related hediffs to make everything save compatible (may be thrown out if too ugly, but all existing bondage gear will be needing re equipment) 2.0.0 after rape, victim that is in bed and cant move, should be put back to bed added parts override, so existing parts can be added to any race without messing with mod sources (will see how this ends) changed incubator/breeder descriptions replaced that mess of code for bestial dna inheritance with same as humanlikes (hopefully nothing broken) kids should always get father surname(if exist) changed litter size calculations, added parents fertility and breeder modifiers(this means that pawns now can actually birth twins and triplets when correctly "trained") breeder quirk now increases pregnancy speed by 125% (was 200%) gaining breeder quirk now also gives impregnation fetish gaining incubator quirk now also gives impregnation fetish hero can now mark them selves for cp, breeding, whoring fixed/changed requirement for zoophile trait gain to also account loving with animals(was only raping) increased glitter meds requirement for mech pregnancy abortion 1.9.9h fix self-impregnating mechanoids xD added recipe to "determine" mechanoid pregnancy added recipe to abort mechanoid pregnancy(uses glitter meds, i was told its sufficiently rare... idk maybe remove it later?) 1.9.9g added new mechanoid pregnancy instead of old microprocessor ones added insect birth on pawn death added mechanoid birth on pawn death maybe? added hive ai to born hostile insects added ai to birthed mechanoids, which will try to kill everyone... i mean give hugs... yes... added initialize() for pregnancy if started through "add hediff" options added days to birth info for pregnancy debug fix for loving 1.9.9f added designator icons, when pawn refuses to breed/comfort/service wip mechanoid pregnancy increased aphordisiac price 11->500 lotr compatibility? -set hololock techlevel to space -set whore beds techlevel to Medieval -set nymph techlevel to Tribal -set aphrodisiac techlevel to Medieval some other minor fixes 1.9.9e change to lovin patch which should allow other pregnancy mods(vanilla, cnp) to start pregnancy if rjw pregnancy disabled added lots of debug info for pregnancy_helper fixed pregnancy checks fix? vanilla pregnancy should now disappear if pawn lost vagina(used to be genitals) fixed error in designated breeder searching moved bestiality target searching to BreederHelper moved finding prisoners from xxx to CPRape jobgiver moved most whoring related stuff from xxx to whore_helper cosmetic changes to target finders, for readability disabled age modifiers for sex ability and sex drive, so your custom races dont need to wait few hundred years to get sex added "always show tag" for UID, Sterilization, peg arm operations made get_sex_drive() function to catch errors if pawn has no sex drive stat fixed? pawns having double vaginas or penises reduced parts sexability by around 2, so now it actually matters and sex wont always end with ahegao added missing? armbinder textures for male body 1.9.9d reverted age lock changed bond modifier for bestiality from flat +0.25 to +25% increase rape temp danger to Some, so rapes should happen even in uncomfortable temps reorder whore client filter, which should be a bit faster, probably fixed ability to set multiple hero, if other hero offmap fix error during sexuality reroll added translation strings for pregnancy and sex options/setting added options to turn on futa/trap fix males now cant be generated as futa and will be traps, was causing errors humpshrooms: -added pink glow -added +2 beauty modifier -increased price x2 -increased nutrition x2 fix/workaround for WTH mechanoids simplified surgeries, now only need to add modded races to SurgeryFlesh def added photoshop sources for designators updated glow effect on breeding icon, to be like other icons 1.9.9c fixed egg formula 1.9.9b removed fertility for pawns with ovis fixed aftersex satisfy error for fapping fixed error of calculation current insect eggs in belly fixed error when whores try to solicit non humans fixed error checking orientationless pawns(cleaning bots, etc) fixed Hediff_Submitting applying to torso instead of whole body during egg birth fixed mech pregnancy not impregnanting added chance to teleport in eggs during mech pregnancy overhauled insect eggs: changed egg pregnancy duration to bornTick=450,000*adult insect basesize*(1+1/3), in human language that means pregnancies will be shorter, mostly added abortTick = time to fertilize egg, if abortTick > bornTick - can always fertilize added eggsize 1 = 100%, if 0 eggsize - pawn can hold unlimited eggs eggs were reweighted according to hatchling size, in human language that means less eggs than random number it used to be, bigger movement debuffs and big eggs wont even fit in pawns without propper training and/or some operations detailed familiy planning calculations can be seen at rjw\Defs\HediffDefs\eggs.xlsx 1.9.9a added wip feeding-healing cocoon to replace restrains for insects, somehow its broken, fix it someday later, maybe fixed necro errors disabled nutrition transfer for necro moved "broken body" stuff from CP to all rape nerfed Archotech parts sexability to slightly above average support for insects from Alpha Animals 1.9.9 [FIX] reversed conditions for breed designators [FIX] sex initiated by female vs insect, werent egging female [CORE] split ovi's form penis infertile category, now has own [FEATURE] added ovi install operation [FEATURE] non insects with ovi's will implant Megascarab eggs, cant fertilize eggs [FEATURE] eggs implanted by colonist has additional 25 * PsychicSensitivity chance to spawn neutral insect [FEATURE] neutral eggs implanted by colonist has 50 * PsychicSensitivity chance to spawn tamed insect [FEATURE] added "hero" mode, player can directly command pawn 1.9.8b [FIX] designators should refresh/fix them selves if pawn cant be designated(loss of genitals, prisoner join colony, etc) [FIX] mechanoid "pregnancy" parent defs [COMPATIBILITY] suggested support for egg pregnancy for Docile Hive, havent tested that one 1.9.8a [FIX] fixed missing interaction icon for bestiality 1.9.8 [FEATURE] removed workgiver rape comfort prisoners [CORE] removed designators: ComfortPrisoner, RJW_ForBreeding [CORE] moved many bestiality checks to xxx.would_fuck_animal [CORE] moved FindFapLocation from job quick fap driver to giver [CORE] merged postbirth effects from human/beast pregnancies in base pregnancy [FIX] bugs in postbirth() [FIX] reversed dna inheritance [FIX] possible error with debug/vanilla birthing from bonded animal [FIX] rape enemy job checks, mechanoids can rape again [FIX] mechanoid sex rulepack error [FIX] typo fix "resentful" as "recentful" [FIX] comfortprisonerrape, should now call breeding job if comfort target is animal [FIX] drafting pawn should interrupt w/e sex they are doing [FIX] errors with bestiality birthing train [FIX] errors with bestiality/human thoughts [FIX] for other mods(psychology etc) fail to initialize pawns and crash game [FIX] forced reroll sexuality, hopefully fixes kinsley scale with psychology [BALANCE] Renamed free sex to age of consent. [FEATURE] moved animal breeder designator in place of whoring [FEATURE] made animal breeding icon/ designator [FEATURE] added direct control mode for most sex actions(pawn may refuse to do things), non violent pawns cant rape 1.9.7c Zaltys: [CORE] Renamed NymphJoininBed to JoininBed. [FIX] Fixed futa settings. [FEATURE] Expanded JoininBed job so that normal pawns can join their lover/spouse/fiancee in bed (but joining a random bed is still limited to nymphs). Ed86: fixed pawns fapping during fight or being drafted fixed noheart icon error in logs 1.9.7b fix for futa chances 1.9.7a Zaltys: [FIX] Corrected the trait checking for Vigorous quirk. [FIX] Compatibility fix for androids when using an old save (unable to test this in practice, leave feedback if it still doesn't work). [FIX] Fixed a major compatibility bug when using Psychology with RJW. [FIX] Sapiosexual quirk fix for players who aren't using Consolidated Traits mod. [COMPATIBILITY] Pawn sexuality is synced with other mods during character generation if the player is using Psychology or Individuality. (Instead of the old method of syncing it when the game starts.) 1.9.7 Settings and fixes Skömer: [FEATURE] Archotech parts (penis, vagina, breasts, anus). DegenerateMuffalo: [COMPATIBILITY] Compatibility with "Babies and Children" mod, hopefully with "CnP" as well. Fixes CnP bug with arrested kids Zaltys: [CORE] Moved Datastore to PawnData, since that's the only place it is used. [CORE] New method in PregnancyHelper for checking whether impregnation is possible. [CORE] Replaced Mod_Settings with RJWSettings. [FIX] Fixed Breed job. [FIX] Whores no longer offer services to prisoners from other factions. [FIX] Added a check to whoring to make sure that the client can reach the bed. (Thanks for DegenerateMuffalo for pointing out these problems.) [FIX] Added same check for bestiality-in-bed, which should fix the error if the animal is zone-restricted. [FIX] ChancePerHour_RapeCP incorrectly counted animal rape twice. (Credit to DegenerateMuffalo again.) [FIX] Polyamory fix for JobGiver_NymphJoininBed. Also added some randomness, so that the nymph doesn't repeatedly target the same lover (in case of multiple lovers). [FIX] Fixed NymphJoininBed not triggering if the nymph is already in the same bed with the target (which is often the case with spouses). [FEATURE] New less cluttered settings windows, with sliders where applicable. [FEATURE] Pawn sexuality. Imported from Rational Romance, Psychology, or Individuality if those are in use. Otherwise rolled randomly by RJW. Can be viewed from the RJW infocard (Bio-tab). [FEATURE] New settings for enabling STDs, rape, cum, and RJW-specific sounds. Also included settings for clothing preferences during sex, rape alert sounds, fertility age, and sexuality spread (if not using RR/Psychology/Individuality). [FEATURE] Added a re-roller for pawn sexuality, accessible from the info card. If the sexuality is inherited from another mod, this only re-rolls the quirks. Only available during pawn generation, unless you're playing in developer mode. [FEATURE] Added new optional setting to enable complex calculation of interspecies impregnation. Species of similar body type and size have high chance of impregnation, while vastly different species are close to zero. [FEATURE] Added fertility toggle for archotech penis/vagina, accessible from the infocard (through bio-tab). [FEATURE] New random quirk: Vigorous. Lowers tiredness from sex and reduces minimum time between lovin', not available to pawns with Sickly trait. Animals can also have this quirk. Ed86: added armbinders and chastity belts wearable textures, moved textures to apropriate folders *no idea how to add gags and not conflict with hairs hats and stuff, and i have little interest in wasting half day on that, so they stay invisible added quality to bdsm gear changed crafting recipes and prices(~/2) of bdsm gear, can now use steel, sliver, gold, plasteel for metal parts and hightech textiles/human/plain leather for crafting bdsm gear now has colors based on what its made of increase armbinder flamability 0.3->0.5 [bug?] game generates gear ignoring recipe, so bdsm gear most likely need own custom stuff category filters and harmony patching, not sure if its worth effort Designators changes: -masochists can be designated for comforting -zoophiles can be designated for breeding -or wildmode fixed ignoring age and other conditions for sex under certain settings fixed submitting pawn, "submitting" hediff ends and pawn can run away breaking sex, so when pawn is "submitting", hediff will be reaplied each time new pawns rapes it added missing Archotech vagina for male->futa operation fixed above commits checks, that disabled mechanoid sex fixed that mess of pregnancy above fix for broken settings and auto disable animal rape cp if bestiality disabled 1.9.6b Zaltys: [CORE] Renamed the bestiality setting for clarity. [FIX] Re-enabled animal-on-animal. [FIX] Animals can now actually rape comfort prisoners, if that setting is enabled. The range is limited to what that they can see, animals don't seek out targets like the humanlikes do. (My bad, I did all of the job testing with the console, and forgot to add it to the think trees.) [COMPATIBILITY] Fixed the Enslaved check for Simple Slavery. Ed86: [CORE] Renamed the bestiality setting for clarity. fixed broken jobdriver 1.9.6a fix for pregnancy 1.9.6 Zaltys: [CORE] Added manifest for Mod Manager. [CORE] Added more support for the sexuality tracker. [CORE] Moved some things to new SexUtility class, xxx was getting too cluttered. [CORE] Added a new method for scaling alien age to human age. This makes it easier to fix races that have broken lifespans in their racedefs. [FIX] Pawn sexuality icon was overlapping the icon from Individuality mod during pawn generation. Moved it a bit. Please leave feedback if it still overlaps with mod-added stuff. [FIX] Enabled whore price checking during pawn generation. [FIX] Female masturbation wasn't generating fluids. [FIX] Clarified some of the setting tooltip texts. [FIX] Added text fixes to fellatio, for species that have a beak.. [BALANCE] Permanent disfiguring injuries (such as scars) lower the whore price. [BALANCE] Rapist trait gain now occurs slightly slower on average. [FEATURE] Pawns now have a chance of cleaning up after themselves when they've done masturbating. Affected by traits: higher probability for Industrious/Hard Worker, lower for Lazy/Slothful/Depressive. Pawns who are incapable of Cleaning never do it. Also added the same cleaning check for whoring (some whores will clean after the customer, some expect others to do it.) [FEATURE] Added a few pawn-specific quirks such as foot fetish, increased fertility, teratophilia (attraction to monsters/disfigured), and endytophilia (clothed sex). Quirks have minor effects, and cover fetishes and paraphilias that don't have large enough impact on the gameplay to be implemented as actual traits. You can check if your pawns have any quirks by using the new icon in the Bio-tab, the effects are listed in the tooltip. Some quirks are also available to animals. [FEATURE] Added glow to the icon, which shows up if the pawn has quirks. For convenience, so you can tell at a glance when rerolling and checking enemies. (Current icons are placeholders, but work well enough for now.) [FEATURE] Added a new job that allows pawns to find a secluded spot for a quick fap if frustrated. (...or not so secluded if they have the Exhibitionist quirk). The job is available to everyone, including visitors and even idle enemies. This should allow most pawns to keep frustration in check while away from home, etc. [COMPATIBILITY] Rimworld of Magic - shapeshifted/polymorphed pawns should now be able to have sex soon after transformation. [COMPATIBILITY] Added conditionals to the trait patches, they should now work with mods that alter traits. [COMPATIBILITY] Lord of the Rims: The Third Age - genitalia are working now, but the mod removes other defs that RJW needs and may not be fully compatible. Note: Requires new save. Sorry about that. The good news is that the groundwork is largely done, so this shouldn't happen again anytime soon. Ed86: disabled ability to set designators for comfortprisoner raping and bestiality for colonists and animals comfort raping and bestiality designators can be turned on for prisoners and slaves from simple slavery nymphs will consider sexing with their partner(if they have one) before going on everyone else added options to spawn futa nymphs, natives, spacers added option to spawn genderless pawns as futas changed descriptions to dna inheritance changed all that pos code from patch pregnancy, to use either rjw pregnancies or vanilla shit code added animal-animal pregnancies(handled through rjw bestiality) added filter, so you shouldnt get notifications about non player faction pregnancies added Restraints(no one has suppiled decent name) hediff, insects will restrain non same faction pawn after egging them, easily removed with any medicine changed incubator to quirk, incubator naw affect only egg pregnancy added breeder quirk - same as incubator but for non eggs, needs only 10 births for humans or 20 for animals v1.9.5b fix for hemipenis and croc operations Zaltys: [CORE] More sprite positioning work. sexTick can be called with enablerotation: false to disable the default 'face each other' position. [CORE] Figured out a simple way to hide pawn clothing during sex, without any chance of it being lost. Added parameters to the sexTick method to determine if the pawn/partner should be drawn nude, though at the moment everything defaults to nude. If a job breaks, may result in the pawn getting stuck nude for a short while, until the game refreshes clothing. [BALANCE] Added age modifier for whore prices. [FEATURE] Added a new info card for RJW-related stats. Accessible from the new icon in the Bio tab. Very bare-bones at the moment, the only thing it shows for now is the price range for whoring. Will be expanded in later updates. v1.9.5a fix for pregnancy error mod menu rearangement fix? for hololock crafting with CE "ComplexFurniture" research requirement for for whore beds v1.9.5 Fix for mechanoid 'rape' and implanting. [FIX] Corpse violation was overloading to the wrong method in some cases, causing errors. Fixed. [FIX] Nymphomaniac trait was factored multiple times for sex need. Removed the duplicate, adjusted sex drive increase from the trait itself to compensate. [FIX] Other modifications to the sex need calculations. Age was factored in twice. [CORE] Added basic positioning code to JobDriver_GettinRaped. Pawns should now usually have sex face-to-face or from behind, instead of in completely random position. [BALANCE] Made necrophilia much rarer for pawns without the trait. [BALANCE] Made zoophilia rarer for pawns without the trait, and made non-zoos pickier about the targets (unless frustrated). [BALANCE] Adjusted the whore prices. Males were getting paid far less, made it more even. Added more trait adjustments. As before, Greedy/Beautiful pawns still get the best prices, and the bedroom quality (and privacy) affects the price a lot. [BALANCE] Soliciting for customers now slightly increases Social XP. [BALANCE] Higher Social skill slightly improves the chance of successful solicitation. [BALANCE] Sexually frustrated customers are more likely to accept. [FEATURE] Converted the old whore beds into regular furniture (since whores can use any bed nowadays), for more furniture variety. The old luxury whore bed is now a slightly less expensive version of a royal bed, and the whore sleeping spot is now an improved version that's between a sleeping spot and the normal low-tier bed in effectiveness: quick and cheap to build. Better than sleeping on floor and useful in early game, but you probably want to upgrade to regular bed as soon as possible. Descriptions and names may need further work. [FEATURE] Added 69 as a new sex type. Cannot result in pregnancy, obviously. Frequency modifiable in settings, as usual. v1.9.4c insect eggs kill off other pregnancies pawns cant get pregnancies while having eggs fix for non futa female rapin vulrability check added 1h cooldown heddif to enemy rapist, so job wont dump errors and freeze pawn/game added a bunch of animal and insect checks, so rape enemy shouldnt trigger if those options disabled made/separated enemyrapeByhumanlikes, like other classes v1.9.4b fix for rape enemy, so it wont rape while enemies around v1.9.4a fix for rape enemy not raping v1.9.4 Zaltys: [FIX] Extended the list of jobs that can be interrupted by whores, this should make whores considerably more active. [FIX] Animals with non-standard life-stages were not considered valid targets for various jobs. Fixed by adding a check for lifestage reproductiveness. [FIX] Engaging in lovin' with partners that have minimal sex ability (such as corpses) could result in the pawn getting no satisfaction at all, causing them to be permanently stuck at frustrated. Fixed by adding a minimum. (Humpshroom addiction can still result in zero satisfaction.) [BALANCE] Made pawns less likely to engage in necrophilia when sated. [BALANCE] Added vulnerability modifiers to a few core traits (Wimp, Tough, Masochist,..) [FEATURE] Added crocodilian penis for some animal species. (Alligator, crocodile, quinkana, sarcosuchus, etc) [CORE] Consolidated common sex checks into a single thinknode (ThinkNode_ConditionalSexChecks), which makes it easier to include/update important checks for various jobs. [CORE] Removed dummy privates, wrote a new comp for automatically adding genitalia when the pawn is spawned. Far faster than the old method of doing it. Should be compatible with old saves, though some weirdness may occur. [CORE] Added a basic but functional sexuality tracker (similar to Kinsey scale) to the above comp. Currently hidden from players and not actually used in calculations, just included as a proof of concept. [FIX] Added some null checks. [FIX] Removed a bad check from CP rape, should now work at intended frequency. [FIX] Some thinktree fixes for pawns that don't need to eat. [BALANCE] Made pawns less likely to engage in zoophilia if they have a partner. Unless the partner is an animal (there's mods for that). [BALANCE] Made pawns slightly less likely to engage in necrophilia if they have a partner. Ed86: raping broken prisoner reduces its resistance to recruit attempts fixed fertility wrong end age curve fixed pregnancies for new parts comp added futa and parents support for vanila/debug preg v1.9.3 Zaltys: [FIX] Rewrote the code for sexual talk topics. [FIX] Whorin' wasn't triggering properly. [FIX] Other miscellaneous fixes to the whorin' checks. They should now properly give freebies to colonists that they like. [FIX] Fixed forced handjob text. [FIX] Removed unnecessary can_be_fucked check from whores. With the new sex system, there's always something that a whore can do, such as handjobs or oral. [FIX] Restored RandomRape job. Only used by pawns with Rapist trait. Trigger frequency might need tuning. [FIX] Alien races were using human lifespan when determining sex frequency. Scaled it to their actual lifespan. [FIX] Enabled determine pregnancy for futas and aliens with non-standard life stages. [FIX] Patched in animal recipes. Sterlization and such should now work for most mod-added animals. [FIX] Animal-on-animal should no longer target animals outside of allowed zones. [CORE] Cleaned up some of the old unused configs and old redundant code. Still much left to do. [BALANCE] Adjusted bestiality chances. Pawns with no prior experience in bestiality are less likely to engage in it for the first time. And pawns who lack the Zoophile trait will attempt to find other outlets first. [BALANCE] Same for necrophilia: pawns are far less likely to engage in necrophilia for the first time. [BALANCE] Males are less likely to rim or fist during straight sex. [BALANCE] Adjusted trait effects on CP rape. Bloodlust trait now only affects frequency if rape beating is enabled. Removed the gender factor which made females rape less, now it depends on traits. [BALANCE] Pawns are more likely to fap if they're alone. [FEATURE] Added new settings that allow visitors and animals to rape comfort prisoners if enabled. [FEATURE] Added a sex drive stat (in Social category), which affects how quickly the sex need decays. Among other things, this means that old pawns no longer get as easily frustrated by lack of sex. Some traits affect sex drive: Nymphomaniac raises it, Ascetic and Prude (from Psychology) lower it. [FEATURE] If a pawn is trying to rape a relative, it's now mentioned in the alert. Ed86: fixes for nymph generation added ability to set chance to spawn male nymphs moved fertility and pregnancy filter to xml, like with sexneeds clean up "whore" backstories set Incubator commonality to 0.001 so it wont throw errors add vagina operations for males -> futa fixes for rape CP, breeder helper v1.9.2 Zaltys: Fixed a bug in baby generation which allowed animals to get a hediff meant for human babies. Also clarified the hediff name, since 'child not working' could be mistaken as an error. Improved logging for forced handjobs. Fixed necrophilia error from trying to violate corpses that don't rot (mechanoids, weird mod-added creatures such as summons, etc). Disallowed female zoos from taking wild animals to bed, because letting them inside the base can be problematic (and most can't get past doors anyway). Fixed incorrect colonist-on-animal thoughts. Whores now try to refrain from random fappin' (so they can spend more time servicing visitors/colonists), unless they're sexually frustrated. Added a pregnancy filter for races that cannot get pregnant (undead, etc). ' Colonists with Kind trait are less likely to rape. Added trait inheritance for [SYR] Individuality and Westerado traits. Added fail reasons to targeted Comfort Prisoner rape (on right-click); it has so many checks that it was often unclear why it wouldn't work.Added udders for animals (where appropriate, such as cows and muffalos), and a 'featureless chest' type for non-mammalian humanoids. Removed breasts from various non-mammalian animals, mostly reptiles and avians. Checked most of the common mods, but probably missed some animals. If you spot any species that have mammaries when they shouldn't, report them in the thread so they can be fixed. v1.9.1 Zaltys: Rewrote the processSex functionality, which fixes several old bugs (no more oral-only) and allows for much wider variety of sex. Merged animals into the same function. Some of the messages might have the initiator and receiver mixed up, please leave feedback if you notice any oddness. Centralized the ticks-to-next-lovin' increase and satisfy into afterSex, to ensure that those aren't skipped. Changed Comfort Prisoner Rape from Wardening to BasicWorker. Because it being in Wardening meant that pawns incapable of Social could never do it. Added support for Alien Humanoid Framework 2.0 traits. Xenophobes are less attracted to alien species, and xenophiles less attracted to their own species. Made zoophiles less attracted to humanlikes, and reluctant to pay for humanoid whores. Added basic age scaling for non-human races with long lifespans, when determining attraction. Enabled cum splatter from solo acts. Lowered cleaning time for cum to balance the increased output. Added new thoughts for BestialityForFemale job, for the rare cases where the female lacks the zoophile trait. Non-zoos almost never do that job, but it can happen if they have no other outlets. Previously this counted as 'raped by animal' and massive mood loss, even though initiated by the colonist. Set the min-ticks-to-next-lovin' counter lower for insects on generation. Whores lacked a tick check and could instantly jump from one job to another. Forced them to recover a bit between jobs, but not as long as regular pawns. Also changed the sex type balance for whoring: handjobs and fellatio are more common in whoring than in other job types. Lesbian sex lacked variety. Added fingering and scissoring to the available sex types. Added mutual masturbation and fisting. Added settings for sex type frequency, so you can lower the frequency of ones you don't want to see. Lowering the vanilla sex (vaginal and anal) is not recommended, makes things go weird. Added interspecies animal-on-animal breeding. Setting disabled by default. Added setting for necrophilia, disabled by default. Disabled the 'observed corpse' debuff for necros. Text fixes for logging. Added text variation to make some types clearer. Ed86: removed get_sex_ability from animals check, since they dont have it(always 100%) fixed error when trying to sexualize dead pawn changed demonic and slime parts description, so they tell that they are useless for humans, for now added missing craft hydraulic penis recipe to machining bench crafting hydraulics now requires Prosthetics research, Bionics - Bionics moved bionic crafting to fabrication bench fixed game spawning male nymphs broken nymphs, spawn with broken body reduced nymph spawn age 20->18 reduced festive nymph shooting increased festive nymph melee added chance to spawn festive nymph with rapist trait v1.9.0c Zaltys: Patched in nearly hundred sexual conversation topics. Currently set as rare, so pawns don't talk about sex all the day. Small fix that should stop babies from inheriting conflicting trait combos. Disabled the 'allowed me to get raped' thoughts for animal-on-female if the target is a zoophile. Didn't seem right that they'd hate the bystanders, despite getting a mood bonus from it. Fixed a stupid mistake in the trait inheritance checking. Didn't break anything, but it certainly didn't work either. Fixed the whoring target selection and spam. Ed86: switched Genital_Helper to public class crawls under christmas tree with bottle of vodka and salad, waiting for presents v1.9.0b Zaltys: Reset the ticks at sexualization, so generated pawns (esp. animals) don't always start lovin' as their first action. Couple of fixes to memories/thoughts, those could generate rare errors on female-on-animal. Also required for any animal-on-animal that might get added later. Added a simpler way of checking if an another mod is loaded. Works regardless of load order. Renamed abstract bases to avoid overwriting vanilla ones, to fix some mod conflicts if RJW is not loaded last. (Loading it last is still advisable, but not everyone pays attention to that..) v1.9.0a preg fix v1.9.0 Zaltys: Fixed the motes for bestiality. Which also fixes the 'wild animals don't always consent'-functionality. Added functions for checking prude and lecher traits (from other mods). Added patches for some conflicting traits (no more prude or asexual nymphos, etc). Added couple of low-impact thoughts for whoring attempts. Used the thoughts to make sure that a whore doesn't constantly bother same visitors or colonists. Enabled hook up attempts for prisoners, since they already have thoughttree for that. Most likely to try to target other prisoners or warden, whoever is around. Refactored JobGiver_Bestiality: removed redundant code and improved speed. Also improved target picking further, and made it so that drunk or high colonists may make unwise choices when picking targets. Added hemipenis (for snakes and various reptiles). Might add multi-penetration support for those at some later date. Ed86: fix traps considered females after surgery fix error preventing animal rape pawns fix error when trying to sexualize dead pawns added support for generic rim insects, mechanoids, androids added Masturbation, DoublePenetration, Boobjob, Handjob, Footjob types of sex added thoughts for incubator (empty/full/eggs), should implement them someday moved process_breeding to xxx merged necro aftersex with aftersex merged aftersex with process sex/bestiality, so now outcome of sex is what you see on log/social tab impregnation happens after vaginal/doublepenetration sex renamed JobDriver_Bestiality to JobDriver_BestialityForMale added check for futa animals when breeding breeding by animal increases broken body value breeding and bestiality for female with bounded animal is counted as non rape zoophile trait gain check now includes rapes of/by animals and insects countffsexwith... now includes rapes description changes for records Egg pregnancy: added contractions for eggs birthing(dirty hack using submit hediff) eggs now stay inside for full duration, if not fertilized -> dead eggs born abortion period now functions as fertilization period i think ive changed message when eggs born, should be less annoying some code cleaning not sure if any of below works nymphos and psychopaths(maybe other pawns in future) can now(probably) violate fresh corpses psychopaths should gain positive thought for violating corpse think nodes: enabled frustrated condition, used by nymphs added descriptions for think nodes think trees: exchanged priorities for prisoner whoring/rapecp moved breed from zoophile tree to animal when nymph is frustrated, it may violate corpse or random rape v1.8.9a fix for pregnancy if cnp not installed re-enabled patch for vanila preg, just in case added pregnancy detection based on body type/gestation time -> thin - 25%, female - 35%, others 50% v1.8.9 some WIP stuff added sex/rape records with humanlikes fix for sex records, so all sex should be accounted(fapping not included), and correctly distribute traits fix for error when trying to sexualize hon humans fixed error for birthing when father no longer exist fixed existing insect egg check always returning 0 disabled cnp option and pregnancy support added cleanup for vanilla pregnancy borrowed some code from cnp: should give cnp birth thoughts if cnp installed, drop babies next to mother bed, drown room in birth fluids added reduce pawn Rest need during sex: double speed for passive pawns, triple for active pawn disable increase loving ticks on job fail added need sex check for jobs, so pawns should seek satisfaction when in need some pathing checks for jobs try to normalize human fertility, 100% at 18(was 23), not sure about mod races, but fuck them with their stupid ages, maybe add toggle in next version? asexual check for sex_need so it doesn't decrease for pawns not interested in sex v1.8.8 Zaltys: Removed the tick increase from failed job, since that stops nymphs from seeking other activities. Changed the age scaling, to account for modded races with non-human lifespans. Rewrote fertility to work for modded races/animals of any lifespan. No fapping while in cryosleep. Adjusted distance checks. Added motes. Colonists were unable to open doors, fixed. Animals were unable to pass doors, fixed. Extra check to make sure that everyone is sexualized. Added traits from Consolidated Traits mod Added alert for failed attempt at bestiality. Wild animals may flee or attack when bothered Fix to enable some pawns to have sex again. Wild animals may flee from zoo + bug fix for zone restrictions Merged tame and bonded animals into one check, added distance and size checks to partner selection Added check to ensure that nymph can move to target Added check to make breeding fail if target is unreachable Minor balancing, drunk colonists now less picky when trying to get laid Ed86: rjw pregnancies: children are now sexualized at birth there is 25% per futa parent to birth futa child cross-breeding: there is a 10% chance child will inherit mother genitals there is a 10% chance child will inherit father genitals anuses are now always added, even if pawn is genderless, everyone has to poop right? disabled "mechanoid" genitals, so those roombas shouldnt spawn with hydraulic dicks n stuff added humanoid check for hydraulic and bionic parts fixed aphrodisiac effect from smokeleaf to humpshroom added egg removal recipes for ROMA_Spiders changed whore serving colonist chance 75%->50% and added check for colonist sex need, should reduce them harrasing 1 colonist and tend to those in need breaking pawns removes negative "raped" effects/relations pawn becoming zoophile removes negative zoo effects added LOS check for "allowed me to get raped", so no more seeing through walls disabled stripping during rape, probably needs fixing for weather and some races renamed fappin' to masturbatin' v1.8.7_ed86 Zaltys: added racoon penis added some Psychology support some fixes Ed86: fixed reversed records of insect/animal sex added records for birthing humans/animals/insects added incubator trait - doubles preg speed, awarded after 1000 egg births set limit impantable to eggs - 100/200 for incubator birthing insect spawns insect 1-3 jelly, in incubator *2 v1.8.6_ed86 added OrganicAgeless for race/genital patch added queen/implanter property to eggs, if its player faction +25% chance to birth tamed insects filter for Psychology traits fixed breeding detection for some(all?) animals log/social interaction for core loving fix for syphilis kidney fix for loving fix for humpshroom addiction error fix for menu translation error v1.8.5_ed86 added menu options for rjw pregnancies renamed sexhelper->genderhelper moved pregnancy related stuff to separate folder moved pregnancy related stuff to PregnancyHelper moved fertility options to mod menu separated pregnancy in 2 classes human/bestial added father debug string to rjw pregnancies some other fixes for pregnancies added single name handler, so now all naming handled through single function, which should prevent this mess scripts from crashing with red errors support for Rim of Madness - Arachnophobia made insect pregnancy more configurable, you can edit egg count and hatch time in Hediffs_EnemyImplants def, or add your own stuff for other custom insects increased eggs implants to 10-30 depending on insect, increased eggs moving penalty based on insect size up to -3% per egg added messages for insect birthing changed chance of generating tamable insect: -if father is in insect faction -5% -if not insect faction 10% -if player faction 25% removed outdated korean removed trait limit for birthed pawns renamed bodypart chest -> breasts renamed "normal" parts to average bondage sprites by Bucky(to be impemented later) added Aphrodisiac made from humpshrooms(seems to cause error when ends) fixed for animals with bionic parts fixed for sex need calculation fixes for zoophiliacs initiating sex fixed std error caused by generating broken pawns during world generation v1.8.4_ed86 CombatExtended patch - no longer undress rape victim and crash with red error rprobable fix for scenarios randomly adding bondage hediffs at game start without actual bondage gear fix for CP animal raping fixed badly broken function so now it works broken pawns now gain masochist trait and loose rapist if they had one enamed parts cat->feline, dogs->canine, horses->equine removed debuffs for broken body, other than Consciousness Pregnancy stuff: overhaul of impregnate function to handle all pregnancies bestial pregnancy birth adds Tameness fixes for insect egg pregnancy added ability to set female insects as breeders so they can implant eggs insects sexualized at birth insects has 10% to have null faction instead of fathers "Insect", so now you can grow own hive and not get eaten, probably added 1% penalty to Moving per egg increased eggs implanted 1-2 -> 5-10 Aftersex pawn now gains: - rapist trait if it had 10+ sex and 10% is rape and its not a masochist - zoophile trait if it had 10+ sex and 50+% with animals - necrophile trait if it had 10+ sex and 50+% with dead HumpShroom overhaul: - HumpShroom now behave like shrooms, grow in dark for 40 days, can be grown in Hydroponics (not sure it game spawns them in caves) - fertility sensetivity reduced 100%->25% - Yield reduced 3->2 - addictiveness raised 1%->5% - fixed addiction giving ambrosia effect - addiction adds nympho trait - addiction no longer raises sexneed by 50 - addiction reduces sexneed tick by 50% - Induced libido increases sexneed tick by 300% - addiction w/o Induced libido adds no satisfaction or joy v1.8.3_ed86 fertility fix for custom races with weir life stages(its now not 0) fixed translation warnings for vb project fixed? generic genitals applied to droids changed faction of babies born by prisoners to null, seems previous fix was for normal pregnancy birthing and this one for rjw? Designations retex by SlicedBread v1.8.2_ed86 added operation to determine pregnancy by Ziehn fixed some obsolete translation warnings for 1.0, many more to fix fixed error when trying to remove bondage gear pawns can now equip bondage on downed/prostrating pawns instead of prisoners only pawns can now unequip bondage from other pawns(if there is a key) fixed? getting pregnant when chance is set to 0(maybe it wasnt broken but testing with 1/100 chance is...) added Torso tag for genitals/breasts/anuses, so they should be protected by armor now, probably reduced chance to hit genitals 2%->.5% reduced chance to hit anus 1%->.1% reduced parts frostbite vulrability 1%->.1% rework ChjDroid - Androids parts assigment: -droids have no parts -androids have parts based on backstories --social droids get hydraulics --sex and idol droids get bionics --substitute droids get normal parts like other humanlikes --other get nothing added more modded races support for genitals by Cypress added filters to block fertility and sex need if pawn has no genitals added sex needs filter xml, to filter out races that should have no sex needs (ChjDroidColonist,ChjBattleDroidColonist,TM_Undead), you can add your own races there changed fertility, sex need calculation based on life stages: -humanlikes(5 life stages) - start rising at Teen stage -animals(3 life stages) - start rising at Juvenile stage -modded stuff(1 life stage) - start at 0 -modded stuff(x life stages) - start rising at 13 yo *ideally modded stuff should be implemented through xml filter with set teen and adult ages, but i have no idea how or want to go through dozens modded races adding support v1.8.1_ed86 possible fix for possible error with pawn posture? fixed social interactions broken with "many fixed bugs" of rimworld 1.0 fixed? babies born belong to mother faction or none if mother is a prisoner, no more kids/mother killing, unless you really want to removed all(broken) translations, so far 1.0 only support english and korean added peg arms, now all your subjects can be quad pegged... for science! added options to change fertility drops to _config.xml, should be moved to mod menu once unstable version menu is fixed v1.8.0_ed86_1.0 nothing new or old or whatever v1.8.0_ed86_B19 fixed prisoner surgeries fixed animal/combat rape fixed necro rape fixed missing surgery recipes for stuff added in prev version v1.7.0_ed86_B19_testing9 limited "allowed_me_to_get_raped" social debuff range to 15 instead whole map, its also doesnt apply if "bystander" is downed and cannot help added cat/dog/horse/dragon -> tight/loose/gape/gape vaginas added "generic" body parts for unsupported pawns/animals?/ rather than using normal human ones added micro vaginas,anuses added flat breasts added gaping vaginas,anuses added slime globs for, maybe, in future, changing slime pawns genitals fixed bionic futa creation other fixes to bionic penis changed/fixed vulrability calculation -> downed/lying down/sleeping/resting or pawns with armbinder no longer contribute melee stat to vulrability reduction, this allows pawns with high stats to be raped, so close your doors at night fixed? failed futa operations, instead of adding penis and loosing vagina, pawn keeps vagina rearanged pawn parts/recipes in mod structure fixed bug related to hitting "Chest"/ "chest" operations added support/mechgenitals for Lancer mechanoid[B19] removed def "InsectGenitals" since it is not used added HediffDefs for yokes, hand/leg bondage, open/ring gags, might actually add those items later, if someone finds sprites reduced eating with gag to 0 v1.7.0_ed86_B19_testing8 change to part removing recipies hide surgeries with missing body parts reworked fertility, should slightly increase max female fertility age ↲ fertility now decreases in adult life stage instead of pawn life, this should help with races like Asari(though they are still broken and wont be fertile until they are teens, which is 300 yo) probably fixed few possible errors v1.7.0_Atrer_B19_testing7 reversed oral logic add Korean translation fixes from exoxe updated genital assignment patterns animals no longer hurt zoophiles while breeding them v1.7.0_Atrer_B19_testing6 remove vestigial sex SkillDefs v1.7.0_Atrer_B19_testing5 raped by animal changed to breeding differentiated a masochist getting bred from a zoophile getting bred, one doesn't mind it, the other likes it added oral sex (rimming, cunnilingus, fellatio) reworked breeding system female animals will prefer to approach males for breeding v1.7.0_ed86_B19_testing4 fixed breeding designation stuck when pawn no longer prisoner fixed social tab added social descriptions for vaginal added social descriptions for sex/rape v1.7.0_ed86_B19_testing3 various fixes for B19/ port to B19 fixes for items/genitals descriptions fixes for nymph stories fix for genital distribution fixed sex need stat for pawns with long lives removed Prosthophile traits from nymps, probably removed in b19? updated korean translation? moved/removed/disabled english translation v1.7.0_ed86_B19_testing2 various fixes for B19/ port to B19 fixes for items/genitals descriptions fixes for nymph stories fix for genital distribution fixed sex need stat for pawns with long lives removed Prosthophile traits from nymps, probably removed in b19? updated korean translation? moved/removed/disabled english translation v1.7.0_ed86 fixes for genital parts assignment changed descriptions of few items, ex: breast now use cup size rather than small-huge added debuffs to Moving and Manipulation for breasts added debuffs to Moving for penises monstergirls stuff: added slime parts, provide best experience, not implantable, all slimes are futas, slime tentacles(penis) are infertile added demon parts, slightly worse than bionics, not implantable, demons/impmother has 25% to get tentacle penis for female or 2nd penis for male. baphomet has 50% to have horse penis instead of demon reversed cowgirls breast size generation -> huge(40%)-> big(40%)-> normal(10%)-> small(10%) v1.6.9_ed86 nymphs only service colonists, not prisoner scum! disabled fapping in medical beds(ew! dude!) added few checks to prevent zoophiles doing their stuff if bestiality disabled changed target selection for sex, disabled distance and fuckability checks (this resulted mostly only single pawn/animal get raped, now its random as long as pawn meets minimal fuckability of 10%(have genitals etc)) rape/prisoner rape: zoophiles will look for animals to rape normal pawns will try to rape prisoners 1st, then colonists removed animal prisoner rape, you cant imprison animals, right? bestiality sex target selection: zoophiles will look for animals in this priority: -bond animal, -colony animal, -wild animals v1.6.8_ed86 added cat penises to feline animals, Orassans, Neko(is there such race?) added dog penises to canine animals added dragon penises for "dragon" races, not sure if there any added horse penises to horses, dryads, centaurs added hydraulics(10% for bionics) for droid and android races disabled breasts for insects, should probably disable for all animals until there is belivable replacement v1.6.7_ed86 added hydraulic penis mechanoids(or atleast what rjw considers mechanoids) now use mainly hydraulics no bionics for savages: limited spawn of hydraulics and bionics to factions with techlevel: Spacer, Ultra, Transcendent added Ovipositors for insects(only affects new insects) removed peg dick from pawn generation, still can be crafted reduced peg dick sexability(c'mon its a log... unless you're a vegan and despice meat sticks xD) added peg dick to getsex definition as male(that probably wont change anything but who knows) added new has_penis_infertile function, so characters with peg dick(maybe there will be something more later like dildos strapons or something) can rape achieving extremly broken body now arwards pawn with masochism trait(doesnt work for some reason, fix later, maybe) added skill requirements for crafting genitals n stuff added skill requirements for attaching genitals n stuff removed lots of spaces in xml's and cs's v1.6.6_rwg fixed reported bugs -masochist thoughts are not inversed -animal pregnancy does not throw errors -prevented whorebeds from showing up anywhere. Their defs are still in, hopefully to provide back compatibility -added contraceptive pills they look like CnP ones but are pink (CnP contraceptive doesn't work for RJW ) -numerous fixes and tweaks to CnP-RJW introperation, bumps still remains but things are tolerable v1.6.5_ed86 added toggle for usage of RimWorldChildren pregnancy for human-human(i think that pregnancy doesnt work) reduced rape debuffs time from 40 days to 10 added filter traits for raping GotRaped - removed by Masochist trait GotRapedByAnimal - removed by Masochist,Zoophile trait MasochistGotRaped - needs Masochist trait MasochistGotRapedByAnimal - needs Masochist,Zoophile trait HateMyRapist - removed by Masochist trait KindaLikeMyRapist - needs Masochist trait AllowedMeToGetRaped - removed by Masochist trait v1.6.4_rwg -Babies can inherit traits from parents. The file Defs/NonInheritedTraits.xml can be edited to filter out particular trait from inheritance. -Reworked how RJW designations (Comfort, Whore, Breed) work. (Fixed comfort designation disappearing when multiple maps are active) -Whoring is now determined by designation not by bed. Whorebeds not buildable anymore. -Whoring designation works on prisoners. -Added unhappy thoughts on whoring (diminishes with experience). Some backstories (defined in Defs/SpecialBackstories.xml) count as a lot of experience. Prisoners get different more severe mood hit. -Now there is special gizmo, that encompasses all the designations, clicking on its subelements alters the settings for all selected pawns. -Added animal designation used to select beasts that are allowed to use breeding designated pawns. -Added mod setting toggles for enabling zoophilia and for enabling weird cross-species pregnancies. -Added max search radius for a whore (equals 100 tiles) they won't try clients further away from them. -Numerous balance tweaks to defs. -Broken body counts as masochist when sex is in question. -Added aphrodisiac plant. Based off ambosia, reduces the sex satisfaction, addictive but addiction does not do much. -Low sex meter reduces the timer between loving interactions. v1.6.3a_rwg -fixed bug in designator drawing now it is possible to play with mod -Added adoption (Claim Child operation). If you see any child laying around, you don't need to trouble yourself with warden persuation. You can designate child for this operation and it will be included in your faction right away. This is doen as surgery operation and requires medicine (but doesn't fail). I cannot get it work otherwise, chadcode just shits some unintelligible errors happening a dozen calls away from the mod code. Consider the med requirement an adoption census. v1.6.3_rwg Anonimous release -Fixed broken body hediff to give the mood offsets as it should. (btw, if someone didn't understand that, it probably be broken mind, but the meaning was lost in translation by original author) -Reworked pregnancy. It is now even more compatible with Children and Pregnacy mod. If the latter is acitve, its pregnancy system is used if possible. Otherwise, rjw simpler pregnancy is used. -RJW pregnancy works for any pair of humanlike pawns. There are settings determining the race of the resulting child. -RJW pregnancy defines the child at the moment of conception. Loading saves should not reroll the newborn. -Added menu toggle to deactivate human-animal pregnancy (why would anyone need that? It's boring.) -Added animal equivalent of designate for comfort. Animals beat prisoners less often. -Animals born from human mothers receive random training in varied skills up to half of their max training. -Animal babies use different relation than normal children, if the animal dies its human parent doesn't get as significant debuff as with human child. -Fixed (probably?) fathers disappearing from child relations due to garbage collection . At least inheritance information is now preserved for sure. Does not apply to CnP, but it wasn't probably affected much anyway (due to both parents typically staying in the game for longer than ordinary raider). v1.6.2_rwg Anonimous release -Added "submit" combat ability. Makes colonist lay down and stop resistance. Colonist is incapacitated for 1-2 hours. If you rescue them, the effect disappears right away. (Being little sissies they are, they won't dismount themselves off strong arms of their savior unless you make them to.) Make sure that nearby enemies are only metaphorically after your meat. Check mod settings in options if you don't see the button. -Bionic genitals are recognized by prothofiles -Added transgender surgery, pawns won't be happy about such changes. Added futa. -Allowed prisoners to use comfort designations -Added message about unhealthy whores -Vulnerability calculations now include manipulation -Futa now can impregnate -DNA inheritance options now have meaningful descriptions and are actually used in game -Beatings are not continued beyond the severe threshold. Threshold is higher. Bloodlusty pawns still beat victims. -Pawns caught in a swarm of rapist animals will not starve to death anymore. -Pawns won't rape their friends (as designation) --includes Hoge's branch additions: -whoring is not cheating (There's still chance, thankfully) -broken body system extension (currently broken, duh) -hostages can now get raped during rescue quests -raping enemy now comes after all enemies are neutralized full list: -Add Compatibility to Children, School and Learning Mod(maybe not complete. -Add IUD temporary sterilizer. Install IUD to vagina to prevent pregnant. (experimental. -Add Female zoophilia. (sex with animals like whore. -Add require insect jelly to remove insect eggs need. -Add require holokey to remove mech implants. Change -less chance whoring with hate person. -Remove insect eggs when victim dead. -Don't feel "cheated on me" when partner work on whore. Improve -Whore pay from all caravan member. Allow whoring with Traveler, Visitor. -Search fuck target improve. Now try to search free victim. -Don't stay to rape colony so longer. -ViolateCorpse will check victim beauty(breast size,cuteness,etc... -Feel broke will increase gradually. (around 30 days everyday raping to max level -Fertility now depend on their life-stage and life-expectancy. (now all races can pregnant if not too old. Fixed -Fix null-reference on DoBirth(). -Fix whore count was not increased. -Fix whore bed is not affect end-table and dresser. -Fix anus vagina bug. v1.6.1a - Disabled dummy sex skill (it was experimental and was accidentally included in the 1.6.1-experimental). If you are updating from version 1.6.1-experimental, you'll experience missing reference errors about sex skill. It's safe to ignore them. Make a new save and reload it, and you'll see no more error. v1.6.1-exp - Reintegrated with Architect Sense mod by Fluffy. The whore beds are now regrouped into one category. - Fixed null reference exception on CP rape function. - Fixed whore reservation bug. It's now safe to assign more than one whore. - Fixed rape notification bug. - Minor 'mod settings' layout fix. - Added Russian translation by asdiky. - Added possibility to add more skill slot to the character tab. (there are no new skills yet) v1.6.0 Known bugs (new): - Exception: Whore unable to reserve target. To avoid this, don't assign more than one whore. - Sometimes on a rare occasion, there gonna be exceptions about pawns unable to reserve things. Changes: - Compatibility patch for Rimworld B18. - Removed integration with Children & Pregnancy mod. - Removed integration with Architect Sense mod. - Removed integration with Romance Diversified mod. - Updated Korean translation by NEPH. - Fixed visitors & traders raping CPs bug. - Fixed nymphs backstory layout bug. - Changed random rape mechanics. It's now triggered by mental breakdown only. (Will make an option for it) - Added random rape mental breakdown. (This feature is experimental and may not work as intended) - Added a notification when somebody is attempting a rape. - Added a notification when somebody is getting raped. - Changed some descriptions. v1.5.4j changes: - Insects will now inject their eggs while raping your incapacitated colonists. (by hogehoge1942) - Mechanoids will now inject microcomputers while raping your incapacitated colonists. The microcomputer teleports random cum into victim's vagina and makes her pregnant by random pawn. (by hogehoge1942) - Added surgeries to remove insect eggs and microcomputers by hogehoge1942. - Fixed sex need moods affecting under-aged pawns bug. - Under-aged sex need is now frozen. (Will make it hidden for under-aged pawns in the future) - Fixed reappearing masochist social thoughts bug. - Disabled intrusive whore failed hookup notifications. - Enabled mechanoids private parts. They will now have artificial genitals/breasts/anuses. - Fixed sex need decay rate reverting to default value. - Fixed mod settings bug. - Increased max rapists per comfort prisoner to 6. (Will make an option for it in the future) v1.5.4i changes: - Disabled log messages. - Added comfort colonist and comfort animal buttons. (NOTE: comfort animal button is still experimental and might not work as intended) - Tweaked comfort prisoner rape mechanism. - Overhauled bestiality rape mechanism: - Zoophiliacs will now prefer tamed colony animals. (Preference: Tamed > petness > wildness) - They will now prefer animals of their opposite sex. (Will make it based on Romance Diversified's sexual orientation in the future) - The search distance is now narrowed to 50 squares. Your zoophiles will go deer hunting at the corner of the map no more. - Added random twist. Zoophiliacs will sometimes go deer hunting even though the colony has tamed animals. - Zoophiliacs won't be picky about their victim's size. Make sure you have enough tamed animals to decrease the chance of them banging a rhino and end up dying in the process. - Added an option to sterilize vanilla animals. (modded animals coming soon) - Edited some descriptions in the mod settings. v1.5.4h changes: - Fixed nymph joining bed and no effect bug. - Temporary fix for anal rape thought memory. - Tweaked overpriced whores' service price. Normal whores are now cost around 20-40 silvers. - Updated Korean translation. (by NEPH) - Fixed "Allowed me to get raped" social debuff on masochists. v1.5.4g changes: - Added new texture for comfort prisoner button by NEPH. - Fixed inability to designate a prisoner as comfort prisoner that's caused by low vulnerability. - Fixed comfort prisoner button bug. It will only appear on prisoners only now. - Added Japanese translation by hogehoge1942. - Merged ABF with RJW. - Added new raping system from ABF by hogehoge1942. Raiders will now rape incapacitated/knocked down/unsconcious pawns who are enemies to them. - Fixed pawns prefer fappin' than do lovin'. v1.5.4f changes: - Standing fappin' bug fix. - New whore bed textures by NEPH. - Reworked vulnerability factors. Vulnerability is now affected by melee skill, sight, moving, and consciousness. v1.5.4e changes: - Added sex need decay option. You can change it anytime. - Overhauled mod settings: - Edited titles & descriptions. - Added plus & minus buttons. - Added validators. - Optimized live in-game changes. v1.5.4d changes: - Removed toggle whore bed button that's applied to all beds as it causes errors. - Added ArchitectSense's DLL by fluffy. - Added new 'Whore Beds' category in furniture tab by Sidfu. - Added research tree for whore beds by Sidfu. - Added new mod preview by NEPH. - Added new private parts textures by NEPH. - Added Korean translation by NEPH. - Fixed xpath bug. v1.5.4b changes: - Added Wild Mode. - Mod directory optimization. - Some value optimization. - Minor bugfixes. - Temporary fix for in-game notification bug. - Fixed reappearing double pregnancy bug. v1.5.3 changes: - Fixed a critical bug that pregnancy coefficients didn't work - Tweaked many values - Added a compatibility patch for the mod Misc.MAI so that MAI will spawn with private hediffs without reloading the save. The patch is in the file BodyPatches.xml. - You may add your own private hediffs' patch to your modded race. The MAI patch is an example. - Added some in-game notifications when you try to manually make your pawns rape CP. - Added some in-game messages about anal sex - Fixed bugs regarding whore system and zoophile behaviors. v1.5.2 changes: - Fixed things/pawns being killed vanishes - Fixed some animals spawned not having genitals/anus/breasts hediffs if you don't reload the save - Code optimization - some minor bugfix v1.5.1 changes: - fixed the performance issue, - allow you to install penis to women to make futas(so that you should no longer complain why women can't rape), - allow you to toggle whether non-futa women can rape(but still need traits like rapists or nymphos), - other bugfixes v1.5 changes: - Tons of bugfix(ex. losing apparel when raping, normal loving has the "stole some lovin" buff, etc.) - Tons of balance adjustments to make things reasonable and realistic - Added chinese simplified translations by nizhuan-jjr - Added options to change pregnancy coefficient for human or animals - Added sterilization surgery for preventing pregnancy without removing genitals - Added broken body system(CP being raped a lot will have a broken body hediff, which makes their sex need drop fast, but will give them mood buff while in the state) - Added a lite version of children growing system(if you use Children&Pregnancy, this system will be taken over.) - Fuckers generally need to have a penis to rape. However, CP raping and random raping can allow the fucker to be non-futa woemn with vulnerability not larger than a value you can set in the setting. - For the CP raping, non-futa women need to have traits like rapist or nymphomaniac. - Randomly generated women won't have necrophiliac and zoophile traits. - You can add penis to women to make futas through surgeries. - Pawns who have love partners won't fuck CP - Completed the whore system(Pawns who are assigned whore beds will be the whores, they'll try to hookup with those in need of sex. - If visitors are from other factions, they will pay a price to the whore after sex. The price is determined based on many details of the whore.) - Completed behaviors for necrophiliac - Some code optimization - Added rotting to the private parts by SuperHotSausage - Tweaked body-parts' weights by SuperHotSausage - Optimized the xpath method by SuperHotSausage - Greatly enhance compatibility with the Birds and the Bees, RomanceDiversified, Children&Pregnancy, and many other mods(Please put RJW after those mods for better game experience) v1.4 changes: - Refactored source files - Added chinese translations by Alanetsai - Adjusted selection criteria to prefer fresh corpses - Fixed apparel bug with animal attackers v1.3 changes: - Added breast and anus body parts, along with hydraulic/bionic alternatives - Added necrophilia - Added random rapes - Exposed more constants in configuration file v1.2 changes: - Updated to A17 - Enabled comfort prisoner designation on all colony pawns, prisoners, and faction animals - Enabled pregnancy for raped pawns via RimWorldChildren - Updated mod options v1.1 changes: - Added bondage gear - Implemented special apparel type which applies a HeDiff when it's equipped - Implemented locked apparel system which makes certain apparel unremovable except with a special "holokey" item - Implemented new ThingComp which attaches a unique hex ID & engraved name to items - Implemented more ThingComps which allow items to be used on prisoners (or in the case of apparel the item is equipped on the prisoner) - Finally with all the infrastructure done, added the actual bondage gear - Armbinder which prevents manipulation and any sort of verb casting - Gag which prevents talking and reduces eating - Chastity belt which prevents sex, masturbation, and operations on the genitals - Added surgery recipes to remove gear without the key at the cost of permanent damage to the bound pawn - Added recipes to produce the gear (and an intermediate product, the hololock) - Started using the Harmony library to patch methods - No longer need to override the Lovin' JobDef thanks to patches in JobDriver_Lovin.MakeNewToils and JobDriver.Cleanup. This should - increase compatibility with other mods and hopefully will work smoothly and not blow up in my face. - Patched a bunch of methods to enable bondage gear - Created a custom build of Harmony because the regular one wasn't able to find libmono.so on my Linux system - Pawns (except w/ Bloodlust or Psychopath) are less likely to hit a prisoner they're raping if the prisoner is already in significant pain - Nymphs won't join-in-bed colonists who are in significant pain - STD balance changes - Infections won't pass between pawns unless the severity is at least 21% - Accelerated course of warts by 50% and syphilis by ~20% - Reworked env pitch chances: base chance is lower and room cleanliness now has a much greater impact - Herpes is 33% more likely to appear on newly generated pawns - Pawns cannot be infected if they have any lingering immunity - Syphilis starts at 20% severity (but it isn't more dangerous since the other stats have been adjusted to compensate) - Syphilis can be cured if its severity is pushed below 1% even without immunity - STD defs are loaded from XML instead of hardcoded - Added some config options related to STDs - Sex need won't decline on pawns under age 15 - Renamed "age_of_consent" to "sex_free_for_all_age" and reduced value from 20 to 19 - Prisoners under the FFA age cannot be designated for rape v1.0 changes: - Reduced the chance of food poisoning from rimming from 5% to 0.75% - Added age_of_consent, max_nymph_fraction, and opp_inf_initial_immunity to XML config - Pawns whose genitals have been removed or destroyed can now still be raped - The "Raped" debuff now stacks - Fixed incompatibilities with Prepare Carefully - Mod no longer prevents the PC menu from opening - Reworked bootstrap code so the privates will be re-added after PC removed them (this won't happen in the PC menu, though, only once the pawns appear on the map) - Fixed a crash that occurred when PC tried to generate tooltips for bionic privates - Fixed derp-tier programming that boosted severity instead of immunity on opportunistic infections - Sex satisfaction now depends on the average of the two pawn's abilities instead of their product - Flesh coverage stats for the torso are now correctly set when the genitals part is inserted - Fixed warts and syphilis not being curable and rebalanced them a bit - Sex need now decreases faster when it's high and slower when it's low - Nymphs now won't fuck pawns outside their allowed area - Fixed "allowed me to get raped" thought appearing on masochists - Nymph join event baseChance reduced from 1.0 to 0.67 and minRefireDays increased from 2 to 6
Korth95/rjw
changelog.txt
Text
mit
161,255
========================================= ||| RimJobWorld Community Project ||| ========================================= Special thanks to Void Main Original Author UnlimitedHugs HugsLib mod library for Rimworld pardeike Harmony library Fluffy Architecture Sense mod DLL Loverslab Housing this mod Skystreet Saved A16 version from nexus oblivion nethrez1m HugsLib / RimWorldChildren fixes prkr_jmsn A17 compatibility, Genital injection, sounds, filth Goddifist Ideas shark510 Textures, testing Soronarr Surgery recipes, monstergirls semigimp General coding AngleWyrm Textures Alanetsai Chinese traditional translations nizhuan-jjr Chinese simplified translations, general coding, bugsfix, whore system, broken body system, balancing, testing, textures, previews, etc. g0ring Coding idea, bugfix StarlightG Coding idea, bugfix SuperHotSausage Coding, stuff Sidfu Coding, XML modding NEPH Graphics & textures, testing, Korean translation hogehoge1942 Coding, Japanese translation Ed86 Coding TheSleeplessSorclock Coding asdiky Russian translation exoxe Korean translation Atrer Coding Zaltys Coding SlicedBread Textures And anyone we might have missed. add your self
Korth95/rjw
credits.txt
Text
mit
1,280
-The transgender thoughts sometimes disappear if you perform a chain of sex operations on the same pawn. Probably some oversight in algorithm that gives thoughts on transition (some underthought chaining of effects). Fix somewhere in the future. -Whores with untended diseases (flu, herpes, warts) will try hookup and may succeed but the job will get cancelled shortly afterwards resulting in message spam. Currently added different message to notify players of problem. -Genital helper is shit. It does not account for later added animal dicks. has_<x> methods are fucking runtime regex searches
Korth95/rjw
known_bugs.txt
Text
mit
600
CORE: add nymph lord ai, so nymphs can behave as visitors add sex addiction to demonic parts? add insects dragging pawns to hives gene inheritance for insect ovis workgivers(aka manual control): -workgiver for sex with humpshrooms, increasing their growth by 1 day, causing addiction, temp? humpshroom-penis futa? -workgiver(auto, cleaning) to collect cum add recipe to make food from cum? add female cum? add some sort of right clicking sub menu: -designate breeding pair(through relations?) rework genital system, so it only have vag,penis,breast,anus (with comp?) storing name, severity(size?) of part probably also rework surgeries to support those rework sex satisfaction system(based on parts size/difference? traits/quirks etc) integrate milkable colonists with sizes support and operations? to change milk type(w gitterworld med?) BDSM: -make ropes and other generic gear, that is "locked" but not with hololock unique keys - normal keys made of steel, etc -piercing? -blindfolds? -vibrators? Multiplayer: -figure out predictable seeds instead of syncmethod's maybe: add support for other pregnancy mods more sex related incidents? backstories: cowgirl, etc whoring: -add whoring zone( esp for prisoners) -limit whoring to zone -whore in zone does most checks but instead of going after client- client comes to whore and they do stuff or merge quickies with whoring or idk invent something new and maybe while at it make toggles for whores to service colonists, oh and defying whores will count toward rape and accepted whores - con sex never? -make interactive COC like sex/stories RatherNot (Code) We need Pawn Sexualization Request: like Pawn Generation Request, but for generating RJW things Current approach missing any kind of flexibility In can be useful for race support to: instead placing checks directly in generator you can place limitations on generator in request older stuff TO DO: Add new body part groups for the bondage gear (specifically a genitals group for the CB and a jaw or mouth group for the gag, the mouth group that's already in the game won't work I'm pretty sure) Once that (^^^) is done make it so that the groups are automatically blocked by the gear, like a more robust version of the blocks_genitals flag Add more thoughts after sex about e.g. partner's dick size and sex skill Add chance for sex/fap with a peg dick to produce splinters TO DO EVENTUALLY (AKA NEVER): Improve detection of genital harvest vs amputation - (Maybe) Make it so that downgrading a pawn is considered harvesting OTHER RANDOM/HALF-BAKED IDEAS: Add some random dialogues for rapes, lovins, etc. Strap prisoners to their beds Sex addiction - Reduces satisfaction from sex - Should only affect nymphomaniacs? Traits?: Low Self Esteem (just another pessimist trait) Dom/Sub Mindbroken (raped so much that they are at a permanent max happiness, but are worth nothing more than just hauling and cleaning) Branded, this pawn is branded a cow/animal fucker/prostitute/rapist, whatever his/her extra curricular is comes with a negative opinions so they are pretty much never liked?
Korth95/rjw
todo or not todo.txt
Text
mit
3,119
Makefil* src/Makefil* auto* conf* aclocal.m4 *.o *bar temp_dir/ src/.deps/ .deps/ *.in *.in~ *stam* *.txt src/pinky_curses *.xz *.pdc *.pyo __pycache__ *.info !Makefile.am src/Makefile.am !configure.ac !Makefile.skel !extra/FreeBSD/Makefile !extra/bash_zsh/_pinkybar !extra/bash_zsh/pinkybar !doc/man_template.pdc !extra/Gentoo/app-admin/pinky/* !doc/Makefile
void0/pinky
.gitignore
Git
unknown
373
SUBDIRS = src dist_man_MANS = doc/pinkybar.1 # Optional, create and install # the pinkybar info document # info_TEXINFOS = doc/pinkybar.texi # MAKEINFOFLAGS = --no-validate --no-warn --force # To satisfy make dist EXTRA_DIST = \ src/ncurses.c \ bootstrap \ README.md \ .gitignore \ m4 \ doc \ extra
void0/pinky
Makefile.am
am
unknown
358
The code doesn't age, neither it has expiration date. ## Table of Contents - [Program Options](#program-options) - [Configure Options](#gnu-build-system-configure-options) - [Installation for dwm](#installation-for-dwm) - [Installation for xmonad/other WM](#installation-for-xmonad-or-other-wm) - [Installation in FreeBSD](#installation-in-freebsd) - [Installation in OpenBSD](#installation-in-openbsd) - [pinky curses installation](#pinky-curses-installation) - [pinky urxvt](#pinky-urxvt) - [Installation for anything else](#installation-for-anything-else) - [Using configuration file](#using-configuration-file) - [Linux Requirements](#linux-mandatory-requirements) - [BSD Requirements](#bsd-mandatory-requirements) - [Opt-in Requirements](#opt-in-requirements) - [WM Requirements](#wm-specific-requirements) - [Wish list](#wish-list) --- dwm ![](img/pic.png) xmonad ![](img/pic5.png) ![](img/pic7.png) ncurses ![](img/pic6.png) Gather some system information and show it in this statusbar program, not tied to any Window Manager, terminal multiplexer, etc. Please note that the program won't detect fans connected via molex connetor(s) or external fan controller. Also I have not tested it with fan splitter(s) either. The program is smart enough to detect whether some of your fan(s) blades are spinning, or the particular fan have been removed. Hold down some of your fan blades and you'll see that the program won't include this fan and it's RPM, release the blades and you'll see the fan and it's RPM in the statusbar. Try simulating real fan hardware failure by holding down all system fan blades and watch what the program will show you, just try not to slice your cheesy fingers open in the process. You can extend pinky-bar with your own crafted perl/python/ruby/lua script. If you compile your kernel from source code make sure to include your cpu and motherboard sensors as **modules** and not inlined. **Just an example if you use BSD - acpi/aibs, coretemp/amdtemp.** ![](img/cpu-temp.png) ![](img/mobo-temp.png) --- ## Program options The order of supplied options will dictate how, where and what system information to be shown. | short option | long option | Descrtiption | |--------------|-------------|--------------------------------------------------------------------| | -M | --mpd | The song filename | | -W | --mpdtrack | The song track name (not available in cmus) | | -x | --mpdartist | The song artist(s) name(s) | | -X | --mpdtitle | The song title | | -y | --mpdalbum | The song album name | | -Y | --mpddate | The song date | | -c | --cpu | The current cpu load (summed up all cores/threads) | | -L | --coresload | Show the load regarding each individual cpu core/thread | | -T | --cputemp | The current cpu temperature | | -C | --cpuspeed | Show your maximum cpu clock speed in MHz, regardless of the used governor. Uses assembly. | | -I | --cpuinfo | Detect your CPU vendor, stepping, family, clflush, l1/l2 cache and line size, physical cores, physical and virtual bits. Uses assembly. | | -r | --ramperc | The used ram in percentage | | -J | --ramtotal | The total ram | | -K | --ramfree | The free ram | | -l | --ramshared | The shared ram | | -o | --rambuffer | The buffer ram (not available in OpenBSD) | | -s | --driveperc | The used drive storage in percentage | | -n | --drivetotal| The total drive storage | | -N | --drivefree | The free drive storage | | -O | --driveavail| The available drive storage (total - used) | | | --drivetemp | Read the drive temperature from S.M.A.R.T | | -g | --battery | The remaining battery charge | | -z | --dvdstr | The vendor and model name of your cdrom/dvdrom | | -S | --statio | Read and written MBs to the drive so far [argument - sda] | | -p | --packages | The number of installed packages | | -P | --kernsys | The kernel name | | | --kernode | The network node hostname | | -Q | --kernrel | The kernel release | | -R | --kernver | The kernel version | | -u | --kernarch | The machine architecture | | -k | --kernel | Combined kernel name and version | | | --perl | Extend pinkybar with your scripts written in perl, learn more from the Opt-in section. | | | --python | Extend pinkybar with your scripts written in python, learn more from the Opt-in section. | | | --ruby | Extend pinkybar with your scripts written in ruby, learn more from the Opt-in section. | | | --lua | Extend pinkybar with your scripts written in lua, learn more from the Opt-in section. | | -q | --weather | Show the temperature outside [argument - London,uk] | | -U | --uptime | The system uptime | | -w | --loadavg | The system average load for past 1, 5 and 15 minutes | | -v | --voltage | The system voltage | | -f | --fans | All system fans and their speed in RPM | | -m | --mobo | Show the motherboard name and vendor | | -d | --mobotemp | The motherboard temperature | | -V | --volume | The sound volume level | | -t | --time | The current time | | -a | --ipaddr | The local ip address [argument - eth0] | | -b | --bandwidth | The consumed internet bandwidth so far [argument - eth0] | | -i | --iface | The current download and upload speed [argument - eth0] | | -A | --ipmac | The NIC mac address [argument - eth0] | | -B | --ipmask | The NIC subnet mask [argument - eth0] | | -D | --ipcast | The NIC broadcast address [argument - eth0] | | -E | --iplookup | Mini website IP lookup [website argument - google.com] | Be aware of the options that mention **Uses assembly** are tested only on AMD and Intel CPUs (starting from pentium 4 onwards). The following options are available only in Linux: | short option | long option | Descrtiption | |--------------|-------------|--------------------------------------------------------------------| | -F | --drivemodel| The vendor name of your drive [argument - sda] | | -G | --nicinfo | The NIC vendor and model [argument - eth0] | | | --nicdrv | The NIC driver [argument - eth0] | | -H | --nicver | The NIC version [argument - eth0] | | -e | --iplink | The NIC link speed (useful for wireless/wifi) [argument - eth0] | | -j | --nicfw | The NIC firmware [argument - eth0] | | -h | --wifiname | The name of currently connected wifi/wireless network [argument - wlan0] | The following options are available only to FreeBSD and OpenBSD: | short option | long option | Descrtiption | |--------------|-------------|--------------------------------------------------------------------| | -j | --nicgw | The NIC gateway address [argument - re0] | | -Z | --swapused | The used drive swap in MB | | -F | --swaperc | The used drive swap in percentage | | -h | --swaptotal | The total drive swap | | -H | --swapavail | The available drive swap (total - used) | The following options are available only in OpenBSD: | short option | long option | Descrtiption | |--------------|-------------|--------------------------------------------------------------------| | -l | --ramused | The used ram in MB | --- ## GNU Build System (configure) options Before the source code is passed to the compiler, you can enable/disable the following **configure** options that will increase/reduce the number of dependencies required to compile the program. It's up to you to decide which features suit you best. | To include | Not to include | Descrtiption | |----------------|---------------------|--------------------------------------------------------------------------------------------| | --with-x11 | --without-x11 | Enable it if you are using dwm. | | --with-alsa | --without-alsa | To get the sound volume level. | | --with-oss | --without-oss | To get the sound volume level in \*BSD. | | --with-net | --without-net | Enable the internet related options. | | --with-libnl | --without-libnl | Enable the wifi related options regarding chipsets supporting the cfg80211/mac80211 modules (linux only). | | --with-pci | --without-pci | To get the NIC vendor and model in linux | | --with-dvd | --without-dvd | To get the cdrom/dvdrom vendor and model | | --with-sensors | --without-sensors | Alternative way to get data from the sensors (linux only) | | --with-apm | --without-apm | APM power and resource management for laptops (FreeBSD only) | | --with-ncurses | --without-ncurses | Output the data to the terminal using the ncurses library, can be colorized | | --with-perl | --without-perl | Extend pinkybar with your own crafted scripts written in perl | | --with-lua | --without-lua | Extend pinkybar with your own crafted scripts written in lua | | --with-ruby | --without-ruby | Extend pinkybar with your own crafted scripts written in ruby | | --with-python2 | --without-python2 | Extend pinkybar with your own crafted scripts written in python2 | | --with-python3 | --without-python3 | Extend pinkybar with your own crafted scripts written in python3 | | --with-weather | --without-weather | The temperature outside (some details must be provided) | | api\_key='123458976' | | API key obtained after registering yourself in the weather website, must be combined **--with-weather** | | --with-smartemp | --without-smartemp | Read the drive temperature from S.M.A.R.T cross-platform available | | --with-drivetemp | --without-drivetemp | Read the drive temperature from S.M.A.R.T (linux only) uses curl | | --with-drivetemp-light | --without-drivetemp-light | Read the drive temperature from S.M.A.R.T (linux only) light version | | drive\_port='1234' | | Different TCP port to listen to for the drive temperature, default one is 7634, must be combined **--with-drivetemp** or **--with-drivetemp-light** | | --with-colours | --without-colours | Colorize the output data. | | icons=/tmp | | xbm icons that can be used by dzen2 for example. Discarded when **--with-x11** is used | | --with-mpd | --without-mpd | To see the currently played song name (if any). | | --prefix=/tmp | | The directory where the program will be installed | | mobo\_sensor='dev.aibs.0' | | FreeBSD motherboard sensor module name to use in the sysctl calls. Read the FreeBSD installation below | | cpu\_sensor='dev.cpu.0.temperature' | | FreeBSD cpu temperature module name to use in the sysctl calls . Read the FreeBSD installation below | By default, if **no** options are passed, the program will be compiled with: ```bash --with-net --with-pci ``` Affects only FreeBSD users with laptops, **--without-apm** will compile the program with acpi support to obtain the current battery life. **--without-mpd** will compile the program with cmus support, the options syntax stays as is. The pci and sensors configure options will be discarded in \*BSD. Affects only linux users with wifi/wireless chipsets, run `lsmod|grep 802` and see whether your chipset uses cfg80211/mac80211. If that's so you can rely on libnl and enable **--with-libnl** configure options, otherwise your chipset probably still uses we/wext, so type **--without-libnl**. Affects only linux users, **--with-drivetemp** pretty much locks you down to hddtemp. You can adjust **extra/scripts/drive-temperature.sh** and compile the program **--with-smartemp**, so you can switch between hddtemp and smartmontools at any time without the need recompile pinkybar with different options. **--with-smartemp** only cares for the existance of /tmp/pinkytemp file. **--with-weather** is using [this url](http://openweathermap.org/current), register yourself there, create a new [API key](https://home.openweathermap.org/api\_keys). Don't just rush to register yourself, read carefully what the "Free" account limits are and take in account how often the program should call their api service. I'm not responsible if you exceeded the limits, you've been warned. ```bash # Make sure it's working first # curl 'http://api.openweathermap.org/data/2.5/weather?q=London,uk&units=metric&APPID=28459ae16e4b3a7e5628ff21f4907b6f' # what to pass to configure --with-weather api_key='28459ae16e4b3a7e5628ff21f4907b6f' ``` --- ## Installation for dwm ```bash perl set.pl "distro" autoreconf --install --force ./configure --prefix=$HOME/.cache --with-x11 make make install ``` Copy the code from extra/scripts/dwm.sh or `exec` it from **xinitrc** or the script used to start dwm. ## Installation for xmonad (or other WM) ```bash # Copy the xbm icons mkdir -p --mode=700 $HOME/.xmonad/icons cp -r extra/xbm_icons/*.xbm $HOME/.xmonad/icons perl set.pl "distro" autoreconf --install --force # disable X11, point the location to the icons ./configure --prefix=$HOME/.cache --without-x11 icons=$HOME/.xmonad/icons # compile 'n install make make install ``` Copy the code from extra/scripts/xmonad.sh or `exec` it from **xinitrc** or the script used to start xmonad. ## Installation in FreeBSD FreeBSD has no other way than using the module specific convention to query sysctl and obtain data from the sensors. Maintaining a list with all the possible module names and performing expensive sysctl calls in a loop to determine that X module is loaded into your system is no-go. Be prepared to spend a minute or two to find out some system information. Determine the motherboard sensor module name. ```bash sysctl -a|grep 'aibs' dev.aibs.0.volt.0: 1356 850 1600 dev.aibs.0.volt.1: 3344 2970 3630 dev.aibs.0.volt.2: 5040 4500 5500 dev.aibs.0.volt.3: 12278 10200 13800 dev.aibs.0.temp.0: 39.0C 60.0C 95.0C dev.aibs.0.temp.1: 38.0C 45.0C 75.0C dev.aibs.0.fan.0: 1053 600 7200 dev.aibs.0.fan.1: 1053 600 7200 ``` Copy only 'dev.MODULE.NUMBER' (if there is any number at all) and paste it into the **mobo\_sensor** option below. Do the same for your cpu temperature, copy and paste the variable as is. **dev.cpu.0.temperature** below is provied as example. ```bash perl set.pl "freebsd" autoreconf --install --force ./configure --prefix=$HOME/.cache --with-x11 --without-alsa --with-oss mobo_sensor='dev.aibs.0' cpu_sensor='dev.cpu.0.temperature' make make install ``` Send a request to the FreeBSD mailing list and request the OpenBSD sensors API to be ported. ## Installation in OpenBSD Before proceeding, you'll have to: ```bash # To detect the newer compiler that you are # about to install sed -i 's/#AC_PROG_CC(/AC_PROG_CC(/g' configure.ac ls /usr/local/bin/automake-* ls /usr/local/bin/autoconf-* # Then replace the numbers below export AUTOCONF_VERSION=2.69 export AUTOMAKE_VERSION=1.15 # Your call, gcc or llvm ? pkg_add gcc # after that: perl set.pl "openbsd" autoreconf --install --force ./configure --prefix=$HOME/.cache --without-alsa --with-oss make make install ``` ## pinky curses installation Step one, compile pinky-bar **--with-ncurses**, so the output to be formated in a way that pinky-curses can parse and colorize. ```bash perl set.pl "distro" autoreconf --install --force # disable X11, enable the colours and ncurses opts. ./configure --prefix=$HOME/.cache --without-x11 --with-alsa --with-colours --with-ncurses # compile 'n install make make install ``` Step two, compile and install pinky-curses - https://notabug.org/void0/pinky-curses Copy the code from extra/scripts/pinky-curses.sh ## pinky urxvt What a coincidence, pinky-urxvt is my 3rd urxvt extension and 3rd member of the pinky family. The sole purpose of this urxvt extension is to make it easy for you to keep track of things that you are interested to monitor while hacking your way something in the terminal. Link - https://notabug.org/void0/pinky-urxvt ![](https://notabug.org/void0/pinky-urxvt/raw/master/2.png) pinky-urxvt, and pinky-curses are not tied to pinky-bar. ## Installation for anything else pinky-bar is no longer tied to Window Managers only. With the addition of "without colours", the output can be shown in any program, just bear in mind that the more options you've supplied the more system information will be shown. The tmux status bar in action: ![](img/pic4.png) The installation steps: ```bash perl set.pl "distro" autoreconf --install --force ./configure --prefix=$HOME/.cache --without-x11 --without-colours make make install ``` By choosing this 3rd installation method it is up to you where, how to start and use the system information that's produced by pinky-bar. --- Replace **distro** with archlinux, debian, gentoo, slackware, rhel, frugalware, angstrom. Here's some short distros list of some popular distros that are based on another one: - [x] archlinux based distros: parabola, chakra, manjaro - [x] debian based distros: ubuntu, linux mint, trisquel, back track, kali linux, peppermint linux, solusos, crunchbang, deepin, elementary os, and the rest \*buntu based distros - [x] gentoo based distros: funtoo, sabayon, calculate linux - [x] slackware - [x] rhel based distros: opensuse (uses rpm), fedora, fuduntu, mandriva, mandrake, viperr, mageia - [x] frugalware - [x] angstrom Cannot list the \*BSD flavours as "distros", so they deserve own options: - [x] freebsd - [x] openbsd --- ## Using configuration file **~/.pinky** is the location of the configuration file. It uses the same short and long command line options. I do advise you to use the long options syntax. If any option depends on argument, don't put any space between the option and the argument. Use one option per line. Contrary to your shell, the "parser" won't expand ~/my\_script.pl to point to /home/sweethome/my\_script.pl ```bash --weather=London,uk --coresload --cputemp --ramperc --driveperc --packages --kernel --voltage --fans --mobo --mobotemp --perl=/home/sweethome/my_script.pl ``` Execute the program without supplying any command line options and it will parse the configuration file. --- ## Linux Mandatory requirements * gcc/clang * glibc * autoconf * automake * m4 * gawk * perl ## \*BSD Mandatory requirements * gcc/clang * autoconf * automake * autoconf-wrapper * automake-wrapper * autoconf-archive * argp-standalone * libtool * m4 * gawk * perl Some llvm and gcc versions will not check for headers and libraries in /usr/local, if that's the case for you, you should export the following environment variables: ```bash export LDFLAGS='-L/usr/local/lib' export CFLAGS='-I/usr/local/include' ``` After editing the wrong prototype I managed to stumble upon a bug in OpenBSD's own libc. **Warning !!! OpenBSD users !!!** The majority of SCN\* macros differs from their PRI\* cousins. And I cannot guarantee the accuracy of fixed width integers when OpenBSD own libc managed to use different format specifiers. Read extra/misc/openbsd\_bugs.md for more details. ## Opt-in requirements Linux camp: The internet related options rely on headers provided iproute2. By default the program will try to compile with those headers included. If for any reason you would like to compile the program without internet related options, then pass **--without-net** to configure. * iproute2 wifi/wireless chipsets supporting mac80211/cfg80211: * libnl (>= 3.0) * pkg-config In Gentoo there are two versions of pkg-config. The first one is named dev-util/pkgconfig and the second one is dev-ruby/pkg-config. In order to use the first one, you'll have to export the pkg-config path to the following environment variable: ```bash export PKG_CONFIG_PATH=/usr/bin/pkg-config ``` Then pass **--with-libnl** to configure. To get the NIC vendor and model names: * pciutils Alternative way to obtain data from the sensors: * lm\_sensors To read the drive temperature from S.M.A.R.T **--with-drivetemp**: * hddtemp * curl To read the drive temperature from S.M.A.R.T **--with-drivetemp-light**: * hddtemp The "light" version does not rely on curl, and will not force -O0 CFLAGS. ```bash # --with-drivetemp-light 0.00s user 0.00s system 15% cpu 0.006 # --with-drivetemp 0.01s user 0.00s system 72% cpu 0.008 ``` Try running hddtemp to see if it detects your drive, depending if it has temperature sensor in first place: ```bash sudo hddtemp /dev/sda WARNING: Drive /dev/sda doesn't appear in the database of supported drives WARNING: But using a common value, it reports something. WARNING: Note that the temperature shown could be wrong. WARNING: See --help, --debug and --drivebase options. WARNING: And don't forget you can add your drive to hddtemp.db /dev/sda: Corsair Force GT: 23°C or °F ``` The message is pretty clear "don't forget to add your drive to hddtemp.db", first run the debug command to see which field is responsible to report your drive temperature, it should be in the range of 190 - 200: ```bash # Copy the Model: line sudo hddtemp --debug /dev/sda ================= hddtemp 0.3-beta15 ================== Model: Corsair Force GT field(1) = 0 field(5) = 0 field(9) = 253 field(12) = 237 field(171) = 0 field(172) = 0 field(174) = 147 field(177) = 1 field(181) = 0 field(182) = 0 field(187) = 0 field(194) = 22 field(195) = 0 field(196) = 0 field(201) = 0 field(204) = 0 field(230) = 100 field(231) = 0 field(233) = 130 field(234) = 216 field(241) = 216 field(242) = 151 ``` Open up **/usr/share/hddtemp/hddtemp.db** and append the Model: line that you copied earlier with the correct field that reports your drive temperature. ```bash "Corsair Force GT" 194 C "Corsair Force GT 120GB SSD" ``` Next run hddtemp in daemon mode so we can request the temperature back: ```bash sudo hddtemp -d /dev/sda ``` Open up your browser and navigate to 127.0.0.1:7634 and you'll get instant temperature report back to you. The "init" lock-in for those of you that cannot choose between udev or eudev puts me in position not rely on libatasmart, regardless how neat the library is. There is stripped example program in extra/misc/skdump.c if you are curious to check and test libatasmart. Linux camp end. To read the drive temperature from S.M.A.R.T **--with-smartemp**: * smartmontools smartmontools are not mandatory in OpenBSD, `atactl` does the same job. Execute the following command as root `visudo` and append: ```bash # 'frost' is my computer username frost ALL=NOPASSWD:/usr/sbin/smartctl ``` Copy the code from extra/scripts/drive-temperature.sh or `exec` it from **xinitrc** or the script used to start your DE/WM. To extend pinkybar with your own crafted perl/python/ruby/lua script: * perl * python == 2.7 (--with-python2) * python >= 3.3 (--with-python3) * lua >= 5.1 * ruby >= 2.0 and pkg-config Have a look at extra/scripts/pinky.{py,pl,ruby,lua}, they serve as examples how to write the most basic scripts in order to extend pinkybar in python/perl/ruby/lua. You can use the 3 languages simultaneously. Please, please do **NOT** export or set PYTHONPATH on it's own line. `WRONG`: ```bash export PYTHONPATH=/meh pinkybar --python my_script ``` `WRONG`: ```bash PYTHONPATH=/meh pinkybar --python my_script ``` Correct PYTHONPATH usage: ```bash # ~/chewbacca is the path where pinky.py resides # ~/chewbacca/pinky.py # python2 PYTHONPATH=~/chewbacca ~/pinkybar --python pinky # python3 # executed only once fuNky=$(python3 -c 'import sys;print(":".join([x for x in sys.path]))') # executed in a loop PYTHONPATH=$fuNky:~/chewbacca ~/pinkybar --python pinky ``` **--with-perl**: ```bash ~/pinkybar --perl ~/chewbacca/pinky.pl ``` **--with-ruby**: ```bash ~/pinkybar --ruby ~/chewbacca/pinky.rb ``` **--with-lua**: Non byte-compiled script: ```bash ~/pinkybar --lua ~/chewbacca/pinky.lua ``` Once done editing your script, you can byte-compile it: ```bash luac -o pinky.luac pinky.lua ~/pinkybar --lua ~/chewbacca/pinky.luac # <-- .luac and not .lua ``` To get the sound volume level: * alsa-utils * alsa-lib Then pass **--with-alsa** to configure. \*BSD users can use the baked OSS instead, pass **--without-alsa --with-oss** to configure instead. To output the data to the terminal using the ncurses library: * ncurses To get the vendor and model name of your cdrom/dvdrom/blu-ray: * libcdio * libcddb In linux **--without-dvd** will still compile the program with dvd support. Except it will be limited only to dvd support, it will try to parse the sr0 vendor and model name detected by the kernel. The weather related options, please go back and read **Don't just rush to register yourself**: * curl * gzip **Warning, I'm not responsible for any lawsuit towards you, neither encourage you to pirate content that is not licensed as free and/or for fair use.** To see the currently played song name **--with-mpd**: Server side: * mpd (can be build with soundcloud support) Client side: * libmpdclient * mpc/ncmpc/ncmpcpp, [and the rest](http://mpd.wikia.com/wiki/Clients) To see the currently played song name **--without-mpd**: * cmus The "soundcloud" alternative that is supported in cmus and your mpd client will be to download **.m3u/.pls** files according to the [radio stream station](https://www.internet-radio.com) that you are interested to listen. The FreeBSD users will notice that "mpd" is named "musicpd". If you've never used mpd before copy the example configuration from extra/mpd according to your OS. Keep an eye on the **log file size** if you are using raspberry pi (or equivalent device) that streams the music, make sure that it's deleted automatically if it exceeds some pre-defined size. --- ## WM specific requirements If you would like the output to be shown in your Window Manager, those are the following requirements: for non-dwm WM: * dzen2 for dwm: * libx11 * xorg-server use **--without-colours** to skip the following step: * dwm compiled with statuscolor patch. The colours in use are specified in your dwm config.h ## Wish list It would be great if I had \*BSD compatible usb wifi dongle or wireless pci adapter to add wifi options in pinky-bar.
void0/pinky
README.md
Markdown
unknown
29,684
# This file is processed by autoconf to create a configure script AC_INIT([pinkybar], [1.0.0]) AC_CONFIG_AUX_DIR([temp_dir]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([src/config.h]) # -Werror -Wportability AM_INIT_AUTOMAKE([1.13 -Wall no-define foreign subdir-objects dist-xz no-dist-gzip std-options]) AM_SILENT_RULES([yes]) {perl will replace this line} # With the addition of more runtime compile and # link tests, this option is no longer necessary. # Any compiler and C library succeeding to pass the # tests will be able to compile and run the # program flawlessly. # If you use OpenBSD uncomment the AC_PROG_CC([]) # line below. Make sure that you have the latest gcc/llvm # AC_PROG_CC([egcc clang llvm-gcc gcc]) AC_PROG_CC_C99 AC_C_CONST AC_HEADER_STDC AM_PROG_CC_C_O # AM_EXTRA_RECURSIVE_TARGETS([ncurses]) # The linker flags tests in m4 dir TEST_SOME_FUNCS TEST_NET TEST_PCI TEST_X11 TEST_ALSA TEST_MPD TEST_DVD TEST_SENSORS TEST_TYPEZ TEST_WEATHER TEST_PERL TEST_PYTHON TEST_LUA TEST_RUBY TEST_CFLAGZ AC_CONFIG_FILES([ Makefile src/Makefile ]) AC_OUTPUT echo echo 'Now type \"make\" and \"make install\" afterwards' echo
void0/pinky
configure.ac
ac
unknown
1,147
# 10/29/2016 # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. define pandora_snap -sed -e '15r ../README.md' 'man_template.pdc' | \ sed -e '15,50d' | pandoc -s -S $(1) - -o pinkybar.$(2) endef man: $(call pandora_snap,-f markdown -t man,1) info: pinkybar.info pinkybar.info: $(call pandora_snap, ,texi) -sed -i '2i @setfilename pinkybar.info' pinkybar.texi $(MAKEINFO) --no-validate --no-warn --force pinkybar.texi .PHONY: man info pinkybar.info
void0/pinky
doc/Makefile
Makefile
unknown
1,115
To re-create the man page and info document you'll have to install the whole pandoc suite, texinfo, gmake, gsed (replace sed with gsed on \*BSD), then invoke: ```bash make man info ``` --- Open up Makefile and delete the PHONY line. Execute `touch man`, followed by `make man`, bring back the PHONY line and execute `make man`.
void0/pinky
doc/README.md
Markdown
unknown
331
% pinkybar(1) manual % Aaron Caffrey % Oktoberfest 23, 2016 # NAME This man page is converted from markdown, and some information might not look good and/or have been stripped during the automated process. # SYNOPSIS pinkybar [*option*] # DESCRIPTION # REPORTING BUGS Report bugs to https://gitlab.com/void0/pinky-bar # COPYRIGHT Copyright (c) 2016 Aaron Caffrey \ Free use of this software is granted under the terms of the GNU General Public License (GPL).
void0/pinky
doc/man_template.pdc
pdc
unknown
469
.\"t .TH "pinkybar" "1" "Oktoberfest 23, 2016" "manual" "" .SH NAME .PP This man page is converted from markdown, and some information might not look good and/or have been stripped during the automated process. .SH SYNOPSIS .PP pinkybar [\f[I]option\f[]] .SH DESCRIPTION .PP Gather some system information and show it in this statusbar program, not tied to any Window Manager, terminal multiplexer, etc. .PP Please note that the program won't detect fans connected via molex connetor(s) or external fan controller. Also I have not tested it with fan splitter(s) either. .PP The program is smart enough to detect whether some of your fan(s) blades are spinning, or the particular fan have been removed. Hold down some of your fan blades and you'll see that the program won't include this fan and it's RPM, release the blades and you'll see the fan and it's RPM in the statusbar. Try simulating real fan hardware failure by holding down all system fan blades and watch what the program will show you, just try not to slice your cheesy fingers open in the process. .PP You can extend pinky\-bar with your own crafted perl/python/ruby/lua script. .PP If you compile your kernel from source code make sure to include your cpu and motherboard sensors as \f[B]modules\f[] and not inlined. .PP \f[B]Just an example if you use BSD \- acpi/aibs, coretemp/amdtemp.\f[] .PP [IMAGE: image (img/cpu-temp.png)] .PP [IMAGE: image (img/mobo-temp.png)] .PP * * * * * .SS Program options .PP The order of supplied options will dictate how, where and what system information to be shown. .PP .TS tab(@); l l l. T{ short option T}@T{ long option T}@T{ Descrtiption T} _ T{ \-M T}@T{ \[en]mpd T}@T{ The song filename T} T{ \-W T}@T{ \[en]mpdtrack T}@T{ The song track name (not available in cmus) T} T{ \-x T}@T{ \[en]mpdartist T}@T{ The song artist(s) name(s) T} T{ \-X T}@T{ \[en]mpdtitle T}@T{ The song title T} T{ \-y T}@T{ \[en]mpdalbum T}@T{ The song album name T} T{ \-Y T}@T{ \[en]mpddate T}@T{ The song date T} T{ \-c T}@T{ \[en]cpu T}@T{ The current cpu load (summed up all cores/threads) T} T{ \-L T}@T{ \[en]coresload T}@T{ Show the load regarding each individual cpu core/thread T} T{ \-T T}@T{ \[en]cputemp T}@T{ The current cpu temperature T} T{ \-C T}@T{ \[en]cpuspeed T}@T{ Show your maximum cpu clock speed in MHz, regardless of the used governor. Uses assembly. T} T{ \-I T}@T{ \[en]cpuinfo T}@T{ Detect your CPU vendor, stepping, family, clflush, l1/l2 cache and line size, physical cores, physical and virtual bits. Uses assembly. T} T{ \-r T}@T{ \[en]ramperc T}@T{ The used ram in percentage T} T{ \-J T}@T{ \[en]ramtotal T}@T{ The total ram T} T{ \-K T}@T{ \[en]ramfree T}@T{ The free ram T} T{ \-l T}@T{ \[en]ramshared T}@T{ The shared ram T} T{ \-o T}@T{ \[en]rambuffer T}@T{ The buffer ram (not available in OpenBSD) T} T{ \-s T}@T{ \[en]driveperc T}@T{ The used drive storage in percentage T} T{ \-n T}@T{ \[en]drivetotal T}@T{ The total drive storage T} T{ \-N T}@T{ \[en]drivefree T}@T{ The free drive storage T} T{ \-O T}@T{ \[en]driveavail T}@T{ The available drive storage (total \- used) T} T{ T}@T{ \[en]drivetemp T}@T{ Read the drive temperature from S.M.A.R.T T} T{ \-g T}@T{ \[en]battery T}@T{ The remaining battery charge T} T{ \-z T}@T{ \[en]dvdstr T}@T{ The vendor and model name of your cdrom/dvdrom T} T{ \-S T}@T{ \[en]statio T}@T{ Read and written MBs to the drive so far [argument \- sda] T} T{ \-p T}@T{ \[en]packages T}@T{ The number of installed packages T} T{ \-P T}@T{ \[en]kernsys T}@T{ The kernel name T} T{ T}@T{ \[en]kernode T}@T{ The network node hostname T} T{ \-Q T}@T{ \[en]kernrel T}@T{ The kernel release T} T{ \-R T}@T{ \[en]kernver T}@T{ The kernel version T} T{ \-u T}@T{ \[en]kernarch T}@T{ The machine architecture T} T{ \-k T}@T{ \[en]kernel T}@T{ Combined kernel name and version T} T{ T}@T{ \[en]perl T}@T{ Extend pinkybar with your scripts written in perl, learn more from the Opt\-in section. T} T{ T}@T{ \[en]python T}@T{ Extend pinkybar with your scripts written in python, learn more from the Opt\-in section. T} T{ T}@T{ \[en]ruby T}@T{ Extend pinkybar with your scripts written in ruby, learn more from the Opt\-in section. T} T{ T}@T{ \[en]lua T}@T{ Extend pinkybar with your scripts written in lua, learn more from the Opt\-in section. T} T{ \-q T}@T{ \[en]weather T}@T{ Show the temperature outside [argument \- London,uk] T} T{ \-U T}@T{ \[en]uptime T}@T{ The system uptime T} T{ \-w T}@T{ \[en]loadavg T}@T{ The system average load for past 1, 5 and 15 minutes T} T{ \-v T}@T{ \[en]voltage T}@T{ The system voltage T} T{ \-f T}@T{ \[en]fans T}@T{ All system fans and their speed in RPM T} T{ \-m T}@T{ \[en]mobo T}@T{ Show the motherboard name and vendor T} T{ \-d T}@T{ \[en]mobotemp T}@T{ The motherboard temperature T} T{ \-V T}@T{ \[en]volume T}@T{ The sound volume level T} T{ \-t T}@T{ \[en]time T}@T{ The current time T} T{ \-a T}@T{ \[en]ipaddr T}@T{ The local ip address [argument \- eth0] T} T{ \-b T}@T{ \[en]bandwidth T}@T{ The consumed internet bandwidth so far [argument \- eth0] T} T{ \-i T}@T{ \[en]iface T}@T{ The current download and upload speed [argument \- eth0] T} T{ \-A T}@T{ \[en]ipmac T}@T{ The NIC mac address [argument \- eth0] T} T{ \-B T}@T{ \[en]ipmask T}@T{ The NIC subnet mask [argument \- eth0] T} T{ \-D T}@T{ \[en]ipcast T}@T{ The NIC broadcast address [argument \- eth0] T} T{ \-E T}@T{ \[en]iplookup T}@T{ Mini website IP lookup [website argument \- google.com] T} .TE .PP Be aware of the options that mention \f[B]Uses assembly\f[] are tested only on AMD and Intel CPUs (starting from pentium 4 onwards). .PP The following options are available only in Linux: .PP .TS tab(@); l l l. T{ short option T}@T{ long option T}@T{ Descrtiption T} _ T{ \-F T}@T{ \[en]drivemodel T}@T{ The vendor name of your drive [argument \- sda] T} T{ \-G T}@T{ \[en]nicinfo T}@T{ The NIC vendor and model [argument \- eth0] T} T{ T}@T{ \[en]nicdrv T}@T{ The NIC driver [argument \- eth0] T} T{ \-H T}@T{ \[en]nicver T}@T{ The NIC version [argument \- eth0] T} T{ \-e T}@T{ \[en]iplink T}@T{ The NIC link speed (useful for wireless/wifi) [argument \- eth0] T} T{ \-j T}@T{ \[en]nicfw T}@T{ The NIC firmware [argument \- eth0] T} T{ \-h T}@T{ \[en]wifiname T}@T{ The name of currently connected wifi/wireless network [argument \- wlan0] T} .TE .PP The following options are available only to FreeBSD and OpenBSD: .PP .TS tab(@); l l l. T{ short option T}@T{ long option T}@T{ Descrtiption T} _ T{ \-j T}@T{ \[en]nicgw T}@T{ The NIC gateway address [argument \- re0] T} T{ \-Z T}@T{ \[en]swapused T}@T{ The used drive swap in MB T} T{ \-F T}@T{ \[en]swaperc T}@T{ The used drive swap in percentage T} T{ \-h T}@T{ \[en]swaptotal T}@T{ The total drive swap T} T{ \-H T}@T{ \[en]swapavail T}@T{ The available drive swap (total \- used) T} .TE .PP The following options are available only in OpenBSD: .PP .TS tab(@); l l l. T{ short option T}@T{ long option T}@T{ Descrtiption T} _ T{ \-l T}@T{ \[en]ramused T}@T{ The used ram in MB T} .TE .PP * * * * * .SS GNU Build System (configure) options .PP Before the source code is passed to the compiler, you can enable/disable the following \f[B]configure\f[] options that will increase/reduce the number of dependencies required to compile the program. .PP It's up to you to decide which features suit you best. .PP .TS tab(@); l l l. T{ To include T}@T{ Not to include T}@T{ Descrtiption T} _ T{ \[en]with\-x11 T}@T{ \[en]without\-x11 T}@T{ Enable it if you are using dwm. T} T{ \[en]with\-alsa T}@T{ \[en]without\-alsa T}@T{ To get the sound volume level. T} T{ \[en]with\-oss T}@T{ \[en]without\-oss T}@T{ To get the sound volume level in *BSD. T} T{ \[en]with\-net T}@T{ \[en]without\-net T}@T{ Enable the internet related options. T} T{ \[en]with\-libnl T}@T{ \[en]without\-libnl T}@T{ Enable the wifi related options regarding chipsets supporting the cfg80211/mac80211 modules (linux only). T} T{ \[en]with\-pci T}@T{ \[en]without\-pci T}@T{ To get the NIC vendor and model in linux T} T{ \[en]with\-dvd T}@T{ \[en]without\-dvd T}@T{ To get the cdrom/dvdrom vendor and model T} T{ \[en]with\-sensors T}@T{ \[en]without\-sensors T}@T{ Alternative way to get data from the sensors (linux only) T} T{ \[en]with\-apm T}@T{ \[en]without\-apm T}@T{ APM power and resource management for laptops (FreeBSD only) T} T{ \[en]with\-ncurses T}@T{ \[en]without\-ncurses T}@T{ Output the data to the terminal using the ncurses library, can be colorized T} T{ \[en]with\-perl T}@T{ \[en]without\-perl T}@T{ Extend pinkybar with your own crafted scripts written in perl T} T{ \[en]with\-lua T}@T{ \[en]without\-lua T}@T{ Extend pinkybar with your own crafted scripts written in lua T} T{ \[en]with\-ruby T}@T{ \[en]without\-ruby T}@T{ Extend pinkybar with your own crafted scripts written in ruby T} T{ \[en]with\-python2 T}@T{ \[en]without\-python2 T}@T{ Extend pinkybar with your own crafted scripts written in python2 T} T{ \[en]with\-python3 T}@T{ \[en]without\-python3 T}@T{ Extend pinkybar with your own crafted scripts written in python3 T} T{ \[en]with\-weather T}@T{ \[en]without\-weather T}@T{ The temperature outside (some details must be provided) T} T{ api_key=`123458976' T}@T{ T}@T{ API key obtained after registering yourself in the weather website, must be combined \f[B]\[en]with\-weather\f[] T} T{ \[en]with\-smartemp T}@T{ \[en]without\-smartemp T}@T{ Read the drive temperature from S.M.A.R.T cross\-platform available T} T{ \[en]with\-drivetemp T}@T{ \[en]without\-drivetemp T}@T{ Read the drive temperature from S.M.A.R.T (linux only) uses curl T} T{ \[en]with\-drivetemp\-light T}@T{ \[en]without\-drivetemp\-light T}@T{ Read the drive temperature from S.M.A.R.T (linux only) light version T} T{ drive_port=`1234' T}@T{ T}@T{ Different TCP port to listen to for the drive temperature, default one is 7634, must be combined \f[B]\[en]with\-drivetemp\f[] or \f[B]\[en]with\-drivetemp\-light\f[] T} T{ \[en]with\-colours T}@T{ \[en]without\-colours T}@T{ Colorize the output data. T} T{ icons=/tmp T}@T{ T}@T{ xbm icons that can be used by dzen2 for example. Discarded when \f[B]\[en]with\-x11\f[] is used T} T{ \[en]with\-mpd T}@T{ \[en]without\-mpd T}@T{ To see the currently played song name (if any). T} T{ \[en]prefix=/tmp T}@T{ T}@T{ The directory where the program will be installed T} T{ mobo_sensor=`dev.aibs.0' T}@T{ T}@T{ FreeBSD motherboard sensor module name to use in the sysctl calls. Read the FreeBSD installation below T} T{ cpu_sensor=`dev.cpu.0.temperature' T}@T{ T}@T{ FreeBSD cpu temperature module name to use in the sysctl calls . Read the FreeBSD installation below T} .TE .PP By default, if \f[B]no\f[] options are passed, the program will be compiled with: .IP .nf \f[C] \-\-with\-net\ \-\-with\-pci \f[] .fi .PP Affects only FreeBSD users with laptops, \f[B]\[en]without\-apm\f[] will compile the program with acpi support to obtain the current battery life. .PP \f[B]\[en]without\-mpd\f[] will compile the program with cmus support, the options syntax stays as is. .PP The pci and sensors configure options will be discarded in *BSD. .PP Affects only linux users with wifi/wireless chipsets, run \f[C]lsmod|grep\ 802\f[] and see whether your chipset uses cfg80211/mac80211. If that's so you can rely on libnl and enable \f[B]\[en]with\-libnl\f[] configure options, otherwise your chipset probably still uses we/wext, so type \f[B]\[en]without\-libnl\f[]. .PP Affects only linux users, \f[B]\[en]with\-drivetemp\f[] pretty much locks you down to hddtemp. You can adjust \f[B]extra/scripts/drive\-temperature.sh\f[] and compile the program \f[B]\[en]with\-smartemp\f[], so you can switch between hddtemp and smartmontools at any time without the need recompile pinkybar with different options. \f[B]\[en]with\-smartemp\f[] only cares for the existance of /tmp/pinkytemp file. .PP \f[B]\[en]with\-weather\f[] is using this url (http://openweathermap.org/current), register yourself there, create a new API key (https://home.openweathermap.org/api_keys). .PP Don't just rush to register yourself, read carefully what the \[lq]Free\[rq] account limits are and take in account how often the program should call their api service. I'm not responsible if you exceeded the limits, you've been warned. .IP .nf \f[C] #\ Make\ sure\ it\[aq]s\ working\ first #\ curl\ \[aq]http://api.openweathermap.org/data/2.5/weather?q=London,uk&units=metric&APPID=28459ae16e4b3a7e5628ff21f4907b6f\[aq] #\ what\ to\ pass\ to\ configure \-\-with\-weather\ api_key=\[aq]28459ae16e4b3a7e5628ff21f4907b6f\[aq] \f[] .fi .PP * * * * * .SS Installation for dwm .IP .nf \f[C] perl\ set.pl\ "distro" autoreconf\ \-\-install\ \-\-force \&./configure\ \-\-prefix=$HOME/.cache\ \-\-with\-x11 make make\ install \f[] .fi .PP Copy the code from extra/scripts/dwm.sh or \f[C]exec\f[] it from \f[B]xinitrc\f[] or the script used to start dwm. .SS Installation for xmonad (or other WM) .IP .nf \f[C] #\ Copy\ the\ xbm\ icons mkdir\ \-p\ \-\-mode=700\ $HOME/.xmonad/icons cp\ \-r\ extra/xbm_icons/*.xbm\ $HOME/.xmonad/icons perl\ set.pl\ "distro" autoreconf\ \-\-install\ \-\-force #\ disable\ X11,\ point\ the\ location\ to\ the\ icons \&./configure\ \-\-prefix=$HOME/.cache\ \-\-without\-x11\ icons=$HOME/.xmonad/icons #\ compile\ \[aq]n\ install make make\ install \f[] .fi .PP Copy the code from extra/scripts/xmonad.sh or \f[C]exec\f[] it from \f[B]xinitrc\f[] or the script used to start xmonad. .SS Installation in FreeBSD .PP FreeBSD has no other way than using the module specific convention to query sysctl and obtain data from the sensors. Maintaining a list with all the possible module names and performing expensive sysctl calls in a loop to determine that X module is loaded into your system is no\-go. Be prepared to spend a minute or two to find out some system information. .PP Determine the motherboard sensor module name. .IP .nf \f[C] sysctl\ \-a|grep\ \[aq]aibs\[aq] dev.aibs.0.volt.0:\ 1356\ 850\ 1600 dev.aibs.0.volt.1:\ 3344\ 2970\ 3630 dev.aibs.0.volt.2:\ 5040\ 4500\ 5500 dev.aibs.0.volt.3:\ 12278\ 10200\ 13800 dev.aibs.0.temp.0:\ 39.0C\ 60.0C\ 95.0C dev.aibs.0.temp.1:\ 38.0C\ 45.0C\ 75.0C dev.aibs.0.fan.0:\ 1053\ 600\ 7200 dev.aibs.0.fan.1:\ 1053\ 600\ 7200 \f[] .fi .PP Copy only `dev.MODULE.NUMBER' (if there is any number at all) and paste it into the \f[B]mobo_sensor\f[] option below. .PP Do the same for your cpu temperature, copy and paste the variable as is. \f[B]dev.cpu.0.temperature\f[] below is provied as example. .IP .nf \f[C] perl\ set.pl\ "freebsd" autoreconf\ \-\-install\ \-\-force \&./configure\ \-\-prefix=$HOME/.cache\ \-\-with\-x11\ \-\-without\-alsa\ \-\-with\-oss\ mobo_sensor=\[aq]dev.aibs.0\[aq]\ cpu_sensor=\[aq]dev.cpu.0.temperature\[aq] make make\ install \f[] .fi .PP Send a request to the FreeBSD mailing list and request the OpenBSD sensors API to be ported. .SS Installation in OpenBSD .PP Before proceeding, you'll have to: .IP .nf \f[C] #\ To\ detect\ the\ newer\ compiler\ that\ you\ are #\ about\ to\ install sed\ \-i\ \[aq]s/#AC_PROG_CC(/AC_PROG_CC(/g\[aq]\ configure.ac ls\ /usr/local/bin/automake\-* ls\ /usr/local/bin/autoconf\-* #\ Then\ replace\ the\ numbers\ below export\ AUTOCONF_VERSION=2.69 export\ AUTOMAKE_VERSION=1.15 #\ Your\ call,\ gcc\ or\ llvm\ ? pkg_add\ gcc #\ after\ that: perl\ set.pl\ "openbsd" autoreconf\ \-\-install\ \-\-force \&./configure\ \-\-prefix=$HOME/.cache\ \-\-without\-alsa\ \-\-with\-oss make make\ install \f[] .fi .SS pinky curses installation .PP Step one, compile pinky\-bar \f[B]\[en]with\-ncurses\f[], so the output to be formated in a way that pinky\-curses can parse and colorize. .IP .nf \f[C] perl\ set.pl\ "distro" autoreconf\ \-\-install\ \-\-force #\ disable\ X11,\ enable\ the\ colours\ and\ ncurses\ opts. \&./configure\ \-\-prefix=$HOME/.cache\ \-\-without\-x11\ \-\-with\-alsa\ \-\-with\-colours\ \-\-with\-ncurses #\ compile\ \[aq]n\ install make make\ install \f[] .fi .PP Step two, compile and install pinky\-curses \- https://notabug.org/void0/pinky\-curses .PP Copy the code from extra/scripts/pinky\-curses.sh .SS pinky urxvt .PP What a coincidence, pinky\-urxvt is my 3rd urxvt extension and 3rd member of the pinky family. .PP The sole purpose of this urxvt extension is to make it easy for you to keep track of things that you are interested to monitor while hacking your way something in the terminal. .PP Link \- https://notabug.org/void0/pinky\-urxvt .PP [IMAGE: image (https://notabug.org/void0/pinky-urxvt/raw/master/2.png)] .PP pinky\-urxvt, and pinky\-curses are not tied to pinky\-bar. .SS Installation for anything else .PP pinky\-bar is no longer tied to Window Managers only. With the addition of \[lq]without colours\[rq], the output can be shown in any program, just bear in mind that the more options you've supplied the more system information will be shown. .PP The tmux status bar in action: .PP [IMAGE: image (img/pic4.png)] .PP The installation steps: .IP .nf \f[C] perl\ set.pl\ "distro" autoreconf\ \-\-install\ \-\-force \&./configure\ \-\-prefix=$HOME/.cache\ \-\-without\-x11\ \-\-without\-colours make make\ install \f[] .fi .PP By choosing this 3rd installation method it is up to you where, how to start and use the system information that's produced by pinky\-bar. .PP * * * * * .PP Replace \f[B]distro\f[] with archlinux, debian, gentoo, slackware, rhel, frugalware, angstrom. Here's some short distros list of some popular distros that are based on another one: .IP \[bu] 2 [x] archlinux based distros: parabola, chakra, manjaro .IP \[bu] 2 [x] debian based distros: ubuntu, linux mint, trisquel, back track, kali linux, peppermint linux, solusos, crunchbang, deepin, elementary os, and the rest *buntu based distros .IP \[bu] 2 [x] gentoo based distros: funtoo, sabayon, calculate linux .IP \[bu] 2 [x] slackware .IP \[bu] 2 [x] rhel based distros: opensuse (uses rpm), fedora, fuduntu, mandriva, mandrake, viperr, mageia .IP \[bu] 2 [x] frugalware .IP \[bu] 2 [x] angstrom .PP Cannot list the *BSD flavours as \[lq]distros\[rq], so they deserve own options: .IP \[bu] 2 [x] freebsd .IP \[bu] 2 [x] openbsd .PP * * * * * .SS Using configuration file .PP \f[B]~/.pinky\f[] is the location of the configuration file. It uses the same short and long command line options. .PP I do advise you to use the long options syntax. .PP If any option depends on argument, don't put any space between the option and the argument. .PP Use one option per line. Contrary to your shell, the \[lq]parser\[rq] won't expand ~/my_script.pl to point to /home/sweethome/my_script.pl .IP .nf \f[C] \-\-weather=London,uk \-\-coresload \-\-cputemp \-\-ramperc \-\-driveperc \-\-packages \-\-kernel \-\-voltage \-\-fans \-\-mobo \-\-mobotemp \-\-perl=/home/sweethome/my_script.pl \f[] .fi .PP Execute the program without supplying any command line options and it will parse the configuration file. .PP * * * * * .SS Linux Mandatory requirements .IP \[bu] 2 gcc/clang .IP \[bu] 2 glibc .IP \[bu] 2 autoconf .IP \[bu] 2 automake .IP \[bu] 2 m4 .IP \[bu] 2 gawk .IP \[bu] 2 perl .SS *BSD Mandatory requirements .IP \[bu] 2 gcc/clang .IP \[bu] 2 autoconf .IP \[bu] 2 automake .IP \[bu] 2 autoconf\-wrapper .IP \[bu] 2 automake\-wrapper .IP \[bu] 2 autoconf\-archive .IP \[bu] 2 argp\-standalone .IP \[bu] 2 libtool .IP \[bu] 2 m4 .IP \[bu] 2 gawk .IP \[bu] 2 perl .PP Some llvm and gcc versions will not check for headers and libraries in /usr/local, if that's the case for you, you should export the following environment variables: .IP .nf \f[C] export\ LDFLAGS=\[aq]\-L/usr/local/lib\[aq] export\ CFLAGS=\[aq]\-I/usr/local/include\[aq] \f[] .fi .PP After editing the wrong prototype I managed to stumble upon a bug in OpenBSD's own libc. .PP \f[B]Warning !!! OpenBSD users !!!\f[] .PP The majority of SCN* macros differs from their PRI* cousins. And I cannot guarantee the accuracy of fixed width integers when OpenBSD own libc managed to use different format specifiers. Read extra/misc/openbsd_bugs.md for more details. .SS Opt\-in requirements .PP Linux camp: .PP The internet related options rely on headers provided iproute2. By default the program will try to compile with those headers included. If for any reason you would like to compile the program without internet related options, then pass \f[B]\[en]without\-net\f[] to configure. .IP \[bu] 2 iproute2 .PP wifi/wireless chipsets supporting mac80211/cfg80211: .IP \[bu] 2 libnl (>= 3.0) .IP \[bu] 2 pkg\-config .PP In Gentoo there are two versions of pkg\-config. The first one is named dev\-util/pkgconfig and the second one is dev\-ruby/pkg\-config. In order to use the first one, you'll have to export the pkg\-config path to the following environment variable: .IP .nf \f[C] export\ PKG_CONFIG_PATH=/usr/bin/pkg\-config \f[] .fi .PP Then pass \f[B]\[en]with\-libnl\f[] to configure. .PP To get the NIC vendor and model names: .IP \[bu] 2 pciutils .PP Alternative way to obtain data from the sensors: .IP \[bu] 2 lm_sensors .PP To read the drive temperature from S.M.A.R.T \f[B]\[en]with\-drivetemp\f[]: .IP \[bu] 2 hddtemp .IP \[bu] 2 curl .PP To read the drive temperature from S.M.A.R.T \f[B]\[en]with\-drivetemp\-light\f[]: .IP \[bu] 2 hddtemp .PP The \[lq]light\[rq] version does not rely on curl, and will not force \-O0 CFLAGS. .IP .nf \f[C] #\ \-\-with\-drivetemp\-light 0.00s\ user\ 0.00s\ system\ 15%\ cpu\ 0.006 #\ \-\-with\-drivetemp 0.01s\ user\ 0.00s\ system\ 72%\ cpu\ 0.008 \f[] .fi .PP Try running hddtemp to see if it detects your drive, depending if it has temperature sensor in first place: .IP .nf \f[C] sudo\ hddtemp\ /dev/sda WARNING:\ Drive\ /dev/sda\ doesn\[aq]t\ appear\ in\ the\ database\ of\ supported\ drives WARNING:\ But\ using\ a\ common\ value,\ it\ reports\ something. WARNING:\ Note\ that\ the\ temperature\ shown\ could\ be\ wrong. WARNING:\ See\ \-\-help,\ \-\-debug\ and\ \-\-drivebase\ options. WARNING:\ And\ don\[aq]t\ forget\ you\ can\ add\ your\ drive\ to\ hddtemp.db /dev/sda:\ Corsair\ Force\ GT:\ \ 23°C\ or\ °F \f[] .fi .PP The message is pretty clear \[lq]don't forget to add your drive to hddtemp.db\[rq], first run the debug command to see which field is responsible to report your drive temperature, it should be in the range of 190 \- 200: .IP .nf \f[C] #\ Copy\ the\ Model:\ line sudo\ hddtemp\ \-\-debug\ /dev/sda =================\ hddtemp\ 0.3\-beta15\ ================== Model:\ Corsair\ Force\ GT field(1)\ \ \ \ \ \ \ \ \ =\ 0 field(5)\ \ \ \ \ \ \ \ \ =\ 0 field(9)\ \ \ \ \ \ \ \ \ =\ 253 field(12)\ \ \ \ \ \ \ \ =\ 237 field(171)\ \ \ \ \ \ \ =\ 0 field(172)\ \ \ \ \ \ \ =\ 0 field(174)\ \ \ \ \ \ \ =\ 147 field(177)\ \ \ \ \ \ \ =\ 1 field(181)\ \ \ \ \ \ \ =\ 0 field(182)\ \ \ \ \ \ \ =\ 0 field(187)\ \ \ \ \ \ \ =\ 0 field(194)\ \ \ \ \ \ \ =\ 22 field(195)\ \ \ \ \ \ \ =\ 0 field(196)\ \ \ \ \ \ \ =\ 0 field(201)\ \ \ \ \ \ \ =\ 0 field(204)\ \ \ \ \ \ \ =\ 0 field(230)\ \ \ \ \ \ \ =\ 100 field(231)\ \ \ \ \ \ \ =\ 0 field(233)\ \ \ \ \ \ \ =\ 130 field(234)\ \ \ \ \ \ \ =\ 216 field(241)\ \ \ \ \ \ \ =\ 216 field(242)\ \ \ \ \ \ \ =\ 151 \f[] .fi .PP Open up \f[B]/usr/share/hddtemp/hddtemp.db\f[] and append the Model: line that you copied earlier with the correct field that reports your drive temperature. .IP .nf \f[C] "Corsair\ Force\ GT"\ 194\ C\ "Corsair\ Force\ GT\ 120GB\ SSD" \f[] .fi .PP Next run hddtemp in daemon mode so we can request the temperature back: .IP .nf \f[C] sudo\ hddtemp\ \-d\ /dev/sda \f[] .fi .PP Open up your browser and navigate to 127.0.0.1:7634 and you'll get instant temperature report back to you. .PP The \[lq]init\[rq] lock\-in for those of you that cannot choose between udev or eudev puts me in position not rely on libatasmart, regardless how neat the library is. There is stripped example program in extra/misc/skdump.c if you are curious to check and test libatasmart. .PP Linux camp end. .PP To read the drive temperature from S.M.A.R.T \f[B]\[en]with\-smartemp\f[]: .IP \[bu] 2 smartmontools .PP smartmontools are not mandatory in OpenBSD, \f[C]atactl\f[] does the same job. .PP Execute the following command as root \f[C]visudo\f[] and append: .IP .nf \f[C] #\ \[aq]frost\[aq]\ is\ my\ computer\ username frost\ ALL=NOPASSWD:/usr/sbin/smartctl \f[] .fi .PP Copy the code from extra/scripts/drive\-temperature.sh or \f[C]exec\f[] it from \f[B]xinitrc\f[] or the script used to start your DE/WM. .PP To extend pinkybar with your own crafted perl/python/ruby/lua script: .IP \[bu] 2 perl .IP \[bu] 2 python == 2.7 (\[en]with\-python2) .IP \[bu] 2 python >= 3.3 (\[en]with\-python3) .IP \[bu] 2 lua >= 5.1 .IP \[bu] 2 ruby >= 2.0 and pkg\-config .PP Have a look at extra/scripts/pinky.{py,pl,ruby,lua}, they serve as examples how to write the most basic scripts in order to extend pinkybar in python/perl/ruby/lua. You can use the 3 languages simultaneously. .PP Please, please do \f[B]NOT\f[] export or set PYTHONPATH on it's own line. .PP \f[C]WRONG\f[]: .IP .nf \f[C] export\ PYTHONPATH=/meh pinkybar\ \-\-python\ my_script \f[] .fi .PP \f[C]WRONG\f[]: .IP .nf \f[C] PYTHONPATH=/meh pinkybar\ \-\-python\ my_script \f[] .fi .PP Correct PYTHONPATH usage: .IP .nf \f[C] #\ ~/chewbacca\ is\ the\ path\ where\ pinky.py\ resides #\ ~/chewbacca/pinky.py #\ python2 PYTHONPATH=~/chewbacca\ ~/pinkybar\ \-\-python\ pinky #\ python3 #\ executed\ only\ once fuNky=$(python3\ \-c\ \[aq]import\ sys;print(":".join([x\ for\ x\ in\ sys.path]))\[aq]) #\ executed\ in\ a\ loop PYTHONPATH=$fuNky:~/chewbacca\ ~/pinkybar\ \-\-python\ pinky \f[] .fi .PP \f[B]\[en]with\-perl\f[]: .IP .nf \f[C] ~/pinkybar\ \-\-perl\ ~/chewbacca/pinky.pl \f[] .fi .PP \f[B]\[en]with\-ruby\f[]: .IP .nf \f[C] ~/pinkybar\ \-\-ruby\ ~/chewbacca/pinky.rb \f[] .fi .PP \f[B]\[en]with\-lua\f[]: .PP Non byte\-compiled script: .IP .nf \f[C] ~/pinkybar\ \-\-lua\ ~/chewbacca/pinky.lua \f[] .fi .PP Once done editing your script, you can byte\-compile it: .IP .nf \f[C] luac\ \-o\ pinky.luac\ pinky.lua ~/pinkybar\ \-\-lua\ ~/chewbacca/pinky.luac\ #\ <\-\-\ .luac\ and\ not\ .lua \f[] .fi .PP To get the sound volume level: .IP \[bu] 2 alsa\-utils .IP \[bu] 2 alsa\-lib .PP Then pass \f[B]\[en]with\-alsa\f[] to configure. .PP *BSD users can use the baked OSS instead, pass \f[B]\[en]without\-alsa \[en]with\-oss\f[] to configure instead. .PP To output the data to the terminal using the ncurses library: .IP \[bu] 2 ncurses .PP To get the vendor and model name of your cdrom/dvdrom/blu\-ray: .IP \[bu] 2 libcdio .IP \[bu] 2 libcddb .PP In linux \f[B]\[en]without\-dvd\f[] will still compile the program with dvd support. Except it will be limited only to dvd support, it will try to parse the sr0 vendor and model name detected by the kernel. .PP The weather related options, please go back and read \f[B]Don't just rush to register yourself\f[]: .IP \[bu] 2 curl .IP \[bu] 2 gzip .PP \f[B]Warning, I'm not responsible for any lawsuit towards you, neither encourage you to pirate content that is not licensed as free and/or for fair use.\f[] .PP To see the currently played song name \f[B]\[en]with\-mpd\f[]: .PP Server side: .IP \[bu] 2 mpd (can be build with soundcloud support) .PP Client side: .IP \[bu] 2 libmpdclient .IP \[bu] 2 mpc/ncmpc/ncmpcpp, and the rest (http://mpd.wikia.com/wiki/Clients) .PP To see the currently played song name \f[B]\[en]without\-mpd\f[]: .IP \[bu] 2 cmus .PP The \[lq]soundcloud\[rq] alternative that is supported in cmus and your mpd client will be to download \f[B]\&.m3u/.pls\f[] files according to the radio stream station (https://www.internet-radio.com) that you are interested to listen. .PP The FreeBSD users will notice that \[lq]mpd\[rq] is named \[lq]musicpd\[rq]. .PP If you've never used mpd before copy the example configuration from extra/mpd according to your OS. .PP Keep an eye on the \f[B]log file size\f[] if you are using raspberry pi (or equivalent device) that streams the music, make sure that it's deleted automatically if it exceeds some pre\-defined size. .PP * * * * * .SS WM specific requirements .PP If you would like the output to be shown in your Window Manager, those are the following requirements: .PP for non\-dwm WM: .IP \[bu] 2 dzen2 .PP for dwm: .IP \[bu] 2 libx11 .IP \[bu] 2 xorg\-server .PP use \f[B]\[en]without\-colours\f[] to skip the following step: .IP \[bu] 2 dwm compiled with statuscolor patch. The colours in use are specified in your dwm config.h .SS Wish list .PP It would be great if I had *BSD compatible usb wifi dongle or wireless pci adapter to add wifi options in pinky\-bar. .SH REPORTING BUGS .PP Report bugs to https://gitlab.com/void0/pinky\-bar .SH COPYRIGHT .PP Copyright (c) 2016 Aaron Caffrey .PD 0 .P .PD Free use of this software is granted under the terms of the GNU General Public License (GPL). .SH AUTHORS Aaron Caffrey.
void0/pinky
doc/pinkybar.1
1
unknown
28,820
\input texinfo @setfilename pinkybar.info @documentencoding UTF-8 @ifnottex @paragraphindent 0 @end ifnottex @titlepage @title pinkybar(1) manual @author Aaron Caffrey Oktoberfest 23, 2016 @end titlepage @node Top @top pinkybar(1) manual @menu * NAME:: * SYNOPSIS:: * DESCRIPTION:: * REPORTING BUGS:: * COPYRIGHT:: @end menu @node NAME @chapter NAME @anchor{#name} This man page is converted from markdown, and some information might not look good and/or have been stripped during the automated process. @node SYNOPSIS @chapter SYNOPSIS @anchor{#synopsis} pinkybar [@emph{option}] @node DESCRIPTION @chapter DESCRIPTION @anchor{#description} Gather some system information and show it in this statusbar program, not tied to any Window Manager, terminal multiplexer, etc. Please note that the program won't detect fans connected via molex connetor(s) or external fan controller. Also I have not tested it with fan splitter(s) either. The program is smart enough to detect whether some of your fan(s) blades are spinning, or the particular fan have been removed. Hold down some of your fan blades and you'll see that the program won't include this fan and it's RPM, release the blades and you'll see the fan and it's RPM in the statusbar. Try simulating real fan hardware failure by holding down all system fan blades and watch what the program will show you, just try not to slice your cheesy fingers open in the process. You can extend pinky-bar with your own crafted perl/python/ruby/lua script. If you compile your kernel from source code make sure to include your cpu and motherboard sensors as @strong{modules} and not inlined. @strong{Just an example if you use BSD - acpi/aibs, coretemp/amdtemp.} @float @image{img/cpu-temp,,,,png} @end float @float @image{img/mobo-temp,,,,png} @end float @iftex @bigskip@hrule@bigskip @end iftex @ifnottex ------------------------------------------------------------------------ @end ifnottex @menu * Program options:: * GNU Build System configure options:: * Installation for dwm:: * Installation for xmonad or other WM:: * Installation in FreeBSD:: * Installation in OpenBSD:: * pinky curses installation:: * pinky urxvt:: * Installation for anything else:: * Using configuration file:: * Linux Mandatory requirements:: * *BSD Mandatory requirements:: * Opt-in requirements:: * WM specific requirements:: * Wish list:: @end menu @node Program options @section Program options @anchor{#program-options} The order of supplied options will dictate how, where and what system information to be shown. @multitable {short option} {--driveavail} {Detect your CPU vendor, stepping, family, clflush, l1/l2 cache and line size, physical cores, physical and virtual bits. Uses assembly.} @headitem short option @tab long option @tab Descrtiption @item -M @tab --mpd @tab The song filename @item -W @tab --mpdtrack @tab The song track name (not available in cmus) @item -x @tab --mpdartist @tab The song artist(s) name(s) @item -X @tab --mpdtitle @tab The song title @item -y @tab --mpdalbum @tab The song album name @item -Y @tab --mpddate @tab The song date @item -c @tab --cpu @tab The current cpu load (summed up all cores/threads) @item -L @tab --coresload @tab Show the load regarding each individual cpu core/thread @item -T @tab --cputemp @tab The current cpu temperature @item -C @tab --cpuspeed @tab Show your maximum cpu clock speed in MHz, regardless of the used governor. Uses assembly. @item -I @tab --cpuinfo @tab Detect your CPU vendor, stepping, family, clflush, l1/l2 cache and line size, physical cores, physical and virtual bits. Uses assembly. @item -r @tab --ramperc @tab The used ram in percentage @item -J @tab --ramtotal @tab The total ram @item -K @tab --ramfree @tab The free ram @item -l @tab --ramshared @tab The shared ram @item -o @tab --rambuffer @tab The buffer ram (not available in OpenBSD) @item -s @tab --driveperc @tab The used drive storage in percentage @item -n @tab --drivetotal @tab The total drive storage @item -N @tab --drivefree @tab The free drive storage @item -O @tab --driveavail @tab The available drive storage (total - used) @item --drivetemp @tab Read the drive temperature from S.M.A.R.T @item -g @tab --battery @tab The remaining battery charge @item -z @tab --dvdstr @tab The vendor and model name of your cdrom/dvdrom @item -S @tab --statio @tab Read and written MBs to the drive so far [argument - sda] @item -p @tab --packages @tab The number of installed packages @item -P @tab --kernsys @tab The kernel name @item --kernode @tab The network node hostname @item -Q @tab --kernrel @tab The kernel release @item -R @tab --kernver @tab The kernel version @item -u @tab --kernarch @tab The machine architecture @item -k @tab --kernel @tab Combined kernel name and version @item --perl @tab Extend pinkybar with your scripts written in perl, learn more from the Opt-in section. @item --python @tab Extend pinkybar with your scripts written in python, learn more from the Opt-in section. @item --ruby @tab Extend pinkybar with your scripts written in ruby, learn more from the Opt-in section. @item --lua @tab Extend pinkybar with your scripts written in lua, learn more from the Opt-in section. @item -q @tab --weather @tab Show the temperature outside [argument - London,uk] @item -U @tab --uptime @tab The system uptime @item -w @tab --loadavg @tab The system average load for past 1, 5 and 15 minutes @item -v @tab --voltage @tab The system voltage @item -f @tab --fans @tab All system fans and their speed in RPM @item -m @tab --mobo @tab Show the motherboard name and vendor @item -d @tab --mobotemp @tab The motherboard temperature @item -V @tab --volume @tab The sound volume level @item -t @tab --time @tab The current time @item -a @tab --ipaddr @tab The local ip address [argument - eth0] @item -b @tab --bandwidth @tab The consumed internet bandwidth so far [argument - eth0] @item -i @tab --iface @tab The current download and upload speed [argument - eth0] @item -A @tab --ipmac @tab The NIC mac address [argument - eth0] @item -B @tab --ipmask @tab The NIC subnet mask [argument - eth0] @item -D @tab --ipcast @tab The NIC broadcast address [argument - eth0] @item -E @tab --iplookup @tab Mini website IP lookup [website argument - google.com] @end multitable Be aware of the options that mention @strong{Uses assembly} are tested only on AMD and Intel CPUs (starting from pentium 4 onwards). The following options are available only in Linux: @multitable {short option} {--drivemodel} {The name of currently connected wifi/wireless network [argument - wlan0]} @headitem short option @tab long option @tab Descrtiption @item -F @tab --drivemodel @tab The vendor name of your drive [argument - sda] @item -G @tab --nicinfo @tab The NIC vendor and model [argument - eth0] @item --nicdrv @tab The NIC driver [argument - eth0] @item -H @tab --nicver @tab The NIC version [argument - eth0] @item -e @tab --iplink @tab The NIC link speed (useful for wireless/wifi) [argument - eth0] @item -j @tab --nicfw @tab The NIC firmware [argument - eth0] @item -h @tab --wifiname @tab The name of currently connected wifi/wireless network [argument - wlan0] @end multitable The following options are available only to FreeBSD and OpenBSD: @multitable {short option} {--swapavail} {The NIC gateway address [argument - re0]} @headitem short option @tab long option @tab Descrtiption @item -j @tab --nicgw @tab The NIC gateway address [argument - re0] @item -Z @tab --swapused @tab The used drive swap in MB @item -F @tab --swaperc @tab The used drive swap in percentage @item -h @tab --swaptotal @tab The total drive swap @item -H @tab --swapavail @tab The available drive swap (total - used) @end multitable The following options are available only in OpenBSD: @multitable {short option} {long option} {The used ram in MB} @headitem short option @tab long option @tab Descrtiption @item -l @tab --ramused @tab The used ram in MB @end multitable @iftex @bigskip@hrule@bigskip @end iftex @ifnottex ------------------------------------------------------------------------ @end ifnottex @node GNU Build System configure options @section GNU Build System (configure) options @anchor{#gnu-build-system-configure-options} Before the source code is passed to the compiler, you can enable/disable the following @strong{configure} options that will increase/reduce the number of dependencies required to compile the program. It's up to you to decide which features suit you best. @multitable {cpu_sensor=`dev.cpu.0.temperature'} {--without-drivetemp-light} {Different TCP port to listen to for the drive temperature, default one is 7634, must be combined @strong{--with-drivetemp} or @strong{--with-drivetemp-light}} @headitem To include @tab Not to include @tab Descrtiption @item --with-x11 @tab --without-x11 @tab Enable it if you are using dwm. @item --with-alsa @tab --without-alsa @tab To get the sound volume level. @item --with-oss @tab --without-oss @tab To get the sound volume level in *BSD. @item --with-net @tab --without-net @tab Enable the internet related options. @item --with-libnl @tab --without-libnl @tab Enable the wifi related options regarding chipsets supporting the cfg80211/mac80211 modules (linux only). @item --with-pci @tab --without-pci @tab To get the NIC vendor and model in linux @item --with-dvd @tab --without-dvd @tab To get the cdrom/dvdrom vendor and model @item --with-sensors @tab --without-sensors @tab Alternative way to get data from the sensors (linux only) @item --with-apm @tab --without-apm @tab APM power and resource management for laptops (FreeBSD only) @item --with-ncurses @tab --without-ncurses @tab Output the data to the terminal using the ncurses library, can be colorized @item --with-perl @tab --without-perl @tab Extend pinkybar with your own crafted scripts written in perl @item --with-lua @tab --without-lua @tab Extend pinkybar with your own crafted scripts written in lua @item --with-ruby @tab --without-ruby @tab Extend pinkybar with your own crafted scripts written in ruby @item --with-python2 @tab --without-python2 @tab Extend pinkybar with your own crafted scripts written in python2 @item --with-python3 @tab --without-python3 @tab Extend pinkybar with your own crafted scripts written in python3 @item --with-weather @tab --without-weather @tab The temperature outside (some details must be provided) @item api_key=`123458976' @tab @tab API key obtained after registering yourself in the weather website, must be combined @strong{--with-weather} @item --with-smartemp @tab --without-smartemp @tab Read the drive temperature from S.M.A.R.T cross-platform available @item --with-drivetemp @tab --without-drivetemp @tab Read the drive temperature from S.M.A.R.T (linux only) uses curl @item --with-drivetemp-light @tab --without-drivetemp-light @tab Read the drive temperature from S.M.A.R.T (linux only) light version @item drive_port=`1234' @tab @tab Different TCP port to listen to for the drive temperature, default one is 7634, must be combined @strong{--with-drivetemp} or @strong{--with-drivetemp-light} @item --with-colours @tab --without-colours @tab Colorize the output data. @item icons=/tmp @tab @tab xbm icons that can be used by dzen2 for example. Discarded when @strong{--with-x11} is used @item --with-mpd @tab --without-mpd @tab To see the currently played song name (if any). @item --prefix=/tmp @tab @tab The directory where the program will be installed @item mobo_sensor=`dev.aibs.0' @tab @tab FreeBSD motherboard sensor module name to use in the sysctl calls. Read the FreeBSD installation below @item cpu_sensor=`dev.cpu.0.temperature' @tab @tab FreeBSD cpu temperature module name to use in the sysctl calls . Read the FreeBSD installation below @end multitable By default, if @strong{no} options are passed, the program will be compiled with: @verbatim --with-net --with-pci @end verbatim Affects only FreeBSD users with laptops, @strong{--without-apm} will compile the program with acpi support to obtain the current battery life. @strong{--without-mpd} will compile the program with cmus support, the options syntax stays as is. The pci and sensors configure options will be discarded in *BSD. Affects only linux users with wifi/wireless chipsets, run @code{lsmod|grep 802} and see whether your chipset uses cfg80211/mac80211. If that's so you can rely on libnl and enable @strong{--with-libnl} configure options, otherwise your chipset probably still uses we/wext, so type @strong{--without-libnl}. Affects only linux users, @strong{--with-drivetemp} pretty much locks you down to hddtemp. You can adjust @strong{extra/scripts/drive-temperature.sh} and compile the program @strong{--with-smartemp}, so you can switch between hddtemp and smartmontools at any time without the need recompile pinkybar with different options. @strong{--with-smartemp} only cares for the existance of /tmp/pinkytemp file. @strong{--with-weather} is using @uref{http://openweathermap.org/current,this url}, register yourself there, create a new @uref{https://home.openweathermap.org/api_keys,API key}. Don't just rush to register yourself, read carefully what the ``Free'' account limits are and take in account how often the program should call their api service. I'm not responsible if you exceeded the limits, you've been warned. @verbatim # Make sure it's working first # curl 'http://api.openweathermap.org/data/2.5/weather?q=London,uk&units=metric&APPID=28459ae16e4b3a7e5628ff21f4907b6f' # what to pass to configure --with-weather api_key='28459ae16e4b3a7e5628ff21f4907b6f' @end verbatim @iftex @bigskip@hrule@bigskip @end iftex @ifnottex ------------------------------------------------------------------------ @end ifnottex @node Installation for dwm @section Installation for dwm @anchor{#installation-for-dwm} @verbatim perl set.pl "distro" autoreconf --install --force ./configure --prefix=$HOME/.cache --with-x11 make make install @end verbatim Copy the code from extra/scripts/dwm.sh or @code{exec} it from @strong{xinitrc} or the script used to start dwm. @node Installation for xmonad or other WM @section Installation for xmonad (or other WM) @anchor{#installation-for-xmonad-or-other-wm} @verbatim # Copy the xbm icons mkdir -p --mode=700 $HOME/.xmonad/icons cp -r extra/xbm_icons/*.xbm $HOME/.xmonad/icons perl set.pl "distro" autoreconf --install --force # disable X11, point the location to the icons ./configure --prefix=$HOME/.cache --without-x11 icons=$HOME/.xmonad/icons # compile 'n install make make install @end verbatim Copy the code from extra/scripts/xmonad.sh or @code{exec} it from @strong{xinitrc} or the script used to start xmonad. @node Installation in FreeBSD @section Installation in FreeBSD @anchor{#installation-in-freebsd} FreeBSD has no other way than using the module specific convention to query sysctl and obtain data from the sensors. Maintaining a list with all the possible module names and performing expensive sysctl calls in a loop to determine that X module is loaded into your system is no-go. Be prepared to spend a minute or two to find out some system information. Determine the motherboard sensor module name. @verbatim sysctl -a|grep 'aibs' dev.aibs.0.volt.0: 1356 850 1600 dev.aibs.0.volt.1: 3344 2970 3630 dev.aibs.0.volt.2: 5040 4500 5500 dev.aibs.0.volt.3: 12278 10200 13800 dev.aibs.0.temp.0: 39.0C 60.0C 95.0C dev.aibs.0.temp.1: 38.0C 45.0C 75.0C dev.aibs.0.fan.0: 1053 600 7200 dev.aibs.0.fan.1: 1053 600 7200 @end verbatim Copy only `dev.MODULE.NUMBER' (if there is any number at all) and paste it into the @strong{mobo_sensor} option below. Do the same for your cpu temperature, copy and paste the variable as is. @strong{dev.cpu.0.temperature} below is provied as example. @verbatim perl set.pl "freebsd" autoreconf --install --force ./configure --prefix=$HOME/.cache --with-x11 --without-alsa --with-oss mobo_sensor='dev.aibs.0' cpu_sensor='dev.cpu.0.temperature' make make install @end verbatim Send a request to the FreeBSD mailing list and request the OpenBSD sensors API to be ported. @node Installation in OpenBSD @section Installation in OpenBSD @anchor{#installation-in-openbsd} Before proceeding, you'll have to: @verbatim # To detect the newer compiler that you are # about to install sed -i 's/#AC_PROG_CC(/AC_PROG_CC(/g' configure.ac ls /usr/local/bin/automake-* ls /usr/local/bin/autoconf-* # Then replace the numbers below export AUTOCONF_VERSION=2.69 export AUTOMAKE_VERSION=1.15 # Your call, gcc or llvm ? pkg_add gcc # after that: perl set.pl "openbsd" autoreconf --install --force ./configure --prefix=$HOME/.cache --without-alsa --with-oss make make install @end verbatim @node pinky curses installation @section pinky curses installation @anchor{#pinky-curses-installation} Step one, compile pinky-bar @strong{--with-ncurses}, so the output to be formated in a way that pinky-curses can parse and colorize. @verbatim perl set.pl "distro" autoreconf --install --force # disable X11, enable the colours and ncurses opts. ./configure --prefix=$HOME/.cache --without-x11 --with-alsa --with-colours --with-ncurses # compile 'n install make make install @end verbatim Step two, compile and install pinky-curses - https://notabug.org/void0/pinky-curses Copy the code from extra/scripts/pinky-curses.sh @node pinky urxvt @section pinky urxvt @anchor{#pinky-urxvt} What a coincidence, pinky-urxvt is my 3rd urxvt extension and 3rd member of the pinky family. The sole purpose of this urxvt extension is to make it easy for you to keep track of things that you are interested to monitor while hacking your way something in the terminal. Link - https://notabug.org/void0/pinky-urxvt @float @image{https://notabug.org/void0/pinky-urxvt/raw/master/2,,,,png} @end float pinky-urxvt, and pinky-curses are not tied to pinky-bar. @node Installation for anything else @section Installation for anything else @anchor{#installation-for-anything-else} pinky-bar is no longer tied to Window Managers only. With the addition of ``without colours'', the output can be shown in any program, just bear in mind that the more options you've supplied the more system information will be shown. The tmux status bar in action: @float @image{img/pic4,,,,png} @end float The installation steps: @verbatim perl set.pl "distro" autoreconf --install --force ./configure --prefix=$HOME/.cache --without-x11 --without-colours make make install @end verbatim By choosing this 3rd installation method it is up to you where, how to start and use the system information that's produced by pinky-bar. @iftex @bigskip@hrule@bigskip @end iftex @ifnottex ------------------------------------------------------------------------ @end ifnottex Replace @strong{distro} with archlinux, debian, gentoo, slackware, rhel, frugalware, angstrom. Here's some short distros list of some popular distros that are based on another one: @itemize @item [x] archlinux based distros: parabola, chakra, manjaro @item [x] debian based distros: ubuntu, linux mint, trisquel, back track, kali linux, peppermint linux, solusos, crunchbang, deepin, elementary os, and the rest *buntu based distros @item [x] gentoo based distros: funtoo, sabayon, calculate linux @item [x] slackware @item [x] rhel based distros: opensuse (uses rpm), fedora, fuduntu, mandriva, mandrake, viperr, mageia @item [x] frugalware @item [x] angstrom @end itemize Cannot list the *BSD flavours as ``distros'', so they deserve own options: @itemize @item [x] freebsd @item [x] openbsd @end itemize @iftex @bigskip@hrule@bigskip @end iftex @ifnottex ------------------------------------------------------------------------ @end ifnottex @node Using configuration file @section Using configuration file @anchor{#using-configuration-file} @strong{~/.pinky} is the location of the configuration file. It uses the same short and long command line options. I do advise you to use the long options syntax. If any option depends on argument, don't put any space between the option and the argument. Use one option per line. Contrary to your shell, the ``parser'' won't expand ~/my_script.pl to point to /home/sweethome/my_script.pl @verbatim --weather=London,uk --coresload --cputemp --ramperc --driveperc --packages --kernel --voltage --fans --mobo --mobotemp --perl=/home/sweethome/my_script.pl @end verbatim Execute the program without supplying any command line options and it will parse the configuration file. @iftex @bigskip@hrule@bigskip @end iftex @ifnottex ------------------------------------------------------------------------ @end ifnottex @node Linux Mandatory requirements @section Linux Mandatory requirements @anchor{#linux-mandatory-requirements} @itemize @item gcc/clang @item glibc @item autoconf @item automake @item m4 @item gawk @item perl @end itemize @node *BSD Mandatory requirements @section *BSD Mandatory requirements @anchor{#bsd-mandatory-requirements} @itemize @item gcc/clang @item autoconf @item automake @item autoconf-wrapper @item automake-wrapper @item autoconf-archive @item argp-standalone @item libtool @item m4 @item gawk @item perl @end itemize Some llvm and gcc versions will not check for headers and libraries in /usr/local, if that's the case for you, you should export the following environment variables: @verbatim export LDFLAGS='-L/usr/local/lib' export CFLAGS='-I/usr/local/include' @end verbatim After editing the wrong prototype I managed to stumble upon a bug in OpenBSD's own libc. @strong{Warning !!! OpenBSD users !!!} The majority of SCN* macros differs from their PRI* cousins. And I cannot guarantee the accuracy of fixed width integers when OpenBSD own libc managed to use different format specifiers. Read extra/misc/openbsd_bugs.md for more details. @node Opt-in requirements @section Opt-in requirements @anchor{#opt-in-requirements} Linux camp: The internet related options rely on headers provided iproute2. By default the program will try to compile with those headers included. If for any reason you would like to compile the program without internet related options, then pass @strong{--without-net} to configure. @itemize @item iproute2 @end itemize wifi/wireless chipsets supporting mac80211/cfg80211: @itemize @item libnl (>= 3.0) @item pkg-config @end itemize In Gentoo there are two versions of pkg-config. The first one is named dev-util/pkgconfig and the second one is dev-ruby/pkg-config. In order to use the first one, you'll have to export the pkg-config path to the following environment variable: @verbatim export PKG_CONFIG_PATH=/usr/bin/pkg-config @end verbatim Then pass @strong{--with-libnl} to configure. To get the NIC vendor and model names: @itemize @item pciutils @end itemize Alternative way to obtain data from the sensors: @itemize @item lm_sensors @end itemize To read the drive temperature from S.M.A.R.T @strong{--with-drivetemp}: @itemize @item hddtemp @item curl @end itemize To read the drive temperature from S.M.A.R.T @strong{--with-drivetemp-light}: @itemize @item hddtemp @end itemize The ``light'' version does not rely on curl, and will not force -O0 CFLAGS. @verbatim # --with-drivetemp-light 0.00s user 0.00s system 15% cpu 0.006 # --with-drivetemp 0.01s user 0.00s system 72% cpu 0.008 @end verbatim Try running hddtemp to see if it detects your drive, depending if it has temperature sensor in first place: @verbatim sudo hddtemp /dev/sda WARNING: Drive /dev/sda doesn't appear in the database of supported drives WARNING: But using a common value, it reports something. WARNING: Note that the temperature shown could be wrong. WARNING: See --help, --debug and --drivebase options. WARNING: And don't forget you can add your drive to hddtemp.db /dev/sda: Corsair Force GT: 23°C or °F @end verbatim The message is pretty clear ``don't forget to add your drive to hddtemp.db'', first run the debug command to see which field is responsible to report your drive temperature, it should be in the range of 190 - 200: @verbatim # Copy the Model: line sudo hddtemp --debug /dev/sda ================= hddtemp 0.3-beta15 ================== Model: Corsair Force GT field(1) = 0 field(5) = 0 field(9) = 253 field(12) = 237 field(171) = 0 field(172) = 0 field(174) = 147 field(177) = 1 field(181) = 0 field(182) = 0 field(187) = 0 field(194) = 22 field(195) = 0 field(196) = 0 field(201) = 0 field(204) = 0 field(230) = 100 field(231) = 0 field(233) = 130 field(234) = 216 field(241) = 216 field(242) = 151 @end verbatim Open up @strong{/usr/share/hddtemp/hddtemp.db} and append the Model: line that you copied earlier with the correct field that reports your drive temperature. @verbatim "Corsair Force GT" 194 C "Corsair Force GT 120GB SSD" @end verbatim Next run hddtemp in daemon mode so we can request the temperature back: @verbatim sudo hddtemp -d /dev/sda @end verbatim Open up your browser and navigate to 127.0.0.1:7634 and you'll get instant temperature report back to you. The ``init'' lock-in for those of you that cannot choose between udev or eudev puts me in position not rely on libatasmart, regardless how neat the library is. There is stripped example program in extra/misc/skdump.c if you are curious to check and test libatasmart. Linux camp end. To read the drive temperature from S.M.A.R.T @strong{--with-smartemp}: @itemize @item smartmontools @end itemize smartmontools are not mandatory in OpenBSD, @code{atactl} does the same job. Execute the following command as root @code{visudo} and append: @verbatim # 'frost' is my computer username frost ALL=NOPASSWD:/usr/sbin/smartctl @end verbatim Copy the code from extra/scripts/drive-temperature.sh or @code{exec} it from @strong{xinitrc} or the script used to start your DE/WM. To extend pinkybar with your own crafted perl/python/ruby/lua script: @itemize @item perl @item python == 2.7 (--with-python2) @item python >= 3.3 (--with-python3) @item lua >= 5.1 @item ruby >= 2.0 and pkg-config @end itemize Have a look at extra/scripts/pinky.@{py,pl,ruby,lua@}, they serve as examples how to write the most basic scripts in order to extend pinkybar in python/perl/ruby/lua. You can use the 3 languages simultaneously. Please, please do @strong{NOT} export or set PYTHONPATH on it's own line. @code{WRONG}: @verbatim export PYTHONPATH=/meh pinkybar --python my_script @end verbatim @code{WRONG}: @verbatim PYTHONPATH=/meh pinkybar --python my_script @end verbatim Correct PYTHONPATH usage: @verbatim # ~/chewbacca is the path where pinky.py resides # ~/chewbacca/pinky.py # python2 PYTHONPATH=~/chewbacca ~/pinkybar --python pinky # python3 # executed only once fuNky=$(python3 -c 'import sys;print(":".join([x for x in sys.path]))') # executed in a loop PYTHONPATH=$fuNky:~/chewbacca ~/pinkybar --python pinky @end verbatim @strong{--with-perl}: @verbatim ~/pinkybar --perl ~/chewbacca/pinky.pl @end verbatim @strong{--with-ruby}: @verbatim ~/pinkybar --ruby ~/chewbacca/pinky.rb @end verbatim @strong{--with-lua}: Non byte-compiled script: @verbatim ~/pinkybar --lua ~/chewbacca/pinky.lua @end verbatim Once done editing your script, you can byte-compile it: @verbatim luac -o pinky.luac pinky.lua ~/pinkybar --lua ~/chewbacca/pinky.luac # <-- .luac and not .lua @end verbatim To get the sound volume level: @itemize @item alsa-utils @item alsa-lib @end itemize Then pass @strong{--with-alsa} to configure. *BSD users can use the baked OSS instead, pass @strong{--without-alsa --with-oss} to configure instead. To output the data to the terminal using the ncurses library: @itemize @item ncurses @end itemize To get the vendor and model name of your cdrom/dvdrom/blu-ray: @itemize @item libcdio @item libcddb @end itemize In linux @strong{--without-dvd} will still compile the program with dvd support. Except it will be limited only to dvd support, it will try to parse the sr0 vendor and model name detected by the kernel. The weather related options, please go back and read @strong{Don't just rush to register yourself}: @itemize @item curl @item gzip @end itemize @strong{Warning, I'm not responsible for any lawsuit towards you, neither encourage you to pirate content that is not licensed as free and/or for fair use.} To see the currently played song name @strong{--with-mpd}: Server side: @itemize @item mpd (can be build with soundcloud support) @end itemize Client side: @itemize @item libmpdclient @item mpc/ncmpc/ncmpcpp, @uref{http://mpd.wikia.com/wiki/Clients,and the rest} @end itemize To see the currently played song name @strong{--without-mpd}: @itemize @item cmus @end itemize The ``soundcloud'' alternative that is supported in cmus and your mpd client will be to download @strong{.m3u/.pls} files according to the @uref{https://www.internet-radio.com,radio stream station} that you are interested to listen. The FreeBSD users will notice that ``mpd'' is named ``musicpd''. If you've never used mpd before copy the example configuration from extra/mpd according to your OS. Keep an eye on the @strong{log file size} if you are using raspberry pi (or equivalent device) that streams the music, make sure that it's deleted automatically if it exceeds some pre-defined size. @iftex @bigskip@hrule@bigskip @end iftex @ifnottex ------------------------------------------------------------------------ @end ifnottex @node WM specific requirements @section WM specific requirements @anchor{#wm-specific-requirements} If you would like the output to be shown in your Window Manager, those are the following requirements: for non-dwm WM: @itemize @item dzen2 @end itemize for dwm: @itemize @item libx11 @item xorg-server @end itemize use @strong{--without-colours} to skip the following step: @itemize @item dwm compiled with statuscolor patch. The colours in use are specified in your dwm config.h @end itemize @node Wish list @section Wish list @anchor{#wish-list} It would be great if I had *BSD compatible usb wifi dongle or wireless pci adapter to add wifi options in pinky-bar. @node REPORTING BUGS @chapter REPORTING BUGS @anchor{#reporting-bugs} Report bugs to https://gitlab.com/void0/pinky-bar @node COPYRIGHT @chapter COPYRIGHT @anchor{#copyright} Copyright (c) 2016 Aaron Caffrey@* Free use of this software is granted under the terms of the GNU General Public License (GPL). @bye
void0/pinky
doc/pinkybar.texi
texi
unknown
30,747
# Created by: Aaron Caffrey # $FreeBSD$ PORTNAME= pinky-bar PORTVERSION= 1.0.0 CATEGORIES= sysutils MAINTAINER= wifiextender@null.horse COMMENT= Gather some system information USE_GITHUB= yes GH_ACCOUNT= wifiextender GH_PROJECT= pinky-bar GH_TAGNAME= 4252f74 GNU_CONFIGURE= yes USE_XORG+= x11 LDFLAGS+= -L${LOCALBASE}/lib CFLAGS+= -I${LOCALBASE}/include CONFIGURE_ARGS= --without-pci --without-sensors CONFIGURE_ARGS+= --prefix=/usr/local icons=/usr/local/share/icons/xbm_icons LIB_DEPENDS= libargp.so:devel/argp-standalone BUILD_DEPENDS= git:devel/git tar:archivers/gtar gzip:archivers/gzip BUILD_DEPENDS+= gm4:devel/m4 libtool:devel/libtool autoconf:devel/autoconf BUILD_DEPENDS+= automake:devel/automake bash:shells/bash OPTIONS_DEFINE= X11 ALSA OSS NET DVD MPD COLOURS NCURSES OPTIONS_DEFAULT= OSS X11_CONFIGURE_WITH= x11 ALSA_CONFIGURE_WITH= alsa OSS_CONFIGURE_WITH= oss NET_CONFIGURE_WITH= net DVD_CONFIGURE_WITH= dvd MPD_CONFIGURE_WITH= mpd NCURSES_CONFIGURE_WITH= ncurses COLOURS_CONFIGURE_WITH= colours X11_DESC= Enable it if you are using dwm ALSA_DESC= To get the sound volume level OSS_DESC= The default way to get the sound volume level NET_DESC= Enable the internet related options DVD_DESC= To get the cdrom/dvdrom vendor and model names MPD_DESC= To see the currently played song name NCURSES_DESC= Output the data to the terminal using ncurses COLOURS_DESC= Colorize the output data X11_LIB_DEPENDS= libX11.so:x11/xorg ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib DVD_LIB_DEPENDS= libcdio.so:sysutils/libcdio libcddb.so:audio/libcddb NCURSES_LIB_DEPENDS= libncurses.so:devel/ncurses MPD_LIB_DEPENDS= libmpdclient.so:audio/libmpdclient .include <bsd.port.mk>
void0/pinky
extra/FreeBSD/Makefile
Makefile
unknown
2,285
Gather some system information and show it in this statusbar program, not tied to any Window Manager, terminal multiplexer, etc.
void0/pinky
extra/FreeBSD/pkg-descr
none
unknown
129
#!/usr/bin/env bash # Copyright 08/26/2016 # Aaron Caffrey https://github.com/wifiextender # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. cd work/pinky-bar-* chmod +x bootstrap ./bootstrap freebsd mkdir -p -m 755 '/usr/local/share/icons/xbm_icons' install -D -m644 xbm_icons/* '/usr/local/share/icons/xbm_icons' cd ../..
void0/pinky
extra/FreeBSD/scripts/post-extract
none
unknown
986
#!/usr/bin/env bash # Copyright 08/26/2016 # Aaron Caffrey https://github.com/wifiextender # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. make makesum
void0/pinky
extra/FreeBSD/scripts/post-fetch
none
unknown
813
#!/usr/bin/env bash # Copyright 08/26/2016 # Aaron Caffrey https://github.com/wifiextender # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. echo echo echo 'Please read the README' echo 'https://github.com/wifiextender/pinky-bar/blob/master/README.md' echo echo
void0/pinky
extra/FreeBSD/scripts/post-install
none
unknown
921
# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ EAPI=6 EGIT_REPO_URI="https://gitlab.com/void0/pinky-bar.git" inherit git-r3 DESCRIPTION="Standalone statusbar program utilizing ncurses" HOMEPAGE="https://gitlab.com/void0/pinky-bar" LICENSE="GPL-2" SLOT="0" DEPEND=" sys-devel/m4 sys-apps/gawk sys-devel/autoconf >=sys-devel/automake-1.14.1 " RDEPEND=" sys-libs/ncurses " src_prepare() { default einfo 'Generating Makefiles' chmod +x bootstrap ./bootstrap 'gentoo' } src_configure() { econf \ --without-alsa \ --without-x11 \ --without-mpd \ --without-net \ --without-pci \ --without-dvd \ --without-sensors \ --without-weather \ --with-ncurses \ --with-colours } src_compile() { emake 'ncurses' } src_install() { newbin "${S}"/src/ncurses pinky-curses } pkg_postinst() { einfo 'The program is not tied to pinky-bar. Heres some short introduction:' einfo 'Depending whether you enabled the colours: ^B - Blue , ^M - Magenta , ^Y - Yellow' einfo 'And here is the complete usage, copy and paste ready. Press CTRL + C to stop the program.' einfo 'while true; do echo "^BOh ^Mhello ^Ydear";sleep 1;done | /usr/bin/pinky-curses' }
void0/pinky
extra/Gentoo/app-admin/pinky-curses/pinky-curses-9999.ebuild
ebuild
unknown
1,239
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <maintainer type="project"> <email>office@gentoo.org</email> <name>Gentoo Office project</name> </maintainer> <upstream> <remote-id type="gitlab">pinky-bar</remote-id> </upstream> <use> <flag name="x11">Enable it if you are using dwm.</flag> <flag name="alsa">To get the sound volume level.</flag> <flag name="net">Enable the internet related options</flag> <flag name="libnl">Enable the wifi related options regarding chipsets supporting the cfg80211,mac80211 modules</flag> <flag name="pci">To get the NIC vendor and model names</flag> <flag name="dvd">To get the cdrom dvdrom vendor and model names</flag> <flag name="sensors">Alternative way to obtain data from the sensors</flag> <flag name="ncurses">Output the data to the terminal using the ncurses library</flag> <flag name="colours">Colorize the output data</flag> <flag name="weather">The temperature outside</flag> <flag name="mpd">To see the currently played song name</flag> <flag name="drivetemp">Read the drive temperature from S.M.A.R.T</flag> <flag name="drivetemp-light">Read the drive temperature from S.M.A.R.T light version</flag> <flag name="smartemp">Read the drive temperature from S.M.A.R.T</flag> <flag name="perl">Extend pinkybar with your own crafted scripts written in perl, stored in /usr/share/pinkysc/pinky.pl</flag> <flag name="python2">Extend pinkybar with your own crafted scripts written in python, stored in /usr/share/pinkysc/pinky.py</flag> </use> </pkgmetadata>
void0/pinky
extra/Gentoo/app-admin/pinky/metadata.xml
XML
unknown
1,620
# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ EAPI=6 EGIT_REPO_URI="https://gitlab.com/void0/pinky-bar.git" inherit git-r3 DESCRIPTION="Gather some system information and show it in this statusbar program" HOMEPAGE="https://gitlab.com/void0/pinky-bar" LICENSE="GPL-2" SLOT="0" IUSE="x11 alsa +net libnl +pci dvd sensors ncurses colours weather mpd drivetemp drivetemp-light smartemp perl python2" DEPEND=" sys-devel/m4 sys-apps/gawk sys-devel/autoconf >=sys-devel/automake-1.14.1 " RDEPEND=" alsa? ( media-libs/alsa-lib ) x11? ( x11-libs/libX11 ) net? ( sys-apps/iproute2 ) libnl? ( >=dev-libs/libnl-3.2.27 dev-util/pkgconfig ) pci? ( sys-apps/pciutils ) dvd? ( dev-libs/libcdio ) sensors? ( sys-apps/lm_sensors ) ncurses? ( sys-libs/ncurses ) weather? ( net-misc/curl app-arch/gzip ) mpd? ( media-sound/mpd media-libs/libmpdclient ) drivetemp? ( net-misc/curl app-admin/hddtemp ) drivetemp-light? ( app-admin/hddtemp ) smartemp? ( sys-apps/smartmontools ) python2? ( dev-lang/python:2.7= ) " REQUIRED_USE=" x11? ( !ncurses ) ncurses? ( !x11 ) drivetemp? ( !smartemp ) drivetemp-light? ( !smartemp ) smartemp? ( !drivetemp !drivetemp-light ) " pkg_setup() { if use weather then einfo 'Currently, the weather USE flag will default to London,uk' einfo 'To specify other country and town youll have to supply them as variable.' einfo 'Here is how: # TWN="London,uk" USE="weather" emerge -a ...' fi } src_prepare() { default einfo 'Generating Makefiles' chmod +x bootstrap ./bootstrap 'gentoo' } src_configure() { export PKG_CONFIG_PATH=/usr/bin/pkg-config econf \ $(use_with x11) \ $(use_with alsa) \ $(use_with net) \ $(use_with libnl) \ $(use_with pci) \ $(use_with dvd) \ $(use_with sensors) \ $(use_with ncurses) \ $(use_with colours) \ $(use_with weather) \ $(use_with mpd) \ $(use_with drivetemp) \ $(use_with drivetemp-light) \ $(use_with smartemp) \ $(use_with perl) \ $(use_with python2) \ perl_script='/usr/share/pinkysc/pinky.pl' \ python_script='/usr/share/pinkysc/pinky.py' \ api_town="${TWN:-London,uk}" \ api_key='28459ae16e4b3a7e5628ff21f4907b6f' \ icons='/usr/share/icons/xbm_icons' } src_compile() { emake 'all' } src_install() { if use colours && ! use x11 && ! use ncurses then insinto /usr/share/icons/xbm_icons doins "${S}"/extra/xbm_icons/* fi if use perl || use python2 then insinto /usr/share/pinkysc doins "${S}"/extra/scripts/pinky.{py,pl} fi emake DESTDIR="${D}" install } pkg_postinst() { use ncurses && \ einfo 'You can combine the output from this program with pinky-curses' use perl && \ einfo 'The perl script resides in /usr/share/pinkysc/pinky.pl' use python2 && \ einfo 'The python2 script resides in /usr/share/pinkysc/pinky.py' einfo 'Please read the program man page' }
void0/pinky
extra/Gentoo/app-admin/pinky/pinky-bar-9999.ebuild
ebuild
unknown
2,899
#compdef pinkybar # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # zsh completion # Cross-platform supported opts: _arguments -s -S -A '-*' : \ '-M[song filename]' \ '-W[song track name]' \ '-x[song artists names]' \ '-X[song title]' \ '-y[song album name]' \ '-Y[song date]' \ '-c[summed up cores load]' \ '-L[individual core load]' \ '-T[cpu temp]' \ '-C[max cpu clock speed]' \ '-I[long and detailed cpu info]' \ '-r[used ram]' \ '-J[total ram]' \ '-K[free ram]' \ '-l[shared ram]' \ '-o[buffered ram]' \ '-s[used drive storage]' \ '-n[total drive storage]' \ '-N[free drive storage]' \ '-O[available drive storage]' \ '-g[remaining battery charge]' \ '-z[dvdrom vendor and model names]' \ '-S[disk I/O, requires argument: sda]' \ '-p[num of installed packages]' \ '-P[kern name]' \ '-Q[network node hostname]' \ '-R[kern release]' \ '-u[kern version]' \ '-k[machine arch.]' \ '-q[combined kern name and version]' \ '-U[uptime]' \ '-w[average load]' \ '-v[voltage]' \ '-f[fans speed in RPM]' \ '-m[mobo name and vendor]' \ '-d[mobo temp.]' \ '-V[sound volume level]' \ '-t[current time]' \ '-a[ip addr, requires argument eth0]' \ '-b[consumed internet so far, requires argument eth0]' \ '-i[current download and upload speeds, requires argument eth0]' \ '-A[mac addr, requires argument eth0]' \ '-B[subnet mask, requires argument eth0]' \ '-D[broadcast addr, requires argument eth0]' \ '-E[website ip lookup, requires argument eth0]' # Linux opts # # '-F[vendor and model name of ur drive, requires argument sda]' \ # '-G[NIC vendor and model names, requires argument eth0]' \ # '--nicinfo[NIC driver, requires argument eth0]' \ # '-H[NIC version, requires argument eth0]' \ # '-e[NIC links speed, requires argument eth0]' \ # '-j[NIC firmware, requires argument eth0]' \ # '-h[wifi essid, requires argument eth0]' # FreeBSD and OpenBSD opts # # '-j[NIC gateway addr, requires argument re0]' \ # '-Z[used drive swap in MB]' \ # '-F[used drive swap in percentage]' \ # '-h[total drive swap]' \ # '-H[available drive swap]' # OpenBSD opts # #'-l[used ram in MB]'
void0/pinky
extra/bash_zsh/_pinkybar
none
unknown
2,730
# 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # bash completion _pinky() { local cur COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" opts1='-a -b -c -d -e -f -g -h -i -j -k -l -m -n -o -p -q -r -s -t -u -v -w -x -y -z' opts2='-A -B -C -D -E -F -G -H -I -J -K -L -M -N -O -P -Q -R -S -T -U -V -W -X -Y -Z' opts3='--mpd --mpdtrack --mpdartist --mpdalbum --cpu --coresload --cputemp --cpuspeed' opts3+='--cpuinfo --ramperc --ramtotal --ramfree --ramshared --rambuffer --driveperc' opts3+='--drivetemp --drivetotal --drivefree --driveavail --battery --dvdstr --statio' opts3+='--packages --kernsys --kernode --kernrel --kernver --kernarch --kern --perl' opts3+='--python --weather --uptime --loadavg --voltage --fans --mobo --mobotemp --time' opts3+='--ipaddr --bandwidth --iface --ipmac --ipmask --ipcase --iplookup --drivemodel' opts3+='--nicinfo --nicdrv --nicver --iplink --nicfw --wifiname' case "$cur" in -*) COMPREPLY=( $(compgen -W "${opts1} ${opts2} ${opts3}" -- "${cur}") ) ;; esac return 0 } complete -F _pinky -o filenames pinkybar
void0/pinky
extra/bash_zsh/pinkybar
none
unknown
1,741
# 10/29/2016 # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # The GNU/Make use in here is to # the cover our back and do most of # the heavy lifting for us. # When dealing with different operating # systems the things get pretty ugly quickly. # I did learned my lesson with the previous bash # bootstrap script, including the difference # between BSD and GNU sed versions. define stay_portable $(shell perl -Mstrict -Mwarnings -e $(1)) endef define stay_portable2 $(shell perl -Mstrict -Mwarnings -pi -e $(1) $(2)) endef define reflace $(call stay_portable2,'if ($$. == 10) {$$_="";print "$(1)\n";}',$(2)) endef define reflace2 $(call stay_portable2,'s|$(1)|$(2)|;',$(3)) endef define reflace3 $(call stay_portable2,'s|$(1)|$(2)|;s|$(3)|$(4)|;',$(5)) endef BSDCF := -D_DEFAULT_SOURCE -L/usr/local/lib POSIXCF := -D_POSIX_C_SOURCE=200112L BSDLIBS := AMCF := SRCTOAPPEND := OSENTERED := $(strip $(call stay_portable,'print uc "${ARG1}";')) DEFTITS := m4_define\(\[OSENTERED\], \[$(OSENTERED)\]\) # make ARG1=bar logic ifeq ($(findstring FREE,$(OSENTERED)),FREE) BSDLIBS += -largp -ldevstat AMCF += $(BSDCF) DEFTITS += m4_define\(\[FREEBZD\], \[tits\]\) SRCTOAPPEND += freebsd_functions.c include/freebzd.h else ifeq ($(findstring OPEN,$(OSENTERED)),OPEN) BSDLIBS += -largp -lossaudio AMCF += $(BSDCF) DEFTITS += m4_define\(\[OPENBZD\], \[forSure\]\) SRCTOAPPEND += openbsd_functions.c include/openbzd.h else AMCF += $(POSIXCF) DEFTITS += m4_define\(\[LINUKS\], \[cryMeAriver\]\) SRCTOAPPEND += linux_functions.c endif endif all: $(call reflace,$(DEFTITS),configure.ac) $(call reflace3,{amCF},$(AMCF),{srcFiles},$(SRCTOAPPEND),src/Makefile.am) $(call reflace2,{bzdlibs},$(BSDLIBS),src/Makefile.am) # ... .PHONY: all
void0/pinky
extra/deprecated/Makefile.skel
skel
unknown
2,419
The bash bootstrip script served well until I ported pinky-bar to \*BSD, as I had to make bash as dependency. Second attemp was with GNU make and sed, and the difference between GNU and BSD sed version made me to pull out my hair. So I re-wrote the sed macros to use perl instead. The third and last attemp - deprecate GNU make, and use only perl. Since it high-level language it will be portable across different operating systems, and the bonus is that perl will be most likely installed out of the box.
void0/pinky
extra/deprecated/README.md
Markdown
unknown
508
#!/usr/bin/env bash # 07/06/2015, 07/18/2016 # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. declare -a _bases=( 'archlinux' 'debian' 'gentoo' 'slackware' 'rhel' 'frugalware' 'angstrom' 'freebsd' 'openbsd' ) _printf_err() { printf '%s\n' "try again with: bash ${0} basedistro" printf '%s ' "Bases: ${_bases[@]}" printf '\n' } _gen_files() { progName='pinkybar' progVer='1.0.0' bsdLibs='' osEntered="${1,,}" bsdCF='-D_DEFAULT_SOURCE -L/usr/local/lib' posixCF='-D_POSIX_C_SOURCE=200112L' declare -a srcToAppend configure_ac main_makefile declare -a src_makefile src_libs_to_add src_files case "${osEntered}" in freebsd) bsdLibs='-largp -ldevstat' amCF="${bsdCF}" defTits='m4_define([FREEBZD], [tits])' srcToAppend=( 'freebsd_functions.c' 'include/freebzd.h' ) ;; openbsd) bsdLibs='-largp -lossaudio' amCF="${bsdCF}" defTits='m4_define([OPENBZD], [forSure])' srcToAppend=( 'openbsd_functions.c' 'include/openbzd.h' ) ;; *) amCF="${posixCF}" defTits='m4_define([LINUKS], [cryMeAriver])' srcToAppend=( 'linux_functions.c' ) ;; esac # to strip get_packs() at compile time, # also instead using more hard-coded macros # let the shell enumerate them for us declare -a enumDistros=() for x in {0..8} do enumDistros[${x}]="AC_DEFINE_UNQUOTED([${_bases[${x}]^^}],[${x}],[trololo enum generator])" [[ "${osEntered}" == "${_bases[${x}]}" ]] && { distroNum="AC_DEFINE_UNQUOTED([DISTRO],[${x}],[da monster])" } done # configure.ac configure_ac=("# This file is processed by autoconf to create a configure script AC_INIT(["${progName}"], ["${progVer}"]) AC_CONFIG_AUX_DIR([temp_dir]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([src/config.h]) # -Werror -Wportability AM_INIT_AUTOMAKE([1.13 -Wall no-define foreign subdir-objects dist-xz no-dist-gzip std-options]) AM_SILENT_RULES([yes]) "${defTits}" # With the addition of more runtime compile and # link tests, this option is no longer necessary. # Any compiler and C library succeeding to pass the # tests will be able to compile and run the # program flawlessly. # If you use OpenBSD uncomment the AC_PROG_CC([]) # line below. Make sure that you have the latest gcc/llvm # AC_PROG_CC([egcc clang llvm-gcc gcc]) AC_PROG_CC_C99 AC_C_CONST AC_HEADER_STDC AM_PROG_CC_C_O # AM_EXTRA_RECURSIVE_TARGETS([ncurses]) # The linker flags tests in m4 dir TEST_SOME_FUNCS TEST_NET TEST_PCI TEST_X11 TEST_ALSA TEST_MPD TEST_DVD TEST_SENSORS TEST_TYPEZ TEST_WEATHER TEST_PERL TEST_PYTHON TEST_CFLAGZ # Definitions "${distroNum}" "${enumDistros[@]}" AC_CONFIG_FILES([ Makefile src/Makefile ]) AC_OUTPUT echo echo 'Now type \"make\" and \"make install\" afterwards' echo") # Makefile.am main_makefile=(' SUBDIRS = src dist_man_MANS = doc/pinkybar.1 # Optional, create and install # the pinkybar info document # info_TEXINFOS = doc/pinkybar.texi # MAKEINFOFLAGS = --no-validate --no-warn --force # To satisfy make dist EXTRA_DIST = \ src/ncurses.c \ bootstrap \ README.md \ .gitignore \ m4 \ doc \ extra # using 1 tab ncurses: @cd src && $(MAKE) ncurses man: @cd doc && $(MAKE) man info: @cd doc && $(MAKE) info ') # src/Makefile.am src_files=( 'main.c' 'cpu.c' 'common.c' 'sound.c' 'options.c' 'net.c' 'weather.c' 'smart.c' 'perl.c' 'python.c' 'prototypes/cpu.h' 'prototypes/common.h' 'prototypes/sound.h' 'prototypes/net.h' 'prototypes/functions.h' 'prototypes/options.h' 'prototypes/weather.h' 'prototypes/smart.h' 'prototypes/perl.h' 'prototypes/python.h' 'include/headers.h' 'include/options_constants.h' 'include/functions_constants.h' 'include/non_x11_colours.h' 'include/x11_colours.h' 'include/options_generator.h' "${srcToAppend[@]}" ) # The syntax is autotools specific src_libs_to_add=( '$(X_LIBS) $(ALSA_LIBS)' '$(MPD_LIBS) $(PCI_LIBS)' '$(DVD_LIBS) $(SENSORS_LIBS)' '$(CURL_LIBS) $(LIBNL_LZ)' '$(PERL_LZ) $(PYTHON_LZ)' ) # Do not pass more definitions to AM_CFLAGS # Think of the line limit src_makefile=('AM_CFLAGS = '${amCF}' \ -I/usr/local/include $(LIBNL_CF) $(PERL_CF) $(PYTHON_CF) bin_PROGRAMS = '${progName}' EXTRA_PROGRAMS = ncurses ncurses_SOURCES = ncurses.c ncurses_LDADD = -lncurses '${progName}'_LDADD = '${src_libs_to_add[@]}' '${bsdLibs}' '${progName}'_SOURCES = '${src_files[@]}' ') cat <<EOF > configure.ac ${configure_ac[@]} EOF cat <<EOF > Makefile.am ${main_makefile[@]} EOF cat <<EOF > src/Makefile.am ${src_makefile[@]} EOF # do not remove nor edit autoreconf --install --force } [[ -z "${1}" ]] && _printf_err "$@" || { [[ " ${_bases[@]} " =~ " ${1,,} " ]] && \ _gen_files "$@" || _printf_err "$@" }
void0/pinky
extra/deprecated/bootstrap
none
unknown
5,857
The majority of SCN* macros differs from their PRI* cousins. When you define unsigned int you should always follow the C standards that made it clear what format specifier unsigned int should use, unfortunately the majority of OpenBSD's own libc SCN* macros managed not to follow the standard. "hu" and "hhu" are not unsigned int format specifiers, tried to get in touch with OpenBSD devs, reported this bug but no one responded. If they wanted to use specific integer type, then they should define it as such earlier. 8 bit integer is the smallest integer type in existance and for sure it cannot represent the 32 bit UINT_MAX number. glibc uses the maximum unsigned char and signed char for all int8_t, int_least8_t, int_fast8_t and uint8_t, uint_least8_t, uint_fast8_t , and yes glibc defines corrent PRI* and SCN* format specifier macros to match that integer type. It's not like to mistake the float format specifier with the "double" one. It's dirty trick to let the complier do the conversion for you to lower the integer type and not follow the standards to define it as such earlier. Go ahead and read sections 13.2 and 13.2.1 https://www.gnu.org/software/autoconf/manual/autoconf.html#Integer-Overflow The definitions in OpenBSD own libc: ```cpp /* machine/_types.h */ typedef unsigned int __uint32_t; typedef __uint32_t __uint_fast8_t; typedef __uint32_t __uint_fast16_t; /* stdint.h */ typedef __uint_fast8_t uint_fast8_t; typedef __uint_fast16_t uint_fast16_t; /* inttypes.h */ #define PRIuFAST8 "u" /* uint_fast8_t */ #define SCNuFAST8 "hhu" /* uint_fast8_t */ #define PRIuFAST16 "u" /* uint_fast16_t */ #define SCNuFAST16 "hu" /* uint_fast16_t */ ``` Sample program to simulate the bug: ```cpp #include <stdio.h> #include <stdlib.h> #include <inttypes.h> int main(void) { char acc[] = "Remaining: 99000"; uint_fast8_t cur = 0, started = 99000; printf("%s\n", acc); if (EOF == (sscanf(acc, "%*s %"SCNuFAST8, &cur))) { return EXIT_FAILURE; } printf("%s " "%"PRIuFAST8 " %s " "%"PRIuFAST8 "\n", "Started with: $", started, "The current balance now: $", cur ); return EXIT_SUCCESS; } ``` Amusing representation of the above code: ```cpp unsigned long long int small_int = 240; printf("%hhu\n", small_int); ```
void0/pinky
extra/misc/openbsd_bugs.md
Markdown
unknown
2,278
/* * Sample program to demonstate the usage of libatasmart */ #include <stdio.h> #include <string.h> #include <errno.h> #include <atasmart.h> int main(void) { uint64_t mkelvin = 0; const char *device = "/dev/sda"; SkDisk *d = NULL; if (-1 == (sk_disk_open(device, &d))) { fprintf(stderr, "Failed to open disk %s: %s\n", device, strerror(errno)); return 1; } if (-1 == (sk_disk_smart_read_data(d))) { fprintf(stderr, "Failed to read SMART data: %s\n", strerror(errno)); goto finish; } if (-1 == (sk_disk_smart_get_temperature(d, &mkelvin))) { fprintf(stderr, "Failed to get temperature: %s\n", strerror(errno)); goto finish; } printf("%llu\n", (unsigned long long)mkelvin); finish: if (NULL != d) { sk_disk_free(d); } return 0; }
void0/pinky
extra/misc/skdump.c
C++
unknown
792
\*BSD users should add the "musicpd" daemon user on their own
void0/pinky
extra/mpd/README.md
Markdown
unknown
62
music_directory "/home/frost/music" playlist_directory "/home/frost/music" db_file "/tmp/mpddb" log_file "/tmp/mpdlog" state_file "/tmp/mpdstate" pid_file "/tmp/mpdpid" log_level "default" user "musicpd" audio_output { type "oss" name "My sound card" mixer_type "software" } port "6600" bind_to_address "127.0.0.1"
void0/pinky
extra/mpd/freebsd.conf
INI
unknown
323
music_directory "/home/frost/music" playlist_directory "/home/frost/music" db_file "/tmp/mpddb" log_file "/tmp/mpdlog" state_file "/tmp/mpdstate" pid_file "/tmp/mpdpid" log_level "default" user "mpd" audio_output { type "alsa" name "My sound card" mixer_type "software" } port "6600" bind_to_address "127.0.0.1"
void0/pinky
extra/mpd/linux.conf
INI
unknown
320
music_directory "/home/frost/music" playlist_directory "/home/frost/music" db_file "/tmp/mpddb" log_file "/tmp/mpdlog" state_file "/tmp/mpdstate" pid_file "/tmp/mpdpid" log_level "default" user "musicpd" audio_output { type "ao" name "My sound card" mixer_type "software" } port "6600" bind_to_address "127.0.0.1"
void0/pinky
extra/mpd/openbsd.conf
INI
unknown
322
/* source - https://en.wikipedia.org/wiki/CPUID */ /* used it to port it to pinky-bar */ .section .data s0 : .asciz "Processor Brand String: %.48s\n" err : .asciz "Feature unsupported.\n" .section .text .global main .type main,@function .align 32 main: pushq %rbp movq %rsp, %rbp subq $48, %rsp pushq %rbx movl $0x80000000, %eax cpuid cmpl $0x80000004, %eax jl error movl $0x80000002, %esi movq %rsp, %rdi .align 16 get_brand: movl %esi, %eax cpuid movl %eax, (%rdi) movl %ebx, 4(%rdi) movl %ecx, 8(%rdi) movl %edx, 12(%rdi) addl $1, %esi addq $16, %rdi cmpl $0x80000004, %esi jle get_brand print_brand: movq $s0, %rdi movq %rsp, %rsi xorb %al, %al call printf jmp end .align 16 error: movq $err, %rdi xorb %al, %al call printf .align 16 end: popq %rbx movq %rbp, %rsp popq %rbp xorl %eax, %eax ret
void0/pinky
extra/ported_or_not_included/cpu_brand.S
Assembly
unknown
852
/* source - https://en.wikipedia.org/wiki/CPUID */ /* used it to port it to pinky-bar */ .section .data info : .ascii "L2 Cache Size : %u KB\nLine size : %u bytes\n" .asciz "Associativity : %02xh\n" err : .asciz "Feature unsupported.\n" .section .text .global main .type main,@function .align 32 main: pushq %rbp movq %rsp, %rbp pushq %rbx movl $0x80000000, %eax cpuid cmpl $0x80000006, %eax jl error movl $0x80000006, %eax cpuid movl %ecx, %eax movl %eax, %edx andl $0xff, %edx movl %eax, %ecx shrl $12, %ecx andl $0xf, %ecx movl %eax, %esi shrl $16, %esi andl $0xffff,%esi movq $info, %rdi xorb %al, %al call printf jmp end .align 16 error: movq $err, %rdi xorb %al, %al call printf .align 16 end: popq %rbx movq %rbp, %rsp popq %rbp xorl %eax, %eax ret
void0/pinky
extra/ported_or_not_included/cpu_cache.S
Assembly
unknown
811
/* "borrowed" from the Hacked Team */ #include <time.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <strings.h> #include <sys/types.h> #include <sys/statvfs.h> #include <sys/utsname.h> struct device_info { struct { char vendor[128]; char model[128]; char cpu[128]; unsigned char ncpu; } hw; struct { unsigned int memt; unsigned int memf; unsigned int diskt; unsigned int diskf; } stat; struct { char ac[16]; unsigned char battery; } power; struct { char ver[128]; char arch[16]; char lang[16]; char tzname[8]; char tzoff[8]; } os; struct { char name[16]; unsigned int uid; unsigned int gid; char gecos[64]; char home[64]; } user; struct { char list[1024]; } mount; }; int main(void); void device_hw(struct device_info *di); void device_stat(struct device_info *di); void device_power(struct device_info *di); void device_os(struct device_info *di); void device_user(struct device_info *di); void device_mount(struct device_info *di); int main(void) { struct device_info di; memset(&di, 0x00, sizeof(di)); device_hw(&di); device_stat(&di); device_power(&di); device_os(&di); device_user(&di); device_mount(&di); printf("Device: %s %s\n", di.hw.vendor, di.hw.model); printf("Processor: %u x %s\n", di.hw.ncpu, di.hw.cpu); printf("Memory: %uMB (%u%% used)\n", di.stat.memt, 100 - di.stat.memf * 100 / di.stat.memt); printf("Disk: %uGB (%u%% used)\n", di.stat.diskt, 100 - di.stat.diskf * 100 / di.stat.diskt); printf("Power: AC %s - battery %%\n", di.power.ac); printf("\n"); printf("OS Version: Linux %s (%s)\n", di.os.ver, di.os.arch); printf("Locale settings: %s - %s (UTC %s)\n", di.os.lang, di.os.tzname, di.os.tzoff); printf("\n"); printf("Mounted filesystems:\n"); printf("%s\n", di.mount.list); return 0; } void device_hw(struct device_info *di) { FILE *fp = NULL; char buf[128], *ptr = NULL; if(!(fp = fopen("/sys/devices/virtual/dmi/id/sys_vendor", "r")) || !fgets(di->hw.vendor, sizeof(di->hw.vendor), fp)) { strncpy(di->hw.vendor, "(unknown)", sizeof(di->hw.vendor) - 1); } if(fp) fclose(fp); if(!(fp = fopen("/sys/devices/virtual/dmi/id/product_name", "r")) || !fgets(di->hw.model, sizeof(di->hw.model), fp)) { di->hw.model[0] = '\n'; } if(fp) fclose(fp); if(di->hw.vendor[strlen(di->hw.vendor) - 1] == '\n') di->hw.vendor[strlen(di->hw.vendor) - 1] = '\0'; while(di->hw.vendor[strlen(di->hw.vendor) - 1] == ' ') di->hw.vendor[strlen(di->hw.vendor) - 1] = '\0'; if(di->hw.model[strlen(di->hw.model) - 1] == '\n') di->hw.model[strlen(di->hw.model) - 1] = '\0'; while(di->hw.model[strlen(di->hw.model) - 1] == ' ') di->hw.model[strlen(di->hw.model) - 1] = '\0'; if(!(fp = fopen("/proc/cpuinfo", "r"))) return; while(fgets(buf, sizeof(buf), fp)) { if(!strncasecmp(buf, "model name", strlen("model name"))) { if((ptr = strstr(buf, ": ") + 2)) strncpy(di->hw.cpu, ptr, sizeof(di->hw.cpu) - 1); } else if(!strncasecmp(buf, "processor", strlen("processor"))) { if((ptr = strstr(buf, ": ") + 2)) di->hw.ncpu = atoi(ptr) + 1; } } fclose(fp); if((di->hw.cpu[0]) && (di->hw.cpu[strlen(di->hw.cpu) - 1] == '\n')) di->hw.cpu[strlen(di->hw.cpu) - 1] = '\0'; return; } void device_stat(struct device_info *di) { FILE *fp = NULL; struct statvfs s; char buf[128], *ptr = NULL; if((fp = fopen("/proc/meminfo", "r"))) { while(fgets(buf, sizeof(buf), fp)) { if(!strncasecmp(buf, "MemTotal:", strlen("MemTotal:"))) { ptr = buf + strlen("MemTotal:"); while(*ptr && (*ptr == ' ')) ptr++; di->stat.memt = atoll(ptr) / 1024; } else if(!strncasecmp(buf, "MemFree:", strlen("MemFree:"))) { ptr = buf + strlen("MemFree:"); while(*ptr && (*ptr == ' ')) ptr++; di->stat.memf += atoll(ptr) / 1024; } else if(!strncasecmp(buf, "Cached:", strlen("Cached:"))) { ptr = buf + strlen("Cached:"); while(*ptr && (*ptr == ' ')) ptr++; di->stat.memf += atoll(ptr) / 1024; } } fclose(fp); } if(di->stat.memf > di->stat.memt) di->stat.memf = di->stat.memt; if((ptr = getcwd(NULL, 0))) { if(statvfs(ptr, &s)) return; di->stat.diskt = (unsigned int)((unsigned long long)s.f_blocks * (unsigned long long)s.f_bsize / (unsigned long long)1073741824); di->stat.diskf = (unsigned int)((unsigned long long)s.f_bavail * (unsigned long long)s.f_bsize / (unsigned long long)1073741824); free(ptr); } return; } void device_power(struct device_info *di) { FILE *fp = NULL; char buf[128], *ptr = NULL; strncpy(di->power.ac, "(unavailable)", sizeof(di->power.ac) - 1); if(!(fp = fopen("/proc/acpi/ac_adapter/ADP1/state", "r"))) return; while(fgets(buf, sizeof(buf), fp)) { if(!strncasecmp(buf, "state:", strlen("state:"))) { ptr = buf + strlen("state:"); while(*ptr && (*ptr == ' ')) ptr++; strncpy(di->power.ac, ptr, sizeof(di->power.ac) - 1); } } fclose(fp); if(di->power.ac[strlen(di->power.ac) - 1] == '\n') di->power.ac[strlen(di->power.ac) - 1] = '\0'; return; } void device_os(struct device_info *di) { FILE *fp = NULL; struct utsname u; char buf[128], *ptr = NULL; time_t t; struct tm ts; do { strncpy(di->os.ver, "(unknown)", sizeof(di->os.ver) - 1); if((fp = fopen("/etc/lsb-release", "r"))) { while(fgets(buf, sizeof(buf), fp)) { if(!strncasecmp(buf, "DISTRIB_DESCRIPTION=", strlen("DISTRIB_DESCRIPTION="))) { ptr = buf + strlen("DISTRIB_DESCRIPTION="); while(*ptr && ((*ptr == ' ') || (*ptr == '"'))) ptr++; strncpy(di->os.ver, ptr, sizeof(di->os.ver) - 1); while((di->os.ver[strlen(di->os.ver) - 1] == '"') || (di->os.ver[strlen(di->os.ver) - 1] == '\n')) di->os.ver[strlen(di->os.ver) - 1] = '\0'; } } } else if((fp = fopen("/etc/slackware-version", "r"))) { if(fgets(di->os.ver, sizeof(di->os.ver), fp)) break; } else if((fp = fopen("/etc/redhat-release", "r"))) { if(fgets(di->os.ver, sizeof(di->os.ver), fp)) break; } else if((fp = fopen("/etc/gentoo-release", "r"))) { if(fgets(di->os.ver, sizeof(di->os.ver), fp)) break; } } while(0); if(fp) fclose(fp); if(di->os.ver[strlen(di->os.ver) - 1] == '\n') di->os.ver[strlen(di->os.ver) - 1] = '\0'; if(!uname(&u)) strncpy(di->os.arch, u.machine, sizeof(di->os.arch) - 1); if(!(ptr = getenv("LANG"))) ptr = "(unknown)"; strncpy(di->os.lang, ptr, sizeof(di->os.lang) - 1); t = time(NULL); localtime_r(&t, &ts); strftime(di->os.tzname, sizeof(di->os.tzname), "%Z", &ts); strftime(di->os.tzoff, sizeof(di->os.tzoff), "%z", &ts); di->os.tzoff[6] = '\0'; di->os.tzoff[5] = di->os.tzoff[4]; di->os.tzoff[4] = di->os.tzoff[3]; di->os.tzoff[3] = ':'; return; } void device_user(struct device_info *di) { FILE *fp = NULL; char buf[128], *name, *gecos, *home, *ptr = NULL; unsigned int uid; di->user.uid = (unsigned int)getuid(); di->user.gid = (unsigned int)getuid(); if(!(fp = fopen("/etc/passwd", "r"))) return; while(fgets(buf, sizeof(buf), fp)) { if(!(ptr = strchr(buf, ':')) || !(ptr = strchr(++ptr, ':')) || (atoi(++ptr) != di->user.uid)) continue; if((gecos = strchr(ptr, ':')) && (gecos = strchr(++gecos, ':'))) *gecos++ = '\0'; if((home = strchr(gecos, ':'))) *home++ = '\0'; if((ptr = strchr(home, ':'))) *ptr = '\0'; printf("%s %s\n", gecos, home); } fclose(fp); return; } void device_mount(struct device_info *di) { FILE *fp = NULL; char buf[512], *device = NULL, *mountpoint = NULL, *type = NULL, *ptr = NULL; if(!(fp = fopen("/etc/mtab", "r"))) return; while(fgets(buf, sizeof(buf), fp)) { device = buf; if((mountpoint = strchr(device, ' '))) *mountpoint++ = '\0'; if((type = strchr(mountpoint, ' '))) *type++ = '\0'; if((ptr = strchr(type, ' '))) *ptr = '\0'; ptr = &di->mount.list[strlen(di->mount.list)]; snprintf(ptr, sizeof(di->mount.list) - strlen(di->mount.list), "%s %s (%s)\n", device, mountpoint, type); } fclose(fp); if(di->mount.list[strlen(di->mount.list) - 1] == '\n') di->mount.list[strlen(di->mount.list) - 1] = '\0'; return; }
void0/pinky
extra/ported_or_not_included/not_included.c
C++
unknown
8,594
#!/usr/bin/env bash # 10/23/2016 # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # Edit /dev/sda according to # your operating system drive naming # convention # To use atactl replace "smartctl" with # atactl sd0 readattr # replace $arr[9] with $arr[3] while true; do sudo smartctl -a /dev/sd0a | \ perl -Mstrict -Mwarnings -ne ' my @arr = split(" ", $_); my $tempnum = 0; if ($arr[1] and lc $arr[1] =~ /temperature/i) { $tempnum = $arr[9] || 0; printf("%d\n",$tempnum); }' > /tmp/pinkytemp sleep 20 done &
void0/pinky
extra/scripts/drive-temperature.sh
Shell
unknown
1,221
#!/usr/bin/env bash # 10/23/2016 # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # Execute the "statusbar" program every 2 secs while true; do "${HOME}"/.cache/bin/pinkybar -LTrspkvfmdVt sleep 2 done &
void0/pinky
extra/scripts/dwm.sh
Shell
unknown
867
#!/usr/bin/env bash # 10/23/2016 # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. pinky() { location="${HOME}/.cache/bin" while true; do "${location}"/pinkybar -LTrspkvfmdVt sleep 2 done | "${location}"/ncurses }
void0/pinky
extra/scripts/pinky-curses.sh
Shell
unknown
888
-- 11/18/2016 -- 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., 51 Franklin Street, Fifth Floor, Boston, -- MA 02110-1301, USA. -- Your script should always return a single string. -- Read the above line again. -- -- pinky-bar will always call uzer_func, -- you can write other subroutines/functions -- but they should be called inside uzer_func -- -- Dont worry about the colorization, it's -- handled by pinky-bar. -- -- The entire language is in your hands. function uzer_func() local rett = string.format("%s %s %d", "Hello", os.date(), 123) return rett end
void0/pinky
extra/scripts/pinky.lua
Lua
unknown
1,173
# 10/24/2016 # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # Your script should always return a single string. # Read the above line again. # # pinky-bar will always call uzer_func, # you can write other subroutines/functions # but they should be called inside uzer_func # # Dont worry about the colorization, it's # handled by pinky-bar. # # The entire language is in your hands. use strict; use warnings; use Time::Piece; sub uzer_func { my $t = localtime; my $rett = sprintf("%s %s %d", "Hello", $t->cdate, 123); return $rett; }
void0/pinky
extra/scripts/pinky.pl
Perl
unknown
1,204
# 10/24/2016 # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # Your script should always return a single string. # Read the above line again. # # pinky-bar will always call uzer_func, # you can write other subroutines/functions # but they should be called inside uzer_func # # Dont worry about the colorization, it's # handled by pinky-bar. # # Semicolins are only mandatory when you write "one liners" # python2 -c 'import time;print("{0}".format(time.tzname))' # # Dont blame me if you have the following environment variable # export PYTHONOPTIMIZE=3 # The only way to describe it is caching nightmare. # # The entire language is in your hands. import time def uzer_func(): rett = '{0} {1} {2}'.format("Hello", time.ctime(), 123) return rett
void0/pinky
extra/scripts/pinky.py
Python
unknown
1,411
# 11/18/2016 # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # Your script should always return a single string. # Read the above line again. # # pinky-bar will always call uzer_func, # you can write other subroutines/functions # but they should be called inside uzer_func # # Dont worry about the colorization, it's # handled by pinky-bar. # # The entire language is in your hands. def uzer_func rett = sprintf("%s %s %d", "Hello", Time.now, 123) return rett end
void0/pinky
extra/scripts/pinky.rb
Ruby
unknown
1,129
#!/usr/bin/env bash # 10/23/2016 # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # Execute the "statusbar" program every 2 secs while true; do "${HOME}"/.cache/bin/pinkybar -LTrspkvfmdVt sleep 2 done | dzen2 -w 1800 -x 130 -ta r -fn \ '-*-dejavusans-*-r-*-*-11-*-*-*-*-*-*-*' &
void0/pinky
extra/scripts/xmonad.sh
Shell
unknown
946
#define arch1_width 8 #define arch1_height 8 static unsigned char arch1_bits[] = { 0x18, 0x18, 0x3c, 0x3c, 0x7e, 0x66, 0xe7, 0xc3};
void0/pinky
extra/xbm_icons/arch.xbm
xbm
unknown
135
#define bat_full_width 8 #define bat_full_height 8 static unsigned char bat_full_bits[] = { 0x18, 0x7E, 0x42, 0x5A, 0x5A, 0x5A, 0x42, 0x7E };
void0/pinky
extra/xbm_icons/bat.xbm
xbm
unknown
143
#define clock5_width 8 #define clock5_height 8 static unsigned char clock5_bits[] = { 0x00, 0x7c, 0xee, 0xee, 0x8e, 0xfe, 0xfe, 0x7c};
void0/pinky
extra/xbm_icons/clock.xbm
xbm
unknown
138
#define cpu13_width 8 #define cpu13_height 8 static unsigned char cpu13_bits[] = { 0xdb, 0xc3, 0x3c, 0xbd, 0xbd, 0x3c, 0xc3, 0xdb};
void0/pinky
extra/xbm_icons/cpu.xbm
xbm
unknown
135
#define diskette_width 8 #define diskette_height 8 static unsigned char diskette_bits[] = { 0xFF, 0x81, 0x81, 0x81, 0xBD, 0xB5, 0xB5, 0xFE };
void0/pinky
extra/xbm_icons/diskette.xbm
xbm
unknown
143
#define cpu15_width 8 #define cpu15_height 8 static unsigned char cpu15_bits[] = { 0x02, 0xf2, 0x3e, 0x26, 0x64, 0x7c, 0x4f, 0x40};
void0/pinky
extra/xbm_icons/fan.xbm
xbm
unknown
135
#define fox_width 8 #define fox_height 8 static unsigned char fox_bits[] = { 0x81, 0xC3, 0xBD, 0xFF, 0x99, 0xDB, 0x7E, 0x18 };
void0/pinky
extra/xbm_icons/fox.xbm
xbm
unknown
128
#define mem1_width 8 #define mem1_height 8 static unsigned char mem1_bits[] = { 0xaa, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0xaa};
void0/pinky
extra/xbm_icons/mem.xbm
xbm
unknown
132
#define grid_width 8 #define grid_height 8 static unsigned char grid_bits[] = { 0xdb, 0xdb, 0x00, 0xdb, 0xdb, 0x00, 0xdb, 0xdb};
void0/pinky
extra/xbm_icons/mobo.xbm
xbm
unknown
132
#define cpu_width 16 #define cpu_height 15 static unsigned char cpu_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x70, 0x1c, 0x78, 0x1e, 0x30, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
void0/pinky
extra/xbm_icons/mpd.xbm
xbm
unknown
270
#define net_width 8 #define net_height 8 static unsigned char net_wired_bits[] = { 0x00, 0x1C, 0x1C, 0x7F, 0x7F, 0x7F, 0x55, 0x7F };
void0/pinky
extra/xbm_icons/net.xbm
xbm
unknown
134
#define info_width 8 #define info_height 8 static unsigned char info_bits[] = { 0x38, 0x38, 0x00, 0x3C, 0x38, 0x38, 0x38, 0x7C };
void0/pinky
extra/xbm_icons/statio.xbm
xbm
unknown
131
#define temp1_width 8 #define temp1_height 8 static unsigned char temp1_bits[] = { 0x30, 0xf0, 0x30, 0xf0, 0x30, 0x78, 0x78, 0x30};
void0/pinky
extra/xbm_icons/temp.xbm
xbm
unknown
135
#define net_up_03_width 8 #define net_up_03_height 8 static unsigned char net_up_03_bits[] = { 0x10, 0x38, 0x7C, 0xFE, 0x38, 0x38, 0x38, 0x38 };
void0/pinky
extra/xbm_icons/uptime.xbm
xbm
unknown
146
#define vol1_width 8 #define vol1_height 8 static unsigned char vol1_bits[] = { 0x08, 0x4c, 0x8f, 0xaf, 0xaf, 0x8f, 0x4c, 0x08};
void0/pinky
extra/xbm_icons/vol.xbm
xbm
unknown
132
#define ac11_width 8 #define ac11_height 8 static unsigned char ac11_bits[] = { 0x40, 0x20, 0x10, 0xf8, 0x40, 0x20, 0x10, 0x08};
void0/pinky
extra/xbm_icons/voltage.xbm
xbm
unknown
132
dnl 08/03/2016 dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, dnl MA 02110-1301, USA. dnl All funcs below are internal dnl Error message when smth is wrong AC_DEFUN([ERR],[ AC_MSG_ERROR($1) ]) dnl What have to be installed in order to compile the program. AC_DEFUN([ERR_MUST_INSTALL],[ ERR([Install $1 in order to compile the program.]) ]) dnl Failed to compile and linking some test(s) AC_DEFUN([LINK_FAILED], [ ERR([Failed to compile and link the $1 test.]) ]) dnl Failed to compile some test(s) AC_DEFUN([COMPILE_FAILED], [ ERR([Failed to compile the $1 test.]) ]) dnl Missing library function(s) AC_DEFUN([MISSING_FUNC], [ ERR([Missing core library functions.]) ]) dnl Missing header file(s) AC_DEFUN([MISSING_HEADER], [ ERR([Missing core header files.]) ]) dnl Not error related funcs, dnl neither fall in any of the test dnl categories listed in this folder dnl When using AC_CHECK_LIB in a loop, dnl it will substitute the same linker flag dnl several times, which may cause to dnl exceed the line limit AC_DEFUN([UPDATE_LIBS_VAR],[ LIBS="$1" AC_SUBST(LIBS) ]) dnl Same description as the above func, dnl except it saves the LIBS var before dnl invoking AC_CHECK_LIB AC_DEFUN([SAVE_LIBS_VAR],[ m4_ifdef([ZaVeD], [ m4_undefine([ZaVeD]) ]) m4_define([ZaVeD],[$1]) ])
void0/pinky
m4/1errs.m4
m4
unknown
1,970
dnl 08/03/2016 dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, dnl MA 02110-1301, USA. dnl TEST_ALSA() function in configure.ac dnl dnl Check for the presence of ALSA headers and dnl substitute the linker flags -lasound to the dnl the variable 'ALSA_LIBS' if they are available. AC_DEFUN([TEST_ALSA],[ ALSA_LIBS="" AC_ARG_WITH([alsa], AS_HELP_STRING([--with-alsa], [ALSA linker flag for sound support]), [], [with_alsa=no] ) AC_ARG_WITH([oss], AS_HELP_STRING([--with-oss], [BSD OSS flag for sound support]), [], [with_oss=no] ) AS_IF([test "x$with_alsa" = "xyes"], [ AC_CHECK_HEADERS([alsa/asoundlib.h], [ ALSA_LIBS="-lasound" ],[ ERR_MUST_INSTALL([alsa-utils and alsa-lib]) ]) m4_foreach([LiB], [ snd_mixer_open , snd_mixer_attach , snd_mixer_selem_register , snd_mixer_load , snd_mixer_selem_id_malloc , snd_mixer_selem_id_set_name , snd_mixer_find_selem , snd_mixer_selem_get_playback_volume , snd_mixer_selem_get_playback_volume_range , snd_mixer_selem_id_free , snd_mixer_close ],[ AC_CHECK_LIB(asound,LiB,[],[ MISSING_FUNC() ]) ]) ]) AC_SUBST(ALSA_LIBS) AS_IF([test "x$with_alsa" = "xyes"], [ AC_LINK_IFELSE([ AC_LANG_SOURCE([[ #include <alsa/asoundlib.h> int main(void) { snd_mixer_t *handle = NULL; snd_mixer_elem_t *elem = NULL; snd_mixer_selem_id_t *s_elem = NULL; return 0; } ]]) ],[],[ LINK_FAILED([alsa]) ] ) ]) ifdef([FREEBZD],[ AS_IF([test "x$with_alsa" = "xno"], [ AS_IF([test "x$with_oss" = "xyes"], [ TEST_OZZ([sys/soundcard.h]) ]) ]) ],[]) ifdef([OPENBZD],[ AS_IF([test "x$with_alsa" = "xno"], [ AS_IF([test "x$with_oss" = "xyes"], [ TEST_OZZ([soundcard.h]) ]) ]) ],[]) ]) dnl Internal function to check the BSD dnl OSS headers and perfom some tests AC_DEFUN([TEST_OZZ],[ AC_CHECK_HEADERS([$1], [ ],[ ERR([Homie, where is $1 ?]) ]) NOTIFY([fcntl]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <fcntl.h> int main(void) { int fd = 0; if (-1 == (fd = open("elo", O_RDONLY))) { return 0; } return 0; } ]]) ],[],[ COMPILE_FAILED([fcntl]) ] ) ])
void0/pinky
m4/alsa.m4
m4
unknown
3,305
# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_append_flag.html # =========================================================================== # # SYNOPSIS # # AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) # # DESCRIPTION # # FLAG is appended to the FLAGS-VARIABLE shell variable, with a space # added in between. # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains # FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly # FLAG. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> # # 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 3 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, see <http://www.gnu.org/licenses/>. # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 6 AC_DEFUN([AX_APPEND_FLAG], [dnl AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) AS_VAR_SET_IF(FLAGS,[ AS_CASE([" AS_VAR_GET(FLAGS) "], [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], [ AS_VAR_APPEND(FLAGS,[" $1"]) AC_RUN_LOG([: FLAGS="$FLAGS"]) ]) ], [ AS_VAR_SET(FLAGS,[$1]) AC_RUN_LOG([: FLAGS="$FLAGS"]) ]) AS_VAR_POPDEF([FLAGS])dnl ])dnl AX_APPEND_FLAG
void0/pinky
m4/ax_append_flag.m4
m4
unknown
2,777
dnl 08/03/2016 dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, dnl MA 02110-1301, USA. dnl Internal function to perform dnl explicit compiler CFLAGS support test AC_DEFUN([CHECK_CFLAGZ],[ m4_foreach([fLaG], [$1], [ AX_APPEND_FLAG([fLaG], [CFLAGS]) AC_MSG_CHECKING([whether fLaG will compile flawlessly]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ int main(void) { return 0; } ]]) ],[cflagz_ok=yes],[cflagz_ok=no]) AC_MSG_RESULT([$cflagz_ok]) AS_IF([test "x$cflagz_ok" = "xno"], [ ERR([Failed to compile a simple test with the above fLaG CFLAG.]) ] ) AC_LINK_IFELSE([ AC_LANG_SOURCE([[ int main(void) { return 0; } ]]) ],[],[ ERR([Failed to compile and link a simple test with the above fLaG CFLAG.]) ] ) ])dnl ]) dnl Internal function to check dnl the compiler for assembly support AC_DEFUN([TEST_ASSEMBLY],[ AC_MSG_CHECKING([for assembly support]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include <stdio.h>]],[[ unsigned int x = 1, z = 2; __asm__ __volatile__ ( "addl %%ebx, %%eax" : "=a"(x) : "a"(x), "b"(z) ); ]]) ],[supportz_assembly=yes],[supportz_assembly=no]) AC_MSG_RESULT([$supportz_assembly]) AS_IF([test "x$supportz_assembly" = "xno"], [ ERR([Your compiler does not support assembly.]) ] ) ]) dnl TEST_CFLAGZ() function in configure.ac dnl dnl Check for the presence and whether dnl the given FLAG will work flawlessly dnl with the currently used compiler. dnl Will substitute each successful flag dnl and bail out with pre-defined error msg dnl when some FLAG is unsupported. AC_DEFUN([TEST_CFLAGZ],[ dnl Only useful when developing dnl pinky-bar dnl -Wdeclaration-after-statement, dnl -Wno-unused-function, dnl Shame on you c++lang, err clang dnl Keeping this flag for historical dnl reasons just to remind myself and dnl anyone reading this file about the dnl clangs inabillity to distinguish dnl C from C++ dnl https://llvm.org/bugs/show_bug.cgi?id=21689 dnl -Wno-missing-field-initializers dnl The twisted gcc vision dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 dnl They say its "glibc" fault dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 dnl -Wno-unused-result, dnl For very first time I stumble upon GCC -O2 bug. dnl It hangs on pci_init and sensors_init with -O2 dnl net.m4 will append -O2 or -O0 dnl according whether --with-pci and --with-sensors dnl are used or not. Another "newer" GCC release dnl that I just installed hangs on sensors_init. dnl One more snafu GCC, and I'll drop -02 in linux AC_MSG_NOTICE([checking all CFLAGS]) CHECK_CFLAGZ([ -pipe, -std=c99, -Wextra, -Wall, -pedantic, -Wundef, -Wshadow, -W, -Wwrite-strings, -Wcast-align, -Wstrict-overflow=5, -Wconversion, -Wpointer-arith, -Wstrict-prototypes, -Wformat=0, -Wsign-compare, -Wendif-labels, -Wredundant-decls, -Wmissing-prototypes, -Winit-self, -Wno-unused-variable ]) TEST_ASSEMBLY() LIBS='' AC_SUBST(LIBS) AC_DEFINE_UNQUOTED([cuRos],[1],[da monster]) ])
void0/pinky
m4/cflagz.m4
m4
unknown
3,856
dnl 08/23/2016 dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, dnl MA 02110-1301, USA. dnl TEST_DVD() function in configure.ac dnl dnl Substitute the linker flags -lcdio to the dnl the variable 'DVD_LIBS' if the user enabled dnl the --with-dvd switch AC_DEFUN([TEST_DVD],[ DVD_LIBS="" AC_ARG_WITH([dvd], AS_HELP_STRING([--with-dvd], [dvd linker flag to show the vendor and model name of your cd/dvdrom]), [], [with_dvd=no] ) AS_IF([test "x$with_dvd" = "xyes"], [ AC_CHECK_HEADERS([ \ cdio/cdio.h \ cdio/mmc.h \ ], [ DVD_LIBS="-lcdio" ],[ ERR_MUST_INSTALL([libcdio]) ]) m4_foreach([LiB], [ cdio_open , mmc_get_hwinfo , cdio_destroy ],[ AC_CHECK_LIB(cdio,LiB,[],[ MISSING_FUNC() ]) ]) ]) AC_SUBST(DVD_LIBS) AS_IF([test "x$with_dvd" = "xyes"], [ AC_LINK_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> #include <stdlib.h> #include <cdio/cdio.h> #include <cdio/mmc.h> int main(void) { CdIo_t *p_cdio = cdio_open(NULL, DRIVER_DEVICE); cdio_hwinfo_t hwinfo; if (NULL == p_cdio) { return 0; } if (mmc_get_hwinfo(p_cdio, &hwinfo)) { printf("%s %s\n", hwinfo.psz_vendor, hwinfo.psz_model); } if (NULL != p_cdio) { cdio_destroy(p_cdio); } return 0; } ]]) ],[],[ LINK_FAILED([cdio]) ] ) ]) ])
void0/pinky
m4/dvd.m4
m4
unknown
2,220
dnl 10/24/2016 dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, dnl MA 02110-1301, USA. dnl TEST_PERL() function in configure.ac dnl dnl Substitute perl related linker and dnl cflags to the variables PERL_CF and dnl PERL_LZ if the user enabled the dnl --with-perl switch AC_DEFUN([TEST_PERL],[ PERL_LZ="" PERL_CF="" WITH_PERL=0 AC_ARG_WITH([perl], AS_HELP_STRING([--with-perl], [Extend the program via perl scripts]), [], [with_perl=no] ) AS_IF([test "x$with_perl" = "xyes"], [ CHECK_CFLAGZ([-O0]) AC_PATH_PROG(perlcf,perl,no) AS_IF([test "x$perlcf" = "xno"], [ ERR([Couldnt find perl.]) ]) PERL_LZ=`$perlcf -MExtUtils::Embed -e ldopts` PERL_CF=`$perlcf -MExtUtils::Embed -e ccopts` dnl m4_foreach([LiB], [ dnl perl_construct, dnl perl_parse, dnl perl_run, dnl perl_destruct, dnl perl_alloc, dnl perl_free dnl ],[ dnl AC_CHECK_LIB(perl,LiB,[],[ dnl MISSING_FUNC() dnl ]) dnl ]) WITH_PERL=1 ]) AC_SUBST(PERL_LZ) AC_SUBST(PERL_CF) AC_DEFINE_UNQUOTED([WITH_PERL],[$WITH_PERL],[Extend the program via perl scripts]) dnl AS_IF([test "x$with_perl" = "xyes"], [ dnl AC_LINK_IFELSE([ dnl AC_LANG_SOURCE([[ dnl #include <stdio.h> dnl #include <string.h> dnl #include <EXTERN.h> dnl #include <perl.h> dnl int main(void) { dnl static PerlInterpreter *my_perl = NULL; dnl PERL_SYS_INIT3((int *)NULL, (char ***)NULL, (char ***)NULL); dnl my_perl = perl_alloc(); dnl if (NULL == my_perl) { dnl PERL_SYS_TERM(); dnl return -1; dnl } dnl perl_construct(my_perl); dnl perl_parse(my_perl, NULL, 0, (char **)NULL, (char **)NULL); dnl PL_exit_flags |= PERL_EXIT_DESTRUCT_END; dnl perl_run(my_perl); dnl perl_destruct(my_perl); dnl perl_free(my_perl); dnl PERL_SYS_TERM(); dnl return 0; dnl } dnl ]]) dnl ],[],[ dnl LINK_FAILED([perl]) dnl ] dnl ) dnl ]) ]) dnl TEST_python() function in configure.ac dnl dnl Substitute python related linker and dnl cflags to the variables PYTHON_CF and dnl PYTHON_LZ if the user enabled the dnl --with-python switch AC_DEFUN([TEST_PYTHON],[ PYTHON_LZ="" PYTHON_CF="" WITH_PYTHON2=0 WITH_PYTHON=0 curpycfver="none" AC_ARG_WITH([python2], AS_HELP_STRING([--with-python2], [Extend the program via python scripts]), [], [with_python2=no] ) AC_ARG_WITH([python3], AS_HELP_STRING([--with-python3], [Extend the program via python scripts]), [], [with_python3=no] ) AS_IF([test "x$with_python2" = "xyes" || test "x$with_python3" = "xyes"], [ CHECK_CFLAGZ([-O0]) AS_IF([test "x$with_python2" = "xyes"], [ AM_PATH_PYTHON([2],[ ],[ ERR([Couldnt find any python 2 version.]) ]) WITH_PYTHON2=1 ]) AS_IF([test "x$with_python3" = "xyes"], [ AM_PATH_PYTHON([3],[ ],[ ERR([Couldnt find any python 3 version.]) ]) ]) dnl What a python versioning mess. dnl We have to check back and forth different scenarious dnl to make sure we can find appropriate CFLAGS and LDFLAGS dnl for the requested python version. dnl When there is only 1 python version installed the file dnl naming is one, when there are 2 or more different dnl python version installed, the file naming is other. dnl Still reading or get bored ? m4_define([testveR],[python$PYTHON_VERSION]) m4_define([testveR2],[python-config-$PYTHON_VERSION]) dnl First check whether python and python-9.9 exist AC_PATH_PROG(pyvf1,testveR,no) AC_PATH_PROG(pyvf2,python,no) dnl Next check whether python-config and python-config-9.9 exist AC_PATH_PROG(pycf1,testveR2,no) AC_PATH_PROG(pycf2,python-config,no) dnl Check whether any of the python versions was found AS_IF([test "x$pyvf1" = "xno" && test "x$pyvf2" = "xno"], [ ERR([Couldnt find python]) ]) dnl Check whether any of the python-config versions was found AS_IF([test "x$pycf1" = "xno" && test "x$pycf2" = "xno"], [ ERR([Couldnt find python-config]) ]) dnl We firts check for the python-config-9.9 version AS_IF([test "x$pycf1" != "xno"], [ curpycfver="${pycf1}" ]) dnl We now know that python-config is the only version available AS_IF([test "x$pycf2" != "xno" && test "x$curpycfver" = "xnone"], [ curpycfver="${pycf2}" ]) WITH_PYTHON=1 PYTHON_LZ=`${curpycfver} --ldflags` PYTHON_CF=`${curpycfver} --cflags` dnl m4_foreach([LiB], [ dnl Py_GetPath, dnl Py_Initialize, dnl PyImport_Import, dnl PyObject_GetAttrString, dnl PyCallable_Check, dnl PyObject_CallObject, dnl Py_Finalize dnl ],[ dnl AC_CHECK_LIB(testveR,LiB,[],[ dnl MISSING_FUNC() dnl ]) dnl ]) ]) AC_SUBST(PYTHON_LZ) AC_SUBST(PYTHON_CF) AC_DEFINE_UNQUOTED([WITH_PYTHON],[$WITH_PYTHON],[Extend the program via python scripts]) AC_DEFINE_UNQUOTED([WITH_PYTHON2],[$WITH_PYTHON2],[Extend the program via python scripts]) dnl AS_IF([test "x$with_python2" = "xyes" || test "x$with_python3" = "xyes"], [ dnl AC_CHECK_HEADERS([testveR/Python.h],[],[ dnl MISSING_HEADER() dnl ]) dnl AC_LINK_IFELSE([ dnl AC_LANG_SOURCE([[ dnl #include <stdio.h> dnl #include <string.h> dnl #include <Python.h> dnl int main(void) { dnl Py_Initialize(); dnl PyRun_SimpleString("from time import time,ctime\n" dnl "print(ctime(time()))\n"); dnl Py_Finalize(); dnl return 0; dnl } dnl ]]) dnl ],[],[ dnl LINK_FAILED([python]) dnl ] dnl ) dnl ]) ]) dnl TEST_LUA() function in configure.ac dnl dnl Substitute lua related linker and dnl cflags to the variables LUA_LIBS dnl if the user enabled the --with-lua switch AC_DEFUN([TEST_LUA],[ LUA_LIBS="" WITH_LUA=0 AC_ARG_WITH([lua], AS_HELP_STRING([--with-lua], [Extend the program via lua scripts]), [], [with_lua=no] ) AS_IF([test "x$with_lua" = "xyes"], [ CHECK_CFLAGZ([-O0]) LUA_LIBS="-llua" WITH_LUA=1 ]) AC_SUBST(LUA_LIBS) AC_DEFINE_UNQUOTED([WITH_LUA],[$WITH_LUA],[Extend the program via lua scripts]) ]) dnl TEST_RUBY() function in configure.ac dnl dnl Substitute ruby related linker and dnl cflags to the variables RUBY_CF and dnl RUBY_LZ if the user enabled the dnl --with-ruby switch AC_DEFUN([TEST_RUBY],[ RUBY_LZ="" RUBY_CF="" WITH_RUBY=0 AC_ARG_WITH([ruby], AS_HELP_STRING([--with-ruby], [Extend the program via ruby scripts]), [], [with_ruby=no] ) AS_IF([test "x$with_ruby" = "xyes"], [ CHECK_CFLAGZ([-O0]) m4_ifndef([PKG_PROG_PKG_CONFIG], [ AC_MSG_ERROR([Either you dont have pkg-config installed, or pkg.m4 is not in 'ls /usr/share/aclocal | grep pkg', if thats so try exporting the following env var: execute 'aclocal --print-ac-dir' without quotes, then: 'export ACLOCAL_PATH=/tmp' where /tmp is the directory printed from the previous command.]) ]) PKG_PROG_PKG_CONFIG() PKG_CHECK_MODULES([RUBY], [ruby-2.0 >= 2.0], [ dnl AC_CHECK_LIB(ruby_init,[],[ dnl MISSING_FUNC() dnl ]) ],[ AC_MSG_ERROR([Your ruby version is too old, consider upgrade.]) ]) RUBY_CF=$RUBY_CFLAGS RUBY_LZ=$RUBY_LIBS WITH_RUBY=1 ]) AC_SUBST(RUBY_LZ) AC_SUBST(RUBY_CF) AC_DEFINE_UNQUOTED([WITH_RUBY],[$WITH_RUBY],[Extend the program via ruby scripts]) ])
void0/pinky
m4/extend.m4
m4
unknown
8,438
dnl 08/03/2016 dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, dnl MA 02110-1301, USA. dnl TEST_MPD() function in configure.ac dnl dnl Substitute the linker flags -lmpdclient to the dnl the variable 'MPD_LIBS' if the user enabled dnl the --with-mpd switch AC_DEFUN([TEST_MPD],[ MPD_LIBS="" AC_ARG_WITH([mpd], AS_HELP_STRING([--with-mpd], [mpd linker flag to show the currently played song]), [], [with_mpd=no] ) AS_IF([test "x$with_mpd" = "xyes"], [ AC_CHECK_HEADERS([mpd/client.h], [ MPD_LIBS="-lmpdclient" ],[ ERR_MUST_INSTALL([libmpdclient]) ]) m4_foreach([LiB], [ mpd_connection_new , mpd_send_command , mpd_recv_song , mpd_connection_get_error , mpd_connection_free , mpd_song_free , mpd_song_get_uri ],[ AC_CHECK_LIB(mpdclient,LiB,[],[ MISSING_FUNC() ]) ]) ]) AC_SUBST(MPD_LIBS) AS_IF([test "x$with_mpd" = "xyes"], [ AC_LINK_IFELSE([ AC_LANG_SOURCE([[ #include <mpd/client.h> int main(void) { struct mpd_connection *conn = NULL; struct mpd_song *song; if (NULL == (conn = mpd_connection_new(NULL, 0, 0))) { return 0; } mpd_connection_free(conn); return 0; } ]]) ],[],[ LINK_FAILED([mpd]) ] ) ]) ])
void0/pinky
m4/mpd.m4
m4
unknown
2,121
dnl 08/10/2015 dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, dnl MA 02110-1301, USA. dnl TEST_NET() function in configure.ac dnl dnl Allow the user to compile the program dnl without net related functions, thus dnl decreasing the required dependencies. dnl dnl Did not included tests for some of the Net dnl headers as they fail to compile just by including dnl them in gcc, but pass the tests in clang. Is there dnl are any _POSIX_SOURCE m4 alternative to compile a dnl test case on the fly ? dnl dnl --with-net will check for the presence of iproute2 headers dnl used in the net functions and substitute appropriate macro dnl so the program to be compiled with/out net functions support. AC_DEFUN([TEST_NET],[ WITH_NET=1 WITH_LIBNL=0 LIBNL_CF="" LIBNL_LZ="" AC_ARG_WITH([net], AS_HELP_STRING([--with-net], [Net funcs]), [], [with_net=yes] ) AC_ARG_WITH([libnl], AS_HELP_STRING([--with-libnl], [wifi funcs]), [], [with_libnl=no] ) AS_IF([test "x$with_net" = "xno"], [ WITH_NET=0 ]) AS_IF([test "x$with_net" = "xyes"], [ AC_CHECK_HEADERS([ \ ifaddrs.h \ arpa/inet.h \ sys/socket.h \ sys/ioctl.h \ netdb.h \ ],[],[ MISSING_HEADER() ]) ifdef([FREEBZD], [ AC_CHECK_HEADERS([ \ arpa/nameser.h \ netinet/in.h \ net/if.h \ net/if_dl.h \ ],[],[ MISSING_HEADER() ]) ],[ ]) ifdef([LINUKS], [ AC_CHECK_HEADERS([ \ linux/if_link.h \ netpacket/packet.h \ linux/sockios.h \ linux/ethtool.h \ ],[],[ MISSING_HEADER() ]) AS_IF([test "x$with_libnl" = "xyes"], [ m4_ifndef([PKG_PROG_PKG_CONFIG], [ AC_MSG_ERROR([Either you dont have pkg-config installed, or pkg.m4 is not in 'ls /usr/share/aclocal | grep pkg', if thats so try exporting the following env var: execute 'aclocal --print-ac-dir' without quotes, then: 'export ACLOCAL_PATH=/tmp' where /tmp is the directory printed from the previous command.]) ]) PKG_PROG_PKG_CONFIG() PKG_CHECK_MODULES([LIBNL], [libnl-3.0 >= 3.0 libnl-genl-3.0 >= 3.0], [ AC_CHECK_LIB(nl-3,nlmsg_data,[],[ MISSING_FUNC() ]) AC_CHECK_LIB(nl-genl-3,genlmsg_put,[],[ MISSING_FUNC() ]) ],[ AC_MSG_ERROR([Your libnl version is too old, consider updating to version three at least]) ]) LIBNL_CF=$LIBNL_CFLAGS LIBNL_LZ=$LIBNL_LIBS WITH_LIBNL=1 ]) ],[ ]) AC_CHECK_FUNCS([ \ getifaddrs \ freeifaddrs \ getaddrinfo \ freeaddrinfo \ socket \ ioctl \ inet_ntop \ ],[],[ MISSING_FUNC() ]) NOTIFY([addrinfo]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> #include <netdb.h> #include <sys/socket.h> int main(void) { struct addrinfo *rp = NULL, *result = NULL; struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_DGRAM; hints.ai_flags = 0; hints.ai_protocol = 0; return 0; } ]]) ],[],[ COMPILE_FAILED([addrinfo]) ] ) NOTIFY([getifaddrs-lite]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <ifaddrs.h> int main(void) { struct ifaddrs *ifaddr; if (-1 == getifaddrs(&ifaddr)) { return 0; } freeifaddrs(ifaddr); return 0; } ]]) ],[],[ COMPILE_FAILED([getifaddrs-lite]) ] ) ifdef([FREEBZD],[ NOTIFY([getifaddrs-heavy]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <arpa/inet.h> #include <arpa/nameser.h> #include <ifaddrs.h> #include <net/if.h> #include <net/if_dl.h> int main(void) { struct ifaddrs *ifaddr = NULL, *ifa = NULL; struct if_data *stats = NULL; struct sockaddr_dl *mac = NULL; if (-1 == getifaddrs(&ifaddr)) { return 0; } freeifaddrs(ifaddr); return 0; } ]]) ],[],[ COMPILE_FAILED([getifaddrs-heavy]) ] ) ],[]) ]) AC_SUBST(LIBNL_CF) AC_SUBST(LIBNL_LZ) AC_DEFINE_UNQUOTED([WITH_NET],[$WITH_NET],[Net funcs]) AC_DEFINE_UNQUOTED([WITH_LIBNL],[$WITH_LIBNL],[wifi funcs]) ]) dnl TEST_PCI() function in configure.ac dnl dnl Allow the user to compile the program dnl without pci related functions, thus dnl decreasing the required dependencies. dnl dnl --with-pci will check for the presence of pci headers and dnl substitute the linker flags -lpci to the variable PCI_LIBS dnl as well will mitigate the GCC -O2 bug. AC_DEFUN([TEST_PCI],[ WITH_PCI=1 PCI_LIBS="" AC_ARG_WITH([pci], AS_HELP_STRING([--with-pci], [PCI funcs]), [], [with_pci=yes] ) ifdef([LINUKS],[],[ WITH_PCI=0 CHECK_CFLAGZ([-O2]) ]) ifdef([LINUKS],[ AS_IF([test "x$with_pci" = "xno"], [ WITH_PCI=0 ifdef([GOT_SENSR],[ CHECK_CFLAGZ([-O0]) ],[ CHECK_CFLAGZ([-O2]) ]) m4_define([NO_PCI],[thenFryAGP]) ]) AS_IF([test "x$with_pci" = "xyes"], [ dnl For very first time I stumble upon GCC -O2 bug. dnl It hangs on pci_init with -O2 CHECK_CFLAGZ([-O0]) AC_CHECK_HEADERS([pci/pci.h], [ PCI_LIBS="-lpci" ],[ ERR_MUST_INSTALL([pciutils]) ]) m4_foreach([LiB], [ pci_alloc , pci_init , pci_scan_bus , pci_fill_info , pci_lookup_name , pci_cleanup ],[ AC_CHECK_LIB(pci,LiB,[],[ MISSING_FUNC() ]) ]) ]) AC_SUBST(PCI_LIBS) AS_IF([test "x$with_pci" = "xyes"], [ AC_LINK_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> #include <pci/pci.h> int main(void) { struct pci_access *pacc= NULL; pacc = pci_alloc(); pci_init(pacc); pci_scan_bus(pacc); if (NULL != pacc) { pci_cleanup(pacc); } return 0; } ]]) ],[],[ LINK_FAILED([pci]) ] ) ]) ],[ ]) AC_DEFINE_UNQUOTED([WITH_PCI],[$WITH_PCI],[PCI funcs]) ])
void0/pinky
m4/net.m4
m4
unknown
7,393
dnl 08/23/2016 dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, dnl MA 02110-1301, USA. dnl TEST_SENSORS() function in configure.ac dnl dnl Substitute the linker flags -lsensors to the dnl the variable 'SENSORS_LIBS' if the user enabled dnl the --with-sensors switch AC_DEFUN([TEST_SENSORS],[ SENSORS_LIBS="" GOT_APM=0 AC_ARG_WITH([sensors], AS_HELP_STRING([--with-sensors], [lm sensors linker flag to obtain voltage, mobo temp and fans]), [], [with_sensors=no] ) AC_ARG_WITH([apm], AS_HELP_STRING([--with-apm], [APM power and resource management for laptops]), [], [with_apm=no] ) AC_ARG_VAR(mobo_sensor, [mobo sensors module name to use in sysctl calls]) AC_ARG_VAR(cpu_sensor, [cpu sensors module name to use in sysctl calls]) ifdef([LINUKS],[ AS_IF([test "x$with_sensors" = "xyes"], [ AC_CHECK_HEADERS([sensors/sensors.h], [ SENSORS_LIBS="-lsensors" ],[ ERR_MUST_INSTALL([lm_sensors]) ]) m4_foreach([LiB], [ sensors_init, sensors_get_value, sensors_get_label, sensors_get_detected_chips, sensors_get_features, sensors_get_all_subfeatures, sensors_cleanup ],[ AC_CHECK_LIB(sensors,LiB,[],[ MISSING_FUNC() ]) ]) ]) ],[ ]) ifdef([FREEBZD],[ if [[ ! -z "${mobo_sensor}" ]] then MOBO_MODL=\""${mobo_sensor}"\" AC_DEFINE_UNQUOTED([MOBO_MODL],[$MOBO_MODL],[mobo sensors module]) fi if [[ ! -z "${cpu_sensor}" ]] then CPU_MODL=\""${cpu_sensor}"\" AC_DEFINE_UNQUOTED([CPU_MODL],[$CPU_MODL],[cpu sensors module]) fi AS_IF([test "x$with_apm" = "xyes"], [ AC_CHECK_HEADERS([machine/apm_bios.h], [ GOT_APM=1 ],[ MISSING_HEADER() ]) ]) AC_DEFINE_UNQUOTED([GOT_APM],[$GOT_APM],[APM power and resource management for laptops]) ],[ ]) AC_SUBST(SENSORS_LIBS) ifdef([LINUKS],[ AS_IF([test "x$with_sensors" = "xyes"], [ AC_LINK_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <sensors/sensors.h> int main(void) { int nr = 0, nr2 = 0, nr3 = 0; const sensors_chip_name *chip; const sensors_feature *features; const sensors_subfeature *subfeatures; double value = 0.0; char *label = NULL; if (0 != (sensors_init(NULL))) { return 0; } while (NULL != (chip = sensors_get_detected_chips(NULL, &nr))) { nr2 = 0; while (NULL != (features = sensors_get_features(chip, &nr2))) { nr3 = 0; while (NULL != (subfeatures = sensors_get_all_subfeatures(chip, features, &nr3))) { switch(subfeatures->type) { case SENSORS_SUBFEATURE_IN_INPUT: case SENSORS_SUBFEATURE_TEMP_INPUT: case SENSORS_SUBFEATURE_FAN_INPUT: { if (0 != (sensors_get_value(chip, subfeatures->number, &value))) { break; } if (NULL == (label = sensors_get_label(chip, features))) { break; } printf("%f\n", (float)value); if (NULL != label) { free(label); } } break; default: continue; } } } } sensors_cleanup(); return 0; } ]]) ],[],[ ERR([Either you miss lm_sensors or your lm_sensors API version is unsupported by pinky-bar.]) ] ) ]) ],[ ]) ifdef([OPENBZD], [ AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/sensors.h> int main(void) { struct sensordev dev; struct sensor sens; SENSOR_VOLTS_DC; SENSOR_TEMP; SENSOR_FANRPM; SENSOR_FINVALID; SENSOR_FUNKNOWN; return 0; } ]]) ],[],[ COMPILE_FAILED([sensors]) ] ) ],[ ]) AS_IF([test "x$with_sensors" = "xyes"], [ ifdef([NO_PCI],[ CHECK_CFLAGZ([-O0]) ],[]) m4_define([GOT_SENSR],[meltCPU]) ]) ])
void0/pinky
m4/sensors.m4
m4
unknown
5,290
dnl 08/03/2016 dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, dnl MA 02110-1301, USA. dnl Internal function to let the user know dnl when some of the compile tests is about to begin AC_DEFUN([NOTIFY],[ AC_MSG_NOTICE([performing $1 compile test.]) ]) dnl TEST_SOME_FUNCS() function in configure.ac dnl dnl The tests are simple enough, just to dnl catch misbehaving compiler and/or dnl installed C libraries. AC_DEFUN([TEST_SOME_FUNCS],[ NOTIFY([strftime]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <time.h> int main(void) { char test[200]; time_t t = time(NULL); strftime(test, 190, "%I:%M %p", localtime(&t)); return 0; } ]]) ],[],[ COMPILE_FAILED([strftime]) ] ) NOTIFY([statvfs]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdlib.h> #include <sys/statvfs.h> int main(void) { struct statvfs ssd; statvfs(getenv("HOME"), &ssd); ssd.f_blocks; ssd.f_bsize; ssd.f_bavail; ssd.f_bfree; return 0; } ]]) ],[],[ COMPILE_FAILED([statvfs storage]) ] ) NOTIFY([uname]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <sys/utsname.h> int main(void) { struct utsname KerneL; uname(&KerneL); KerneL.sysname; KerneL.nodename; KerneL.release; KerneL.version; KerneL.machine; return 0; } ]]) ],[],[ COMPILE_FAILED([uname Kernel]) ] ) ifdef([LINUKS],[ NOTIFY([sysinfo]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <sys/sysinfo.h> int main(void) { struct sysinfo inf; sysinfo(&inf); inf.totalram; inf.freeram; inf.sharedram; inf.bufferram; inf.loads[0]; inf.loads[1]; inf.loads[2]; return 0; } ]]) ],[],[ COMPILE_FAILED([sysinfo RAM and average load]) ] ) ],[]) NOTIFY([openNreadFile]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> int main(void) { FILE *test = fopen("/proc/stat", "r"); if (NULL == test) { return 0; } fclose(test); return 0; } ]]) ],[],[ COMPILE_FAILED([openNreadFile]) ] ) NOTIFY([memset]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <string.h> #include <stdint.h> int main(void) { uintmax_t test[5]; memset(test, 0, sizeof(test)); return 0; } ]]) ],[],[ COMPILE_FAILED([memset]) ] ) ifdef([LINUKS],[ NOTIFY([glob]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <glob.h> int main(void) { glob_t gl; return 0; } ]]) ],[],[ COMPILE_FAILED([glob]) ] ) ],[]) NOTIFY([sysconf]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <time.h> #include <unistd.h> int main(void) { if (-1 == (sysconf(_SC_CLK_TCK))) { return 0; } return 0; } ]]) ],[],[ COMPILE_FAILED([sysconf]) ] ) NOTIFY([snprintf]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> int main(void) { char test[10]; snprintf(test, 8, "%s", "hi"); return 0; } ]]) ],[],[ COMPILE_FAILED([snprintf]) ] ) NOTIFY([getopt]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <getopt.h> #define NULL ((void *)0) int main(void) { const struct option options[] = { { "mpd", no_argument, NULL, 'M' }, { "statio", required_argument, NULL, 'S' }, { NULL, 0, NULL, 0 } }; return 0; } ]]) ],[],[ COMPILE_FAILED([getopt]) ] ) NOTIFY([timespec]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <time.h> int main(void) { struct timespec tc = {0}; tc.tv_nsec = 85000L; return 0; } ]]) ],[],[ COMPILE_FAILED([timespec]) ] ) NOTIFY([popen]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> int main(void) { char hi[30]; FILE *test = popen("echo elo", "r"); fscanf(test, "%s", hi); pclose(test); return 0; } ]]) ],[],[ COMPILE_FAILED([popen]) ] ) NOTIFY([clock_gettime]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <time.h> int main(void) { struct timespec tc1 = {0}, tc2 = {0}; clock_gettime(CLOCK_MONOTONIC, &tc1); #if defined(__linux__) clock_gettime(CLOCK_BOOTTIME, &tc2); #endif return 0; } ]]) ],[],[ COMPILE_FAILED([clock_gettime]) ] ) ifdef([FREEBZD],[ NOTIFY([getloadavg]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdlib.h> int main(void) { double up[3]; getloadavg(up, 3); return 0; } ]]) ],[],[ COMPILE_FAILED([getloadavg]) ] ) NOTIFY([sysctl]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/sysctl.h> #define SYSCTLVAL(x, y, z) \ if (0 != sysctlbyname(x, y, z, NULL, 0)) { \ return 0; \ } int main(void) { u_int dummy = 0; size_t len = sizeof(dummy); SYSCTLVAL("vm.stats.vm.v_page_size", &dummy, &len); return 0; } ]]) ],[],[ COMPILE_FAILED([sysctl]) ] ) NOTIFY([malloc]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> #include <stdlib.h> int main(void) { char *a = (char *)malloc(10); if (NULL == a) { return 0; } free(a); return 0; } ]]) ],[],[ COMPILE_FAILED([malloc]) ] ) m4_foreach([LiB], [ devstat_checkversion , devstat_getdevs , devstat_selectdevs ],[ AC_CHECK_LIB(devstat,LiB,[],[ MISSING_FUNC() ]) ]) NOTIFY([devstat]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> #include <stdlib.h> #include <devstat.h> int main(void) { struct statinfo stats; struct device_selection *dev_select = NULL; struct devstat *d = NULL; devstat_checkversion(NULL); return 0; } ]]) ],[],[ COMPILE_FAILED([devstat]) ] ) m4_foreach([LiB], [ argp_parse , argp_usage ],[ AC_CHECK_LIB(argp,LiB,[],[ MISSING_FUNC() ]) ]) NOTIFY([xswdev-swap]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <inttypes.h> #include <sys/types.h> #include <sys/param.h> #include <sys/stat.h> #include <sys/sysctl.h> #include <vm/vm_param.h> int main(void) { struct xswdev xsw; u_int pagesize = 4096, dummy = 0; uintmax_t total = 0, used = 0, pz = 0; int mib[20]; memset(mib, 0, sizeof(mib)); size_t mibi = sizeof(mib) / sizeof(mib[0]); size_t len = sizeof(dummy), sisi = sizeof(struct xswdev); pz = (uintmax_t)pagesize; if (0 != (sysctlnametomib("vm.swap_info", mib, &mibi))) { return 0; } if (0 != (sysctl(mib, (u_int)(mibi + 1), &xsw, &sisi, NULL, 0))) { return 0; } if (xsw.xsw_version != XSWDEV_VERSION) { return 0; } used = (uintmax_t)xsw.xsw_used; total = (uintmax_t)xsw.xsw_nblks; return 0; } ]]) ],[],[ COMPILE_FAILED([xswdev-swap]) ] ) ],[]) ifdef([OPENBZD],[ NOTIFY([swapctl]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> #include <sys/swap.h> int main(void) { struct swapent *dev = NULL; swapctl(SWAP_NSWAP, 0, 0); return 0; } ]]) ],[],[ COMPILE_FAILED([swapctl]) ] ) NOTIFY([apm battery]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> #include <stdint.h> #include <fcntl.h> #include <sys/ioctl.h> #include <machine/apmvar.h> int main(void) { struct apm_power_info bstate; int fd = 0; uintmax_t dummy = 0; memset(&bstate, 0, sizeof(struct apm_power_info)); if (0 != (fd = open("/dev/apm", O_RDONLY))) { return 0; } if (0 != (ioctl(fd, APM_IOC_GETPOWER, &bstate))) { close(fd); return 0; } close(fd); if (APM_BATT_UNKNOWN == bstate.battery_state || APM_BATTERY_ABSENT == bstate.battery_state) { return 0; } dummy = (uintmax_t)bstate.battery_life; return 0; } ]]) ],[],[ COMPILE_FAILED([apm battery]) ] ) ],[]) ])
void0/pinky
m4/the_rest_funcs.m4
m4
unknown
10,148
dnl 08/03/2016 dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, dnl MA 02110-1301, USA. dnl Internal function to perform dnl explicit data check type AC_DEFUN([CHECK_TYPEZ],[ AC_CHECK_TYPES([$1],[],[ AC_MSG_WARN([Some C data type failed, checking which one.]) m4_foreach([tYpe], [$1],[ AC_CHECK_SIZEOF(tYpe) ])dnl ERR([Your compiler does not understand C data types.]) ]) ]) dnl TEST_TYPEZ() function in configure.ac dnl dnl Check for the presence of all used dnl library functions, their header files dnl and some int types. 64bit is not dnl mandatory since uintmax makes it dnl easy for us. AC_DEFUN([TEST_TYPEZ],[ CHECK_TYPEZ([ size_t, time_t, float, double, signed char, unsigned char, signed short int, int8_t, signed int, int16_t, signed long int, int32_t, intmax_t, unsigned short int, uint8_t, unsigned int, uint16_t, unsigned long int, uint32_t, uintmax_t, int_least8_t, int_least16_t, int_least32_t, uint_least8_t, uint_least16_t, uint_least32_t, int_fast8_t, int_fast16_t, int_fast32_t, uint_fast8_t, uint_fast16_t, uint_fast32_t ]) AC_CHECK_HEADERS([ \ time.h \ stdio.h \ stdbool.h \ string.h \ inttypes.h \ sys/statvfs.h \ sys/utsname.h \ unistd.h \ getopt.h \ sys/socket.h \ ],[],[ MISSING_HEADER() ]) ifdef([FREEBZD], [ AC_CHECK_HEADERS([ \ sys/types.h \ sys/sysctl.h \ sys/param.h \ sys/stat.h \ vm/vm_param.h \ ],[],[ MISSING_HEADER() ]) ], [ ifdef([LINUKS],[ AC_CHECK_HEADERS([ \ argp.h \ sys/sysinfo.h \ glob.h \ ],[],[ MISSING_HEADER() ]) ],[ ]) ]) AC_CHECK_FUNCS([ \ memset \ printf \ snprintf \ nanosleep \ sysconf \ strcmp \ fscanf \ fclose \ fopen \ statvfs \ getenv \ popen \ uname \ strftime \ exit \ getopt \ getopt_long \ ],[],[ MISSING_FUNC() ]) ifdef([FREEBZD], [ AC_CHECK_FUNCS([ \ sysctl \ sysctlbyname \ sysctlnametomib \ getloadavg \ malloc \ free \ ],[],[ MISSING_FUNC() ]) ], [ ifdef([LINUKS],[ AC_CHECK_FUNCS([ \ sysinfo \ glob \ globfree \ argp_parse \ argp_usage \ ],[],[ MISSING_FUNC() ]) ],[ ]) ]) ])
void0/pinky
m4/typez.m4
m4
unknown
3,490
dnl 10/07/2016 dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, dnl MA 02110-1301, USA. dnl TEST_WEATHER() function in configure.ac dnl dnl Substitute the linker flags -lcurl to the dnl the variable 'CURL_LIBS' if the user enabled dnl the --with-weather switch AC_DEFUN([TEST_WEATHER],[ CURL_LIBS="" API_KEY=\""g0tm1lf"\" DRIVE_PORT=\""7634"\" WITH_WEATHER=0 WITH_DRIVETEMP=0 WITH_DRIVETEMP_LIGHT=0 AC_ARG_WITH([weather], AS_HELP_STRING([--with-weather], [weather linker flag to show the todays temperature]), [], [with_weather=no] ) AC_ARG_WITH([drivetemp], AS_HELP_STRING([--with-drivetemp], [Read the drive temperature from S.M.A.R.T]), [], [with_drivetemp=no] ) AC_ARG_WITH([drivetemp-light], AS_HELP_STRING([--with-drivetemp-light], [Read the drive temperature from S.M.A.R.T]), [], [with_drivetemp_light=no] ) AC_ARG_WITH([smartemp], AS_HELP_STRING([--with-smartemp], [Read the drive temperature from S.M.A.R.T]), [], [with_smartemp=no] ) AC_ARG_VAR(drive_port, [TCP port to listen to]) AC_ARG_VAR(api_key, [weather api key]) AS_IF([test "x$with_drivetemp" = "xyes" && test "x$with_drivetemp_light" = "xyes"],[ with_drivetemp=no ]) ifdef([LINUKS],[ AS_IF([test "x$with_drivetemp_light" = "xyes"],[ WITH_DRIVETEMP_LIGHT=1 AC_CHECK_HEADERS([ \ sys/socket.h \ netdb.h \ ],[],[ MISSING_HEADER() ]) NOTIFY([drivetemp-light]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> #include <unistd.h> #include <netdb.h> #include <sys/socket.h> #define CLOSE_FD2(fd, res) \ if (-1 == (close(fd))) { \ freeaddrinfo(res); \ exit(EXIT_FAILURE); \ } int main(void) { struct addrinfo *rp = NULL, *result = NULL, hints; int sock = 0; char buf[200]; bool got_conn = false; ssize_t len = 0; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; if (0 != (getaddrinfo("127.0.0.1", "7634", &hints, &result))) { return EXIT_FAILURE; } for (rp = result; NULL != rp; rp = rp->ai_next) { sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if (-1 == sock) { continue; } if (NULL == rp->ai_addr) { CLOSE_FD2(sock, result); continue; } if (0 == (connect(sock, rp->ai_addr, rp->ai_addrlen))) { len = recv(sock, buf, sizeof(buf), 0); got_conn = true; break; } CLOSE_FD2(sock, result); } if (true == got_conn) { CLOSE_FD2(sock, result); if (0 < len) { printf("%s\n", buf); } } if (NULL != result) { freeaddrinfo(result); } return EXIT_SUCCESS; } ]]) ],[],[ COMPILE_FAILED([drivetemp-light]) ] ) ]) AS_IF([test "x$with_drivetemp" = "xyes"],[ WITH_DRIVETEMP=1 ]) if [[ ! -z "${drive_port}" ]] then DRIVE_PORT=\""${drive_port}"\" fi ],[ ]) AS_IF([test "x$with_weather" = "xyes" || test "x$with_drivetemp" = "xyes"], [ CHECK_CFLAGZ([-O0]) AC_CHECK_HEADERS([curl/curl.h], [ CURL_LIBS="-lcurl" ],[ ERR_MUST_INSTALL([curl and or libcurl]) ]) m4_foreach([LiB], [ curl_global_init , curl_easy_init , curl_easy_setopt , curl_easy_perform , curl_easy_cleanup , curl_global_cleanup ],[ AC_CHECK_LIB(curl,LiB,[],[ MISSING_FUNC() ]) ]) if [[ ! -z "${api_key}" ]] then API_KEY=\""${api_key}"\" fi AS_IF([test "x$with_weather" = "xyes"],[ WITH_WEATHER=1 AC_DEFINE_UNQUOTED([API_KEY],[$API_KEY],[weather api key]) ]) ]) AC_SUBST(CURL_LIBS) AC_DEFINE_UNQUOTED([WITH_WEATHER],[$WITH_WEATHER],[Santa is here]) AC_DEFINE_UNQUOTED([DRIVE_PORT],[$DRIVE_PORT],[TCP port to listen to]) AC_DEFINE_UNQUOTED([WITH_DRIVETEMP],[$WITH_DRIVETEMP],[Gettin hot in here]) AC_DEFINE_UNQUOTED([WITH_DRIVETEMP_LIGHT],[$WITH_DRIVETEMP_LIGHT],[Gettin hot in here]) AS_IF([test "x$with_weather" = "xyes" || test "x$with_drivetemp" = "xyes"], [ AC_LINK_IFELSE([ AC_LANG_SOURCE([[ #include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl = NULL; CURLcode res; curl_global_init(CURL_GLOBAL_ALL); if (NULL == (curl = curl_easy_init())) { goto error; } curl_easy_setopt(curl, CURLOPT_URL, "http://google.com"); curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "gzip"); res = curl_easy_perform(curl); if (CURLE_OK != res) { goto error; } error: if (NULL != curl) { curl_easy_cleanup(curl); } curl_global_cleanup(); return 0; } ]]) ],[],[ LINK_FAILED([curl]) ] ) ]) ])
void0/pinky
m4/weather.m4
m4
unknown
6,220
dnl Copyright 07/06/2015, 08/03/2016 dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, dnl MA 02110-1301, USA. dnl TEST_X11() function in configure.ac dnl dnl Check for the presence of X11 headers and dnl substitute the linker flags -lX11 to the dnl the variable 'X_LIBS' if they are available. AC_DEFUN([TEST_X11],[ X_LIBS="" WITH_COLOURS=0 AC_ARG_WITH([x11], AS_HELP_STRING([--with-x11], [X11 linker flag for dwm support]), [], [with_x11=no] ) AC_ARG_WITH([colours], AS_HELP_STRING([--with-colours], [Colorize the output]), [], [with_colours=no] ) AC_ARG_VAR(icons, [path to xbm icons for non-dwm WM]) AS_IF([test "x$with_colours" = "xyes"], [ WITH_COLOURS=1 ]) AS_IF([test "x$with_x11" = "xyes"], [ AC_CHECK_HEADERS([X11/Xlib.h], [ X_LIBS="-lX11" ],[ ERR_MUST_INSTALL([xorg and libx11]) ]) m4_foreach([LiB], [ XOpenDisplay, XStoreName, XSync, XCloseDisplay ],[ AC_CHECK_LIB(X11,LiB,[],[ MISSING_FUNC() ]) ]) ]) dnl xbm icons for non-dwm window manager if [[ ! -z "${icons}" ]] then dnl Da stupid shell expansion only works on "UNQUOTED" ICONZ=\""${icons}"\" AC_DEFINE_UNQUOTED([ICONS_DIR],[$ICONZ],[xbm icons for non-dwm WM]) fi AC_SUBST(X_LIBS) AC_DEFINE_UNQUOTED([WITH_COLOURS],[$WITH_COLOURS],[Colorize the output]) AS_IF([test "x$with_x11" = "xyes"], [ AC_LINK_IFELSE([ AC_LANG_SOURCE([[ #include <X11/Xlib.h> int main(void) { Display *display; Window window; XEvent evt; return 0; } ]]) ],[],[ LINK_FAILED([X11]) ] ) ]) AS_IF([test "x$with_x11" = "xno"], [ TEST_NCURSES() ]) ]) dnl Test for the presence of the ncurses library dnl and substitute macro to determine whether the dnl program to be compiled with/out ncurses colours AC_DEFUN([TEST_NCURSES], [ WITH_NCURSES=0 AC_ARG_WITH([ncurses], AS_HELP_STRING([--with-ncurses], [Output the data to your terminal using the ncurses library.]), [], [with_ncurses=no] ) AS_IF([test "x$with_ncurses" = "xyes"], [ AC_CHECK_HEADERS([ncurses.h], [ WITH_NCURSES=1 ],[ ERR_MUST_INSTALL([ncurses]) ]) m4_foreach([LiB], [ initscr , noecho , cbreak , halfdelay , nonl , intrflush , curs_set , start_color , init_pair , refresh , clear , endwin , has_colors , pair_content , wattrset , waddch ],[ AC_CHECK_LIB(ncurses,LiB,[],[ MISSING_FUNC() ]) ]) ]) AS_IF([test "x$with_ncurses" = "xyes"], [ AC_LINK_IFELSE([ AC_LANG_SOURCE([[ #include <ncurses.h> int main(void) { initscr(); printw("elo"); refresh(); endwin(); return 0; } ]]) ],[],[ LINK_FAILED([ncurses]) ] ) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include <stdlib.h> #include <unistd.h> #include <signal.h> void sighandler(int num); void sighandler(int num) { exit(1); } int main(void) { signal(SIGINT, sighandler); return 0; } ]]) ],[],[ COMPILE_FAILED([signal]) ] ) ]) AC_DEFINE_UNQUOTED([WITH_NCURSES],[$WITH_NCURSES],[Where to output the data]) ])
void0/pinky
m4/x11.m4
m4
unknown
4,293
# 11/01/2016 # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. use strict; use warnings; use File::Copy; use List::Util qw(any); sub re_read { my ($filename) = @_; my $derefs = $$filename; my $fh; open($fh, '<:encoding(UTF-8)', $derefs) or die "Could not open file '$derefs' $!"; local $/ = undef; # <--- slurp mode my $concatArr = <$fh>; close($fh); return \$concatArr; } sub re_write { my ($filename,$concatArr) = @_; my $derefs = $$filename; my $fh; open($fh, '>:encoding(UTF-8)', $derefs) or die "Could not open file '$derefs' $!"; print $fh $$concatArr; close($fh); return; } sub reflace_configure { my ($new) = @_; my $filename = "configure.ac"; my @arr = split("\n",${re_read(\$filename)}); if ($arr[9]) { $arr[9] = $$new; } my $concatArr = join("\n", @arr); re_write(\$filename,\$concatArr); return; } sub reflace_many { my ($arr,$filename) = @_; my $derefFilename = $$filename; my @arr2 = @$arr; my ($x,$arrLen) = (0,$#arr2); my $derefs = ${re_read(\$derefFilename)}; for (; $x <= $arrLen; $x++) { $derefs =~ s/${$arr2[$x][0]}/${$arr2[$x][1]}/g; } re_write(\$derefFilename,\$derefs); return; } sub reflace_single { my ($ag1,$ag2,$filename) = @_; my $derefFilename = $$filename; my $derefs = ${re_read(\$derefFilename)}; $derefs =~ s/$$ag1/$$ag2/g; re_write(\$derefFilename,\$derefs); return; } { if (-1 == $#ARGV) { die "No OS/Distro supplied."; } my $osEntered = uc $ARGV[0]; my @osArr = ( "ARCHLINUX","DEBIAN", "GENTOO","SLACKWARE", "RHEL","FRUGALWARE", "ANGSTROM","FREEBSD","OPENBSD" ); my $hasMatch = any { $_ eq $osEntered } @osArr; if ($hasMatch eq "") { die "Invalid OS/Distro supplied."; } my $srcMake = "src/Makefile.am"; my $defTits = "m4_define([cuRos],[$osEntered])"; my $bsdCF = "-D_DEFAULT_SOURCE -L/usr/local/lib"; my $posixCF = "-D_POSIX_C_SOURCE=200112L"; my ($amStr, $srcStr, $bsdStr) = ("{amCF}","{srcFiles}","{bzdlibs}"); my ($amCF, $srcToAppend, $bsdLibs) = ("", "", ""); if ($osEntered eq "FREEBSD") { $bsdLibs = "-largp -ldevstat"; $amCF = \$bsdCF; $defTits = "$defTits m4_define([FREEBZD], [tits])"; $srcToAppend = "freebsd_functions.c include/freebzd.h"; } elsif ($osEntered eq "OPENBSD") { $bsdLibs = "-largp -lossaudio"; $amCF = \$bsdCF; $defTits = "$defTits m4_define([OPENBZD], [forSure])"; $srcToAppend = "openbsd_functions.c include/openbzd.h"; } else { $amCF = \$posixCF; $defTits = "$defTits m4_define([LINUKS], [cryMeAriver])"; $srcToAppend = "linux_functions.c"; } copy("src/Makefail.skel",$srcMake) or die "Could not copy src/Makefail.skel $!"; reflace_configure(\$defTits); my @hugeArr = ( [\$amStr, \$$amCF], [\$srcStr, \$srcToAppend], [\$bsdStr, \$bsdLibs] ); reflace_many(\@hugeArr,\$srcMake); }
void0/pinky
set.pl
Perl
unknown
3,552
AM_CFLAGS = {amCF} \ -I/usr/local/include $(LIBNL_CF) $(PERL_CF) $(PYTHON_CF) $(RUBY_CF) bin_PROGRAMS = pinkybar pinkybar_LDADD = $(X_LIBS) $(ALSA_LIBS) $(MPD_LIBS) $(PCI_LIBS) $(DVD_LIBS) $(SENSORS_LIBS) $(CURL_LIBS) $(LIBNL_LZ) $(PERL_LZ) $(LUA_LIBS) $(PYTHON_LZ) $(RUBY_LZ) {bzdlibs} pinkybar_SOURCES = main.c \ cpu.c \ common.c \ sound.c \ options.c \ net.c \ weather.c \ smart.c \ perl.c \ lua.c \ ruby.c \ python.c \ prototypes/cpu.h \ prototypes/common.h \ prototypes/sound.h \ prototypes/net.h \ prototypes/functions.h \ prototypes/options.h \ prototypes/weather.h \ prototypes/smart.h \ prototypes/perl.h \ prototypes/lua.h \ prototypes/ruby.h \ prototypes/python.h \ include/headers.h \ include/options_constants.h \ include/functions_constants.h \ include/non_x11_colours.h \ include/x11_colours.h \ include/options_generator.h \ {srcFiles}
void0/pinky
src/Makefail.skel
skel
unknown
1,446
/* 08/06/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Functions shared between different operating * zyztemz or are short enough that doesn't meet the * 100 lines requirement to be put in standalone module */ #include "config.h" /* Auto-generated */ #include <ctype.h> #include <sys/statvfs.h> #include <sys/utsname.h> #if defined(__linux__) #include <glob.h> #endif /* __linux__ */ #if defined (HAVE_X11_XLIB_H) #include <X11/Xlib.h> #endif #if defined(HAVE_CDIO_CDIO_H) #include <cdio/cdio.h> #include <cdio/mmc.h> #endif /* HAVE_CDIO_CDIO_H */ #include "include/headers.h" #if defined(__FreeBSD__) #include "include/freebzd.h" #endif /* __FreeBSD__ */ #if defined(__OpenBSD__) #include "include/openbzd.h" #endif /* __OpenBSD__ */ #if defined(__linux__) static uint_fast16_t glob_packages(const char *); #endif /* __linux__ */ void exit_with_err(const char *str1, const char *str2) { FPRINTF("%s %s\n", str1, str2); exit(EXIT_FAILURE); } #if defined(__linux__) void get_temp(const char *str1, char *str2) { uint_least32_t temp = 0; FILE *fp = NULL; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" OPEN_X(fp, str1, SCAN_ULINT, &temp); #pragma GCC diagnostic pop if (99999 < temp) { /* > 99C */ FILL_ARR(str2, ULINT, temp / 10000); } else { FILL_ARR(str2, ULINT, ((9999 < temp) ? temp / 1000 : temp / 100)); /* > 9C || < 9C */ } } #endif /* __linux__ */ #if defined(__FreeBSD__) void get_temp(char *str1, uint_least32_t temp) { if (9999 < temp) { /* > 99C */ FILL_ARR(str1, ULINT, temp / 1000); } else { FILL_ARR(str1, ULINT, ((999 < temp) ? temp / 100 : temp / 10)); /* > 9C || < 9C */ } } #endif /* __FreeBSD__ */ void check_fan_vals(char *str1, uint_fast16_t *rpm, uint_fast16_t iterz) { uint_fast16_t x = 0, y = 0; char buffer[VLA]; char *all_fans = buffer; for (x = 0; x < iterz; x++) { if (0 != rpm[x]) { GLUE2(all_fans, UFINT" ", rpm[x]); } else { ++y; /* non-spinning | removed | failed fan */ } } FILL_STR_ARR(1, str1, (y != x ? buffer : NOT_FOUND)); } void get_ssd(char *str1, uint8_t num) { uintmax_t val = 0; struct statvfs ssd; memset(&ssd, 0, sizeof(struct statvfs)); if (-1 == (statvfs(getenv("HOME"), &ssd))) { FUNC_FAILED("statvfs()"); } switch(num) { case 1: FILL_ARR(str1, FMT_UINT "%s", (uintmax_t)(ssd.f_blocks * ssd.f_bsize) / GB, "GB"); break; case 2: FILL_ARR(str1, FMT_UINT "%s", (uintmax_t)(ssd.f_bfree * ssd.f_bsize) / GB, "GB"); break; case 3: FILL_ARR(str1, FMT_UINT "%s", (uintmax_t)(ssd.f_bavail * ssd.f_bsize) / GB, "GB"); break; case 4: { val = (uintmax_t)(( ssd.f_blocks - ssd.f_bfree) * ssd.f_bsize) / GB; FILL_UINT_ARR(str1, val); } break; } } void get_kernel(char *str1, uint8_t num) { struct utsname KerneL; memset(&KerneL, 0, sizeof(struct utsname)); if (-1 == (uname(&KerneL))) { FUNC_FAILED("uname()"); } switch(num) { case 1: FILL_STR_ARR(1, str1, KerneL.sysname); break; case 2: FILL_STR_ARR(1, str1, KerneL.nodename); break; case 3: FILL_STR_ARR(1, str1, KerneL.release); break; case 4: FILL_STR_ARR(1, str1, KerneL.version); break; case 5: FILL_STR_ARR(1, str1, KerneL.machine); break; case 6: FILL_STR_ARR(2, str1, KerneL.sysname, KerneL.release); break; } } #if defined(__linux__) /* Source (my improved screenfetch-c fork): * https://github.com/wifiextender/screenfetch-c/blob/master/src/plat/linux/detect.c */ static uint_fast16_t glob_packages(const char *str1) { uint_fast16_t packs_num = 0; glob_t gl; if (0 == (glob(str1, GLOB_NOSORT, NULL, &gl))) { packs_num = gl.gl_pathc; } else { exit_with_err("Could not traverse", str1); } globfree(&gl); return packs_num; } #endif /* __linux__ */ /* Let the compiler strip the code * instead conditionally checking * each time the program is executed */ void get_packs(char *str1) { uint_fast16_t packages = 0; FILE *pkgs_file = NULL; #if defined(ARCHLINUX) packages = glob_packages("/var/lib/pacman/local/*"); #elif defined(FRUGALWARE) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" CHECK_POPEN(pkgs_file, "pacman-g2 -Q 2> /dev/null | wc -l", &packages); #pragma GCC diagnostic pop #elif defined(DEBIAN) packages = glob_packages("/var/lib/dpkg/info/*.list"); #elif defined(SLACKWARE) packages = glob_packages("/var/log/packages/*"); #elif defined(GENTOO) packages = glob_packages("/var/db/pkg/*/*"); #elif defined(RHEL) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" CHECK_POPEN(pkgs_file, "rpm -qa 2> /dev/null | wc -l", &packages); #pragma GCC diagnostic pop #elif defined(ANGSTROM) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" CHECK_POPEN(pkgs_file, "opkg list-installed 2> /dev/null | wc -l", &packages); #pragma GCC diagnostic pop #elif defined(FREEBSD) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" CHECK_POPEN(pkgs_file, "pkg info | wc -l", &packages); #pragma GCC diagnostic pop #elif defined(OPENBSD) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" CHECK_POPEN(pkgs_file, "pkg_info | wc -l", &packages); #pragma GCC diagnostic pop #endif FILL_ARR(str1, UFINT, packages); } void get_uptime(char *str1) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmissing-field-initializers" struct timespec tc = {0}; #pragma GCC diagnostic pop uintmax_t now = 0; #if defined(__linux__) if (-1 == (clock_gettime(CLOCK_BOOTTIME, &tc))) { FUNC_FAILED("clock_gettime()"); } now = (uintmax_t)tc.tv_sec; #else int mib[] = { CTL_KERN, KERN_BOOTTIME }; time_t t; size_t len = sizeof(tc); if (0 != (sysctl(mib, 2, &tc, &len, NULL, 0))) { FUNC_FAILED("sysctl()"); } if (-1 == (t = time(NULL))) { FUNC_FAILED("time()"); } now = (uintmax_t)t - (uintmax_t)tc.tv_sec; #endif /* __linux__ */ if (0 != (now / 86400)) { /* days */ FILL_ARR(str1, FMT_UINT "d " FMT_UINT "h " FMT_UINT "m", (now / 86400), ((now / 3600) % 24), ((now / 60) % 60)); return; } if (59 < (now / 60)) { /* hours */ FILL_ARR(str1, FMT_UINT "h " FMT_UINT "m", ((now / 3600) % 24), ((now / 60) % 60)); return; } FILL_ARR(str1, FMT_UINT "m", ((now / 60) % 60)); } /* The `strftime' man page showed potential bugs */ void get_taim(char *str1) { char time_str[VLA]; time_t t = 0; struct tm *taim = NULL; if (-1 == (t = time(NULL)) || NULL == (taim = localtime(&t)) || 0 == (strftime(time_str, VLA, "%I:%M %p", taim))) { exit_with_err(ERR, "time() or localtime() or strftime() failed"); } FILL_STR_ARR(1, str1, time_str); } #if defined (HAVE_X11_XLIB_H) void set_status(const char *str1) { Display *display = XOpenDisplay(NULL); if (display) { XStoreName(display, DefaultRootWindow(display), str1); XSync(display, 0); XCloseDisplay(display); } else { exit_with_err(CANNOT_OPEN, "X server"); } } #endif /* HAVE_X11_XLIB_H */ #if !defined(HAVE_SENSORS_SENSORS_H) && !defined(__OpenBSD__) void get_fans(char *str1) { bool found_fans = true; char tempstr[VLA]; uint_fast16_t x = 0, y = 0, z = 0, rpm[MAX_FANS+1]; memset(rpm, 0, sizeof(rpm)); #if defined(__linux__) FILE *fp = NULL; for (x = 1; x < MAX_FANS; x++, z++) { FILL_ARR(tempstr, FAN_FILE, x); if (NULL == (fp = fopen(tempstr, "r"))) { if (1 == x) { /* no system fans at all */ FILL_STR_ARR(1, str1, NOT_FOUND); found_fans = false; } break; } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" CHECK_FSCANF(fp, SCAN_UFINT, &rpm[z]); #pragma GCC diagnostic pop CLOSE_X(fp); } #else u_int fan[3]; memset(fan, 0, sizeof(fan)); size_t len = sizeof(fan); for (x = 0; x < MAX_FANS; x++, z++) { FAN_STR(tempstr, x); memset(fan, 0, len); if (0 != (sysctlbyname(tempstr, &fan, &len, NULL, 0))) { if (0 == x) { /* no system fans at all */ FILL_STR_ARR(1, str1, NOT_FOUND); found_fans = false; } break; } rpm[x] = (uint_fast16_t)fan[0]; } #endif /* __linux__ */ if (true == found_fans) { check_fan_vals(str1, rpm, z); } } #endif /* !HAVE_SENSORS_SENSORS_H && !__OpenBSD__ */ #if defined(HAVE_CDIO_CDIO_H) void get_dvd(char *str1) { CdIo_t *p_cdio = cdio_open(NULL, DRIVER_DEVICE); cdio_hwinfo_t hwinfo; FILL_STR_ARR(1, str1, "Null"); if (NULL == p_cdio) { return; } if (true == (mmc_get_hwinfo(p_cdio, &hwinfo))) { FILL_STR_ARR(2, str1, hwinfo.psz_vendor, hwinfo.psz_model); } if (NULL != p_cdio) { cdio_destroy(p_cdio); } } #else #if defined(__linux__) void get_dvd(char *str1) { FILE *fp = NULL; char vendor[100], model[100]; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" OPEN_X(fp, DVD_VEND, "%s", vendor); #pragma GCC diagnostic pop #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" OPEN_X(fp, DVD_MODEL, "%s", model); #pragma GCC diagnostic pop FILL_STR_ARR(2, str1, vendor, model); } #endif /* __linux__ */ #endif /* HAVE_CDIO_CDIO_H */ #if defined(__FreeBSD__) || defined(__OpenBSD__) void get_loadavg(char *str1) { double up[3]; memset(up, 0, sizeof(up)); if (-1 == (getloadavg(up, 3))) { FUNC_FAILED("getloadavg()"); } FILL_ARR(str1, "%.2f %.2f %.2f", (float)up[0], (float)up[1], (float)up[2]); } #endif /* __FreeBSD__ || __OpenBSD__ */ void split_n_index(char *str1) { char *ptr = str1; for (; *ptr; ptr++) { if (0 != (isspace((unsigned char) *ptr))) { break; } *str1++ = *ptr; } *str1 = '\0'; }
void0/pinky
src/common.c
C++
unknown
10,619
/* 08/06/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" /* Auto-generated */ #include "include/headers.h" #include "prototypes/cpu.h" #if defined(__FreeBSD__) #include "include/freebzd.h" #endif /* __FreeBSD__ */ #if defined(__OpenBSD__) #include "include/openbzd.h" #endif /* __OpenBSD__ */ void get_cpu(char *str1) { static uintmax_t previous_total = 0, previous_idle = 0; uintmax_t total = 0, percent = 0, diff_total = 0, diff_idle = 0; uintmax_t cpu_active[LOOP_ITERZ]; uint8_t x = 0; memset(cpu_active, 0, sizeof(cpu_active)); #if defined(__FreeBSD__) size_t len = sizeof(cpu_active); SYSCTLVAL("kern.cp_time", &cpu_active); #endif /* __FreeBSD__ */ #if defined(__OpenBSD__) int mib[] = { CTL_KERN, KERN_CPTIME }; size_t len = sizeof(cpu_active); SYSCTLVAL(mib, 2, &cpu_active, &len); #endif /* __OpenBSD__ */ #if defined(__linux__) FILE *fp = fopen("/proc/stat", "r"); CHECK_FP(fp); /* Some kernels will produce 7, 8 and 9 columns * We rely on 10, refer to `man proc' for more details */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" if (EOF == (fscanf(fp, "%*s " FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT, &cpu_active[0], &cpu_active[1], &cpu_active[2], &cpu_active[3], &cpu_active[4], &cpu_active[5], &cpu_active[6], &cpu_active[7], &cpu_active[8], &cpu_active[9]))) { CLOSE_X(fp); exit_with_err(ERR, "Upgrade to a newer kernel"); } #pragma GCC diagnostic pop CLOSE_X(fp); #endif /* __linux__ */ for (x = 0; x < LOOP_ITERZ; x++) { total += cpu_active[x]; } diff_total = total - previous_total; diff_idle = cpu_active[IDLE_NUM] - previous_idle; previous_total = total; previous_idle = cpu_active[IDLE_NUM]; percent = 0; if (0 != diff_total) { percent = ((uintmax_t)TICKZ * (diff_total - diff_idle)) / diff_total; } FILL_UINT_ARR(str1, percent); } void get_cores_load(char *str1) { static uintmax_t previous_total[MAX_CORES], previous_idle[MAX_CORES]; static bool test_flag = false; uint8_t x = 0, y = 0, z = 0; uintmax_t percent[MAX_CORES], diff_total[MAX_CORES], core_active[MAX_CORES][LOOP_ITERZ]; uintmax_t diff_idle[MAX_CORES], total[MAX_CORES]; char buf[VLA], temp[VLA]; char *all = temp; memset(percent, 0, sizeof(percent)); memset(diff_total, 0, sizeof(diff_total)); memset(diff_idle, 0, sizeof(diff_idle)); memset(total, 0, sizeof(total)); memset(core_active, 0, sizeof(core_active)); if (false == test_flag) { memset(previous_idle, 0, sizeof(previous_idle)); memset(previous_total, 0, sizeof(previous_total)); } #if defined(__FreeBSD__) size_t len = sizeof(core_active); SYSCTLVAL("kern.cp_times", &core_active); #endif /* __FreeBSD__ */ #if defined(__OpenBSD__) uintmax_t ncpu = 0; int mib[] = { CTL_KERN, KERN_CPTIME2, 0 }; int mib2[] = { CTL_HW, HW_NCPU }; size_t len = sizeof(core_active), len2 = sizeof(ncpu); SYSCTLVAL(mib2, 2, &ncpu, &len2); for (x = 0; x < ncpu; x++, mib[2]++) { if (0 != (sysctl(mib, 3, &core_active[x], &len, NULL, 0))) { break; } } #endif /* __OpenBSD__ */ #if defined(__linux__) FILE *fp = fopen("/proc/stat", "r"); CHECK_FP(fp); if (NULL == (fgets(buf, VLA-1, fp))) { CLOSE_X(fp); exit_with_err(ERR, "reached /proc/stat EOF"); } for (x = 0; x < MAX_CORES; x++, z++) { if (NULL == (fgets(buf, VLA-1, fp))) { CLOSE_X(fp); exit_with_err(ERR, "reached /proc/stat EOF"); } if ('c' != buf[0] && 'p' != buf[1] && 'u' != buf[2]) { break; } if (EOF == (sscanf(buf, "%*s " FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT, &core_active[x][0], &core_active[x][1], &core_active[x][2], &core_active[x][3], &core_active[x][4], &core_active[x][5], &core_active[x][6], &core_active[x][7], &core_active[x][8], &core_active[x][9]))) { CLOSE_X(fp); exit_with_err(ERR, "Upgrade to a newer kernel"); } } CLOSE_X(fp); for (x = 0; x < z; x++) { #else /* FreeBSD || OpenBSD */ for (x = 0; x < MAX_CORES; x++) { if (0 == core_active[x][0] && 0 == core_active[x][1] && 0 == core_active[x][2]) { break; } #endif /* __linux__ */ for (y = 0; y < LOOP_ITERZ; y++) { total[x] += core_active[x][y]; } diff_total[x] = total[x] - previous_total[x]; diff_idle[x] = core_active[x][IDLE_NUM] - previous_idle[x]; previous_total[x] = total[x]; previous_idle[x] = core_active[x][IDLE_NUM]; percent[x] = 0; if (0 != diff_total[x]) { percent[x] = ((uintmax_t)TICKZ * (diff_total[x] - diff_idle[x])) / diff_total[x]; } GLUE2(all, FMT_UINT"%% ", percent[x]); } test_flag = true; FILL_STR_ARR(1, str1, temp); } #if defined(__i386__) || defined(__i686__) || defined(__x86_64__) uint8_t has_tsc_reg(void) { uint_fast16_t vend = 0, leafs = 0; uint_fast16_t eax = 0, ecx = 0, edx = 0, ebx = 0; CPU_REGS(0x00000000, vend, leafs); if (0x00000001 > leafs) { return 1; } if (vend != AmD && vend != InteL) { return 1; } CPU_STR2(0x00000001, eax, ebx, ecx, edx); if (0 == (edx & (1 << 4))) { return 1; } return 0; } #endif /* __i386__ || __i686__ || __x86_64__ */ /* Taken from the gcc documentation * https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html * * other useful resources: * http://www.felixcloutier.com/x86/RDTSC.html * http://ref.x86asm.net/coder32.html#x0F31 */ /* Not going to test for i486 and i586 */ #if defined(__i386__) || defined(__i686__) static __inline__ uintmax_t rdtsc(void) { uintmax_t x = 0; if (0 == (has_tsc_reg())) { __asm__ __volatile__ (".byte 0x0f, 0x31" : "=A" (x)); } return x; } void get_cpu_clock_speed(char *str1) { uintmax_t x = 0, y = 0, z[2]; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmissing-field-initializers" struct timespec start = {0}, stop = {0}, tc = {0}; #pragma GCC diagnostic pop tc.tv_nsec = TICKZ * 1000000L; x = rdtsc(); if (-1 == (clock_gettime(CLOCK_MONOTONIC, &start))) { FUNC_FAILED("clock_gettime()"); } z[0] = (uintmax_t)(start.tv_nsec - start.tv_sec); if (-1 == (nanosleep(&tc, NULL))) { FUNC_FAILED("nanosleep()"); } y = rdtsc(); if (-1 == (clock_gettime(CLOCK_MONOTONIC, &stop))) { FUNC_FAILED("clock_gettime()"); } z[1] = (uintmax_t)(stop.tv_nsec - stop.tv_sec); if (0 != (z[1] - z[0])) { FILL_ARR(str1, FMT_UINT " MHz", (1000 * (y - x) / (z[1] - z[0]))); } } #elif defined(__x86_64__) /* * Thanks to Intel docs for pointing out * "Out of Order Execution", added * cpuid after reading it and edited the rdtscp * code according to the docs * https://www-ssl.intel.com/content/dam/www/public/us/en/documents/white-papers/ia-32-ia-64-benchmark-code-execution-paper.pdf */ static __inline__ uintmax_t rdtsc(void) { unsigned int tickhi = 0, ticklo = 0; uint_fast16_t eax = 0, ecx = 0, edx = 0, ebx = 0; uint_fast16_t vend = 0, regz = 0, x = 0; if (0 != (has_tsc_reg())) { goto seeya; } __asm__ __volatile__ ( "cpuid\n\t" "rdtsc\n\t" : "=a"(ticklo), "=d"(tickhi) :: "%rbx", "%rcx" ); CPU_FEATURE(0x80000000, regz); if (0x80000001 > regz) { goto seeya; } CPU_STR2(0x80000001, eax, ebx, ecx, edx); if (0 != (edx & (1 << 27))) { for (x = 0; x < 6; x++) { __asm__ __volatile__ ( "rdtscp\n\t" "mov %%edx, %0\n\t" "mov %%eax, %1\n\t" "cpuid\n\t" : "=r"(tickhi), "=r"(ticklo) :: "%rax", "%rbx", "%rcx", "%rdx" ); } } seeya: return (((uintmax_t)tickhi << 32) | (uintmax_t)ticklo); } void get_cpu_clock_speed(char *str1) { uintmax_t x = 0, z = 0; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmissing-field-initializers" struct timespec tc = {0}; #pragma GCC diagnostic pop tc.tv_nsec = TICKZ * 1000000L; x = rdtsc(); if (-1 == (nanosleep(&tc, NULL))) { FUNC_FAILED("nanosleep()"); } z = rdtsc(); FILL_ARR(str1, FMT_UINT " MHz", ((z - x) / 100000)); } #endif /* __i386__ || __i686__ || __x86_64__ */ #if defined(__i386__) || defined(__i686__) || defined(__x86_64__) void get_cpu_info(char *str1) { uint_fast16_t vend = 0, x = 0, z = 0, corez = 0, leafB = 0, bitz[2]; uint_fast16_t eax = 0, ecx = 0, edx = 0, ebx = 0, eax_old = 0, leafs = 0; uint_fast16_t line_size = 0, regz = 0, clflu6 = 0, caches[3]; char buffer[VLA], vend_id[13], vend_chars[17]; char *all = buffer; bool got_leafB = false; memset(caches, 0, sizeof(caches)); memset(bitz, 0, sizeof(bitz)); FILL_STR_ARR(1, str1, "Null"); CPU_REGS(0x00000000, vend, leafs); /* movl $0x00000000, %eax */ if (0x00000001 > leafs) { return; } if (vend != AmD && vend != InteL) { return; } CPU_FEATURE(0x80000000, regz); /* movl $0x80000000, %eax */ if (0x80000004 > regz) { return; } CPU_FEATURE(0x00000001, eax_old); /* movl $0x00000001, %eax */ for (x = 0x80000002; x <= 0x80000004; x++) { /* movl $0x80000002, %esi */ CPU_STR2(x, eax, ebx, ecx, edx); /* cmpl $0x80000004, %eax */ memset(vend_chars, 0, sizeof(vend_chars)); for (z = 0; z < 4; z++) { vend_chars[z] = (char)(eax >> (z * 8)); /* movl %eax, 0 */ vend_chars[z+4] = (char)(ebx >> (z * 8)); /* movl %ebx, 4 */ vend_chars[z+8] = (char)(ecx >> (z * 8)); /* movl %ecx, 8 */ vend_chars[z+12] = (char)(edx >> (z * 8)); /* movl %edx, 12 */ } vend_chars[16] = '\0'; GLUE2(all, "%s", vend_chars); } CPU_ID_STR(0x00000000, ebx, ecx, edx); /* movl $0x00000000, %ebx */ for (x = 0; x < 4; x++) { vend_id[x] = (char)(ebx >> (x * 8)); /* movl %ebx, 0 */ vend_id[x+4] = (char)(edx >> (x * 8)); /* movl %edx, 4 */ vend_id[x+8] = (char)(ecx >> (x * 8)); /* movl %ecx, 8 */ } vend_id[12] = '\0'; if (vend == AmD) { if (0x80000005 <= regz) { CPU_STR2(0x80000005, eax, ebx, ecx, edx); /* movl $0x80000005, %eax */ caches[0] = SHFT2(ecx >> (3 * 8)); /* movl %ecx, 24 */ } CPU_STR2(0x00000001, eax, ebx, ecx, edx); /* movl $0x00000001, %eax */ corez = SHFT2(ebx >> (2 * 8)); /* movl %ebx, 16 */ } if (vend == InteL) { if (0x0000000B <= leafs) { CPU_STR2(0x0000000B, eax, ebx, ecx, edx); /* movl $0x0000000B, %eax */ corez = SHFT2(ebx); /* movl %ebx, 0 */ leafB = SHFT2(edx); /* movl %edx, 0 */ got_leafB = true; } else { if (0x00000004 <= leafs) { CPU_STR2(0x00000004, eax, ebx, ecx, edx); /* movl $0x00000004, %eax */ corez = SHFT2(eax >> 26); /* movl %eax, 26 */ } } } if (0x80000006 <= regz) { CPU_STR2(0x80000006, eax, ebx, ecx, edx); /* movl $0x80000006, %eax */ /* L2, line size */ caches[1] = (ecx >> (2 * 8)) & 0xffff; /* movl %ecx, 16 */ caches[2] = SHFT2(ecx); /* movl %ecx, 0 */ } /* 100 mhz steps for the majority of AMD cpu's * movl $0x80000007 %edx, 6 */ if (0x80000008 <= regz) { CPU_STR2(0x80000008, eax, ebx, ecx, edx); /* movl $0x80000008, %eax */ /* physical, virtual */ bitz[0] = SHFT2(eax); /* movl %eax, 0 */ bitz[1] = SHFT2(eax >> 8); /* movl %eax, 8 */ if (vend == AmD) { corez = SHFT2(ecx) + 1; /* movl %ecx, 0 */ } } CPU_STR2(0x00000001, eax, ebx, ecx, edx); /* movl $0x00000001, %eax */ if (0 != (edx & (1 << 19))) { clflu6 = SHFT2(ebx >> 8) * 8; /* movl %ebx, 8 */ } FILL_ARR(str1, UFINT "x %s ID %s" " CLFLUSH/Line size " UFINT " " UFINT " L1/L2 caches KB " UFINT " " UFINT " Stepping " UFINT " Family " UFINT " Model " UFINT " Bits " UFINT " " UFINT " apicid " UFINT, /* cores, vendor, vendor id */ corez, buffer, vend_id, /* clflush, line size */ clflu6, caches[2], /* L1, L2 */ caches[0], caches[1], /* stepping, family */ SHFT(eax_old), (SHFT(eax_old >> 8) + ((IZMAX(eax_old)) ? SHFT2(eax_old >> 20) : 0)), /* model */ (SHFT(eax_old >> 4) | ((IZMAX(eax_old)) ? ((eax_old >> 12) & 0xf0) : 0)), /* physical and virtual bits */ bitz[0], bitz[1], /* apicid */ (true == got_leafB) ? leafB : SHFT2(ebx >> 24) ); } #endif /* __i386__ || __i686__ || __x86_64__ */
void0/pinky
src/cpu.c
C++
unknown
13,322
/* 08/16/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" /* Auto-generated */ #include <sys/stat.h> #include <sys/time.h> #include <sys/param.h> #include <vm/vm_param.h> #include <devstat.h> #if GOT_APM == 1 && defined(HAVE_MACHINE_APM_BIOS_H) #include <fcntl.h> #include <sys/ioctl.h> #include <machine/apm_bios.h> #endif /* GOT_APM && HAVE_MACHINE_APM_BIOS_H */ #include "include/headers.h" #include "include/freebzd.h" void get_ram(char *str1, uint8_t num) { u_int total = 0, freeram = 0, inactive = 0, pagesize = 0; u_int cache = 0, bufferram = 0, dummy = 0; uintmax_t utotal = 0, used = 0, pz = 0; size_t len = sizeof(dummy); SYSCTLVAL("vm.stats.vm.v_page_size", &pagesize); SYSCTLVAL("vm.stats.vm.v_page_count", &total); SYSCTLVAL("vm.stats.vm.v_inactive_count", &inactive); SYSCTLVAL("vm.stats.vm.v_free_count", &freeram); SYSCTLVAL("vm.stats.vm.v_cache_count", &cache); SYSCTLVAL("vfs.bufspace", &bufferram); pz = (uintmax_t)pagesize; used = ((uintmax_t)total * pz - (uintmax_t)freeram * pz - (uintmax_t)inactive * pz - (uintmax_t)cache * pz - (uintmax_t)bufferram) / MB; utotal = ((uintmax_t)total * pz) / MB; switch(num) { case 1: FILL_ARR(str1, FMT_UINT "%s", utotal, "MB"); break; case 2: FILL_ARR(str1, FMT_UINT "%s", ((uintmax_t)freeram * pz) / MB, "MB"); break; case 3: FILL_ARR(str1, FMT_UINT "%s", ((uintmax_t)inactive * pz) / MB, "MB"); break; case 4: FILL_ARR(str1, FMT_UINT "%s", (uintmax_t)bufferram / MB, "MB"); break; case 5: FILL_UINT_ARR(str1, ((0 != utotal) ? ((used * 100) / utotal) : 0)); break; } } void get_voltage(char *str1) { u_int vol0[3], vol1[3], vol2[3], vol3[3]; memset(vol0, 0, sizeof(vol0)); memset(vol1, 0, sizeof(vol1)); memset(vol2, 0, sizeof(vol2)); memset(vol3, 0, sizeof(vol3)); size_t len = sizeof(vol0); SYSCTLVAL(VOLTAGE_FILE("0"), &vol0); SYSCTLVAL(VOLTAGE_FILE("1"), &vol1); SYSCTLVAL(VOLTAGE_FILE("2"), &vol2); SYSCTLVAL(VOLTAGE_FILE("3"), &vol3); FILL_ARR(str1, "%.2f %.2f %.2f %.2f", (float)vol0[0] / 1000.0f, (float)vol1[0] / 1000.0f, (float)vol2[0] / 1000.0f, (float)vol3[0] / 1000.0f); } void get_cpu_temp(char *str1) { u_int temp = 0; size_t len = sizeof(temp); SYSCTLVAL(CPU_TEMP, &temp); get_temp(str1, (uint_least32_t)temp); } void get_mobo_temp(char *str1) { u_int temp[3]; memset(temp, 0, sizeof(temp)); size_t len = sizeof(temp); SYSCTLVAL(MOBO_VAL("temp.1"), &temp); get_temp(str1, (uint_least32_t)temp[0]); } void get_mobo(char *str1) { char temp[VLA]; size_t len = sizeof(temp); SYSCTLVAL(MOBO_VAL("%desc"), &temp); FILL_STR_ARR(1, str1, temp); } /* Couldn't add this option on my own. Used the following resources to make this function happen: http://ftp.stu.edu.tw/FreeBSD/branches/3.0-stable/src/libexec/rpc.rstatd/rstat_proc.c https://github.com/giampaolo/psutil/blob/master/psutil/arch/bsd/freebsd.c http://opensource.apple.com/source/net_snmp/net_snmp-16/net-snmp/agent/mibgroup/ucd-snmp/diskio.c https://searchcode.com/codesearch/view/29835031/ http://fossies.org/linux/pcp/src/pmdas/freebsd/disk.c Had to use Valgrind since we allocate memory with malloc. */ void get_statio(char *str1, char *str2) { struct statinfo stats; struct device_selection *dev_select = NULL; struct devstat *d = NULL; long int select_generation = 0; int x = 0, num_devices = 0, num_selected = 0, num_selections = 0; FILL_STR_ARR(1, str1, "Null"); if(0 != devstat_checkversion(NULL)) { return; } memset(&stats, 0, sizeof(struct statinfo)); stats.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo)); if (NULL == stats.dinfo) { return; } if(-1 == (devstat_getdevs(NULL, &stats))) { goto error; } num_devices = stats.dinfo->numdevs; if (-1 == (devstat_selectdevs(&dev_select, &num_selected, &num_selections, &select_generation, stats.dinfo->generation, stats.dinfo->devices, num_devices, NULL, 0, NULL, 0, DS_SELECT_ADD, 16, 0))) { goto error; } for (x = 0; x < 16; x++) { d = &stats.dinfo->devices[x]; if (STREQ(str2, d->device_name)) { if (d->device_type != DEVSTAT_TYPE_DIRECT && d->device_type != DEVSTAT_TYPE_IF_SCSI && d->device_type != DEVSTAT_TYPE_IF_IDE) { break; } FILL_ARR(str1, "Read " FMT_UINT " MB, Written " FMT_UINT " MB", (uintmax_t)d->bytes[DEVSTAT_READ] / MB, (uintmax_t)d->bytes[DEVSTAT_WRITE] / MB); break; } } error: if (NULL != dev_select) { free(dev_select); } if (NULL != stats.dinfo) { if (stats.dinfo->mem_ptr) { free(stats.dinfo->mem_ptr); } free(stats.dinfo); } return; } /* https://www.freebsd.org/doc/handbook/acpi-overview.html ACPI_BATT_STAT_NOT_PRESENT */ #if GOT_APM == 1 && defined(HAVE_MACHINE_APM_BIOS_H) void get_battery(char *str1) { struct apm_info bstate; int fd = 0; uintmax_t dummy = 0; FILL_STR_ARR(1, str1, "Null"); memset(&bstate, 0, sizeof(struct apm_info)); if (0 != (fd = open("/dev/apm", O_RDONLY))) { return; } if (0 != (ioctl(fd, APMIO_GETINFO, &bstate))) { CLOSE_FD(fd); return; } CLOSE_FD(fd); dummy = (uintmax_t)bstate.ai_batt_life; FILL_UINT_ARR(str1, (101 < dummy ? 0 : dummy)); } #else void get_battery(char *str1) { u_int dummy = 0; uint_least32_t perc = 0; size_t len = sizeof(dummy); SYSCTLVAL("hw.acpi.battery.life", &dummy); perc = (uint_least32_t)dummy; FILL_ARR(str1, ULINT, (101 < perc ? 0 : perc)); } #endif /* GOT_APM && HAVE_MACHINE_APM_BIOS_H */ void get_swapp(char *str1, uint8_t num) { struct xswdev xsw; u_int pagesize = 0, dummy = 0; uintmax_t total = 0, used = 0, pz = 0; int mib[20]; memset(mib, 0, sizeof(mib)); memset(&xsw, 0, sizeof(struct xswdev)); size_t mibi = sizeof(mib) / sizeof(mib[0]); size_t len = sizeof(dummy), sisi = sizeof(struct xswdev); FILL_STR_ARR(1, str1, "0 MB"); SYSCTLVAL("vm.stats.vm.v_page_size", &pagesize); pz = (uintmax_t)pagesize; if (0 != (sysctlnametomib("vm.swap_info", mib, &mibi))) { return; } if (0 != (sysctl(mib, (u_int)(mibi + 1), &xsw, &sisi, NULL, 0))) { return; } if (xsw.xsw_version != XSWDEV_VERSION) { return; } used = (uintmax_t)xsw.xsw_used; total = (uintmax_t)xsw.xsw_nblks; switch(num) { case 1: FILL_ARR(str1, FMT_UINT" %s", ((total * pz) / MB), "MB"); break; case 2: FILL_ARR(str1, FMT_UINT" %s", (((total - used) * pz) / MB), "MB"); break; case 3: FILL_ARR(str1, FMT_UINT" %s", ((used * pz) / MB), "MB"); break; case 4: FILL_ARR(str1, FMT_UINT"%%", ((0 != total) ? ((used * 100) / total) : 0)); break; } }
void0/pinky
src/freebsd_functions.c
C++
unknown
7,553
/* 08/17/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef INCLUDE_FREEBZD_HEADERZ_H_ #define INCLUDE_FREEBZD_HEADERZ_H_ #include <sys/types.h> #include <sys/sysctl.h> #define SYSCTLVAL(x, y) \ if (0 != sysctlbyname(x, y, &len, NULL, 0)) { \ FUNC_FAILED("sysctlbyname()"); \ } #endif /* INCLUDE_FREEBZD_HEADERZ_H_ */
void0/pinky
src/include/freebzd.h
C++
unknown
1,016
/* 07/29/2015, 07/17/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CONSTANTS2_H_ #define CONSTANTS2_H_ #define KB 1024 #define MB 1048576 /* 1024 * 1024 */ #define GB 1073741824 /* MB * 1024 */ #define Mb 131072 /* 1024 * 1024 / 8 */ #define BYTES_TO_MB(x) (x/2/1024) /* block bytes */ #define FMT_UINT "%"PRIuMAX #define UFINT "%"PRIuFAST16 #define ULINT "%"PRIuLEAST32 #define USINT "%"PRIu8 #define SCAN_UFINT "%"SCNuFAST16 #define SCAN_ULINT "%"SCNuLEAST32 #define SCAN_UINTX "%"SCNxMAX /* hex */ /* stay away from va_list */ #define FILL_ARR(x, z, ...) (snprintf(x, VLA, z, __VA_ARGS__)) #define FILL_UINT_ARR(x, z) (FILL_ARR(x, FMT_UINT, z)) #define FILL_STR_ARR(x, z, ...) (FILL_ARR(z, (1 == x ? "%s" : "%s %s"), __VA_ARGS__)) #define GLUE2(x, z, ...) (x+=snprintf(x, VLA, z, __VA_ARGS__)) /* temperature sensors */ #define HWMON_DIR "/sys/class/hwmon/hwmon0" #define TEMPERATURE(x) (HWMON_DIR"/temp"x"_input") #define CPU_TEMP_FILE TEMPERATURE("1") #define MOBO_TEMP_FILE TEMPERATURE("2") /* motherboard model and vendor */ #define MOTHERBOARD(x) ("/sys/class/dmi/id/board_"x) #define MOBO_NAME MOTHERBOARD("name") #define MOBO_VENDOR MOTHERBOARD("vendor") /* voltage and fans */ #if defined(__linux__) #define VOLTAGE_FILE(x) (HWMON_DIR"/in"x"_input") #define FAN_FILE HWMON_DIR"/fan"UFINT"_input" #endif /* __linux__ */ #if defined(__FreeBSD__) #if defined(MOBO_MODL) && defined(CPU_MODL) #define MOBO_VAL(x) MOBO_MODL "." x #define CPU_TEMP CPU_MODL #else #define MOBO_VAL(x) "dev.aibs.0."x #define CPU_TEMP "dev.cpu.0.temperature" #endif /* MOBO_MODL && CPU_MODL */ #define VOLTAGE_FILE(x) MOBO_VAL("volt") "." x #define FAN_STR(x, z) (FILL_ARR(x, "%s"UFINT, MOBO_VAL("fan") ".", z)) #endif /* __FreeBSD__ */ /* battery reports */ #define BATTERY_NUM(x, y, z) (FILL_ARR(x, "%s"USINT"%s%s", \ "/sys/class/power_supply/BAT", y, "/charge_", z)) #define BATTERY_USED(x, z) (BATTERY_NUM(x, z, "now")) #define BATTERY_TOTAL(x, z) (BATTERY_NUM(x, z, "full")) /* NIC model and vendor */ #define NIC_NUM(x, y, z) (FILL_ARR(x, "%s%s%s%s", \ "/sys/class/net/", y, "/device/", z)) #define NIC_VEND(x, z) (NIC_NUM(x, z, "vendor")) #define NIC_MODEL(x, z) (NIC_NUM(x, z, "device")) /* The cdrom/dvdrom vendor and model */ #define DVD_DIR(x) ("/sys/class/block/sr0/device/"x) #define DVD_VEND DVD_DIR("vendor") #define DVD_MODEL DVD_DIR("model") /* exit with error */ #define CANNOT_OPEN "Could not open" #define CANNOT_CLOSE "Could not close a file handle" #define CANNOT_OPEN_FP "Could not open a file handle" #define FSCANF_FAILED "fscanf() failed" #define ERR "Error:" #define NOT_FOUND "Not found, " #define FUNC_FAILED(x) (exit_with_err(ERR, x " failed")) #define RECOMPILE_WITH(x) (exit_with_err(ERR, "recompile the program --with-" x)) /* Let the preprocessor Do Repeat Myself */ #define CHECK_SSCANF(buf, x, z) \ if (EOF == (sscanf(buf, x, z))) { \ exit_with_err(ERR, "sscanf() EOF"); \ } #define CHECK_FSCANF(fp, x, z) \ if (EOF == (fscanf(fp, x, z))) { \ exit_with_err(ERR, FSCANF_FAILED); \ } #define CHECK_FP(fp) \ if (NULL == fp) { \ exit_with_err(ERR, CANNOT_OPEN_FP); \ } #define CLOSE_X(fp) \ if (EOF == (fclose(fp))) { \ exit_with_err(ERR, CANNOT_CLOSE); \ } #define OPEN_X(fp, x, y, z) \ if (NULL == (fp = fopen(x, "r"))) { \ exit_with_err(CANNOT_OPEN, x); \ } \ CHECK_FSCANF(fp, y, z); \ CLOSE_X(fp); #define CHECK_POPEN(fp, x, packs) \ if (NULL == (fp = popen(x, "r"))) { \ exit_with_err(CANNOT_OPEN, x); \ } \ CHECK_FSCANF(fp, SCAN_UFINT, packs); \ if (-1 == (pclose(fp))) { \ exit_with_err(CANNOT_CLOSE, x); \ } #define CLOSE_FD(fd) \ if (-1 == (close(fd))) { \ exit_with_err(ERR, CANNOT_CLOSE); \ } #define CLOSE_FD2(fd, res) \ if (-1 == (close(fd))) { \ freeaddrinfo(res); \ exit_with_err(ERR, CANNOT_CLOSE); \ } /* How many fans to try for detection */ #define MAX_FANS 20 #define STREQ(x, z) (0 == (strcmp(x, z))) #define FPRINTF(...) (fprintf(stderr, __VA_ARGS__)) #endif /* CONSTANTS2_H_ */
void0/pinky
src/include/functions_constants.h
C++
unknown
4,742
/* 08/06/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef INCLUDE_HEADERZ_H_ #define INCLUDE_HEADERZ_H_ #include <time.h> #include <stdio.h> #include <stdbool.h> #include <string.h> #include <stdlib.h> #include <inttypes.h> #include <unistd.h> #include "options_constants.h" #include "functions_constants.h" #include "../prototypes/functions.h" #include "../prototypes/common.h" #endif /* INCLUDE_HEADERZ_H_ */
void0/pinky
src/include/headers.h
C++
unknown
1,104
/* 09/03/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef NCURSES_COLOURS_H_ #define NCURSES_COLOURS_H_ #if WITH_COLOURS == 1 #define PINK "^M" #define BLUE "^B" #define YELLOW "^Y" #else #define PINK "" #define BLUE "" #define YELLOW "" #endif /* WITH_COLOURS */ #define NAME_VAL BLUE STR_SPEC " " PINK STR_SPEC /* STR1 STR2 */ #define TEMP YELLOW STR_SPEC "C " /* 32C */ #define FMT_KERN YELLOW KERN_ORIG /* Kernel Version */ #define FMT_SONG PINK SONG_ORIG /* Song */ #endif /* NCURSES_COLOURS_H_ */
void0/pinky
src/include/ncurses_colours.h
C++
unknown
1,300
/* 07/24/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef COLOURS_H_ #define COLOURS_H_ #if WITH_COLOURS == 1 #define XBM_ICON(given_icon) "^i("ICONS_DIR"/"given_icon")" #define YELLOW "^fg(#f0c674)" #define BLUE "^fg(#1793D1)" #define PINK "^fg(#b294bb)" #define NAME_VAL BLUE STR_SPEC " " PINK STR_SPEC /* STR1 STR2 */ #define TEMP YELLOW "%s" XBM_ICON("temp.xbm") " " /* 32C */ #define FMT_KERN YELLOW KERN_ORIG /* Kernel Version */ #define FMT_SONG PINK SONG_ORIG /* Song */ #define CPU_STR XBM_ICON("cpu.xbm") #define RAM_STR XBM_ICON("mem.xbm") #define SSD_STR XBM_ICON("diskette.xbm") #define PKG_STR XBM_ICON("arch.xbm") #define VOLT_STR XBM_ICON("voltage.xbm") #define FANS_STR XBM_ICON("fan.xbm") #define MOBO_STR XBM_ICON("mobo.xbm") #define VOL_STR XBM_ICON("vol.xbm") #define TIME_STR XBM_ICON("clock.xbm") #define MPD_ICON XBM_ICON("mpd.xbm") #define NET_STR XBM_ICON("net.xbm") #define SPEED_STR XBM_ICON("net.xbm") #define STATIO_STR XBM_ICON("statio.xbm") #define BATT_STR XBM_ICON("bat.xbm") #define LOAD_STR CPU_STR #define UP_STR XBM_ICON("uptime.xbm") /* Only for the weather */ #define OUT_STR BLUE XBM_ICON("fox.xbm")" " /* tmux or other program that can spice * the output on it's own */ #else #define PINK "" #define YELLOW "" #define NAME_VAL STR_SPEC " " STR_SPEC /* STR1 STR2 */ #define TEMP STR_SPEC "C " /* 32C */ #define FMT_KERN KERN_ORIG /* Kernel Version */ #define FMT_SONG SONG_ORIG /* Song */ #endif /* WITH_COLOURS */ #endif /* COLOURS_H_ */
void0/pinky
src/include/non_x11_colours.h
C++
unknown
2,445
/* 09/08/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef INCLUDE_OPENBZD_HEADERZ_H_ #define INCLUDE_OPENBZD_HEADERZ_H_ #include <sys/types.h> #include <sys/sysctl.h> #define SYSCTLVAL(w, x, y, z) \ if (0 != (sysctl(w, x, y, z, NULL, 0))) { \ FUNC_FAILED("sysctl()"); \ } #endif /* INCLUDE_OPENBZD_HEADERZ_H_ */
void0/pinky
src/include/openbzd.h
C++
unknown
1,012
/* 07/29/2015, 07/18/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CONSTANTS_H_ #define CONSTANTS_H_ #define VLA 200 #define WHOLE_MAIN_ARR_LEN VLA*16 #define GLUE(x, z, ...) (x+=snprintf(x, WHOLE_MAIN_ARR_LEN, z, __VA_ARGS__)) #if defined(__FreeBSD__) /* The clock ticks in FreeBSD are 133 */ #define TICKZ 100 #else #define TICKZ sysconf(_SC_CLK_TCK) #endif #include "options_generator.h" #define STR_SPEC "%s" #define SONG_ORIG STR_SPEC " " #define KERN_ORIG STR_SPEC " " #ifndef WITH_NCURSES #define WITH_NCURSES 6 #endif #if defined (HAVE_X11_XLIB_H) || WITH_NCURSES == 1 || WITH_COLOURS == 0 #define CPU_STR "CPU" #define RAM_STR "RAM" #define SSD_STR "SSD" #define PKG_STR "Pkgs" #define VOLT_STR "Voltage" #define FANS_STR "Fans/RPM" #define MOBO_STR "Mobo" #define VOL_STR "Volume" #define TIME_STR "Time" #define NET_STR "Used Net" #define STATIO_STR "Statio" #define SPEED_STR "Speed" #define BATT_STR "BATT" #define UP_STR "Up" #define LOAD_STR "Load/avg" #define OUT_STR "Out " #endif /* HAVE_X11_XLIB_H || WITH_NCURSES || WITH_COLOURS */ #if defined (HAVE_X11_XLIB_H) #include "x11_colours.h" #elif WITH_NCURSES == 1 #include "ncurses_colours.h" #else #include "non_x11_colours.h" #endif /* HAVE_X11_XLIB_H */ /* options.c format constants */ #define FMT NAME_VAL"%% " /* STR1 10% */ #define FMT_TIME NAME_VAL /* Time 10:00 PM */ #define FMT_MOBO FMT_TIME" " /* VEND NAME */ #define FMT_CPU FMT_TIME"%% " /* CPU 10% */ #define FMT_CORES FMT_TIME /* CPU varying */ #define FMT_RAM FMT /* RAM 10% */ #define FMT_RAM2 FMT_TIME" " /* RAM 10MB */ #define FMT_SSD FMT /* SSD 10% */ #define FMT_SSD2 FMT_RAM2 /* SSD 10MB */ #define FMT_PKGS FMT_TIME" " /* Pkgs 123 */ #define FMT_VOLT FMT_PKGS /* Voltage 1 2 3 4 */ #define FMT_FANS FMT_TIME /* Fans varying */ #define FMT_VOL FMT /* Volume 10% */ #define FMT_NET FMT_PKGS /* Down 123 Up 123 */ #define FMT_STATIO FMT_NET /* Read 123 Written 123 */ #define FMT_CPUSPEED PINK STR_SPEC " " /* 1234 MHz */ #define FMT_TEMP TEMP /* 32C */ #define FMT_BATT FMT /* BATT 10% */ #define FMT_UP FMT_TIME" " /* Up 10 min */ #define FMT_LOAD FMT_TIME" " /* Load/avg 0.01 0.01 0.01 */ #endif /* CONSTANTS_H_ */
void0/pinky
src/include/options_constants.h
C++
unknown
3,738
/* 08/12/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GENERATOR_H_ #define GENERATOR_H_ /* Employ the preprocessor */ #define GET_N_FMT(func, ...) \ get_##func(func); \ GLUE(__VA_ARGS__); /* Remember vanilla ice ? */ #define SLEEP_SLEEP_BABY(x) \ tc.tv_nsec = x; \ if (-1 == (nanosleep(&tc, NULL))) { \ printf("%s\n", "Error: nanosleep() failed"); \ return EXIT_FAILURE; \ } #define GET_NET_N_FMT(arg1, arg2, arg3, ...) \ get_net(arg1, arg2, arg3); \ if (2 == arg3) { \ SLEEP_SLEEP_BABY(850000000L); \ get_net(arg1, arg2, arg3); \ } \ GLUE(__VA_ARGS__); /* Let the platform ticks decide how much * time is needed to sleep * 100 in linux and openbsd, 133 in freebsd */ #define NEW_CPU_LABEL(lbl, declareVar, useVar, ...) \ case lbl: \ { \ declareVar; \ get_##useVar(useVar); \ SLEEP_SLEEP_BABY(sysconf(_SC_CLK_TCK) * 1000000L); \ GET_N_FMT(useVar, arguments->all, __VA_ARGS__, useVar); \ } \ break; #define NEW_LABEL(lbl, declareVar, useVar, ...) \ case lbl: \ { \ declareVar; \ GET_N_FMT(useVar, arguments->all, __VA_ARGS__, useVar); \ } \ break; #define NEW_NET_LABEL(lbl, declareVar, useVar, num, ...) \ case lbl: \ { \ declareVar; \ GET_NET_N_FMT(useVar, arg, num, arguments->all, __VA_ARGS__, useVar); \ } \ break; #define NEW_ARG_LABEL(lbl, declareVar, useVar, ...) \ case lbl: \ { \ declareVar; \ get_##useVar(useVar, arg); \ GLUE(arguments->all, __VA_ARGS__, useVar); \ } \ break; #define LABEL_WITH_NUM_GENERATOR(func, lbl, declareVar, useVar, num, ...) \ case lbl: \ { \ declareVar; \ get_##func(useVar, num); \ GLUE(arguments->all, __VA_ARGS__, useVar); \ } \ break; #define NEW_RAM_LABEL(...) \ LABEL_WITH_NUM_GENERATOR(ram, __VA_ARGS__); #define NEW_SSD_LABEL(...) \ LABEL_WITH_NUM_GENERATOR(ssd, __VA_ARGS__); #define NEW_KERNEL_LABEL(...) \ LABEL_WITH_NUM_GENERATOR(kernel, __VA_ARGS__); #define NEW_SWAPP_LABEL(...) \ LABEL_WITH_NUM_GENERATOR(swapp, __VA_ARGS__); #define NEW_MPD_LABEL(...) \ LABEL_WITH_NUM_GENERATOR(song, __VA_ARGS__); /* Fire the preprocessor */ #endif /* GENERATOR_H_ */
void0/pinky
src/include/options_generator.h
C++
unknown
2,859
/* 07/24/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef X_COLOURS_H_ #define X_COLOURS_H_ /* The dwm colours are specified * in your dwm config.h */ #if WITH_COLOURS == 1 #define PINK "\x0b" #define BLUE "\x0a" #define YELLOW "\x09" #else #define PINK "" #define BLUE "" #define YELLOW "" #endif /* WITH_COLOURS */ #define NAME_VAL BLUE STR_SPEC " " PINK STR_SPEC /* STR1 STR2 */ #define TEMP YELLOW STR_SPEC "C " /* 32C */ #define FMT_KERN YELLOW KERN_ORIG /* Kernel Version */ #define FMT_SONG PINK SONG_ORIG /* Song */ #endif /* X_COLOURS_H_ */
void0/pinky
src/include/x11_colours.h
C++
unknown
1,348
/* 07/18/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* The pragma directives are here * to mute the gcc twisted vision, * and clangs inabillity to distinguish * C from C++ * * https://llvm.org/bugs/show_bug.cgi?id=21689 * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 * * Do not add any -Wno flags just to mute the compilers snafus * */ #include "config.h" /* Auto-generated */ #include <sys/sysinfo.h> #if defined(HAVE_SENSORS_SENSORS_H) #include <sensors/sensors.h> #endif /* HAVE_SENSORS_SENSORS_H */ #include "include/headers.h" void get_ram(char *str1, uint8_t num) { uintmax_t used = 0, total = 0; struct sysinfo mem; memset(&mem, 0, sizeof(struct sysinfo)); if (-1 == (sysinfo(&mem))) { FUNC_FAILED("sysinfo()"); } switch(num) { case 1: FILL_ARR(str1, FMT_UINT "%s", (uintmax_t)mem.totalram / MB, "MB"); break; case 2: FILL_ARR(str1, FMT_UINT "%s", (uintmax_t)mem.freeram / MB, "MB"); break; case 3: FILL_ARR(str1, FMT_UINT "%s", (uintmax_t)mem.sharedram / MB, "MB"); break; case 4: FILL_ARR(str1, FMT_UINT "%s", (uintmax_t)mem.bufferram / MB, "MB"); break; case 5: { total = (uintmax_t) mem.totalram / MB; used = (uintmax_t) (mem.totalram - mem.freeram - mem.bufferram - mem.sharedram) / MB; FILL_UINT_ARR(str1, ((0 != total) ? ((used * 100) / total) : 0)); } break; } } void get_ssd_model(char *str1, char *str2) { FILE *fp = NULL; char model[VLA]; FILL_ARR(model, "%s%s%s", "/sys/block/", str2, "/device/model"); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" OPEN_X(fp, model, "%[^\n]", model); #pragma GCC diagnostic pop FILL_STR_ARR(1, str1, model); } void get_loadavg(char *str1) { struct sysinfo up; memset(&up, 0, sizeof(struct sysinfo)); if (-1 == (sysinfo(&up))) { FUNC_FAILED("sysinfo()"); } FILL_ARR(str1, "%.2f %.2f %.2f", (float)up.loads[0] / 65535.0f, (float)up.loads[1] / 65535.0f, (float)up.loads[2] / 65535.0f); } /* My inital attempt was to make this code FreeBSD exclusive as the * sensors parsing there is much more difficult than it is in linux. */ #if defined(HAVE_SENSORS_SENSORS_H) void match_feature(char *str1, uint8_t num) { #if SENSORS_API_VERSION >= 0x400 && SENSORS_API_VERSION <= 0x499 const sensors_chip_name *chip; const sensors_feature *features; const sensors_subfeature *subfeatures; char buffer[VLA]; char *label = NULL, *all = buffer; double value = 0.0; int nr = 0, nr2 = 0, nr3 = 0; uint8_t x = 0, y = 0, z = 0, dummy = 0; uint_fast16_t rpm[MAX_FANS+1]; bool found_fans = false; const char *temp_sens[] = { "MB Temperature", "CPU Temperature" }; size_t len = 0; if (3 == num) { memset(rpm, 0, sizeof(rpm)); } /* In case I need to parse the rest * min, max, input values */ /* struct stats_pwr_in *st_pwr_in_i; */ /* struct stats_pwr_temp *st_pwr_temp_i; */ /* struct stats_pwr_fan *st_pwr_fan_i; */ FILL_STR_ARR(1, str1, "Null"); if (0 != (sensors_init(NULL))) { FUNC_FAILED("sensors_init()"); } while (NULL != (chip = sensors_get_detected_chips(NULL, &nr))) { nr2 = 0; while (NULL != (features = sensors_get_features(chip, &nr2))) { nr3 = 0; while (NULL != (subfeatures = sensors_get_all_subfeatures(chip, features, &nr3))) { switch(subfeatures->type) { case SENSORS_SUBFEATURE_IN_INPUT: { if (1 == num) { if (0 != (sensors_get_value(chip, subfeatures->number, &value))) { break; } GLUE2(all, "%.2f ", (float)value); } } break; case SENSORS_SUBFEATURE_TEMP_INPUT: { if (2 == num || 4 == num) { dummy = (2 == num ? 0 : 1); if (0 != (sensors_get_value(chip, subfeatures->number, &value))) { break; } if (NULL == (label = sensors_get_label(chip, features))) { break; } if (STREQ(temp_sens[dummy], label)) { FILL_ARR(str1, UFINT, (uint_fast16_t)value); } if (NULL != label) { free(label); } } } break; case SENSORS_SUBFEATURE_FAN_INPUT: { if (3 == num) { if (0 != (sensors_get_value(chip, subfeatures->number, &value))) { break; } if (MAX_FANS != z) { rpm[z++] = (uint_fast16_t)value; } found_fans = true; } } break; default: continue; } } } } sensors_cleanup(); if (1 == num && '\0' != buffer[0]) { len = strlen(buffer); buffer[len-1] = '\0'; FILL_STR_ARR(1, str1, buffer); return; } if (true == found_fans) { check_fan_vals(str1, rpm, z); } #else exit_with_err(ERR, "The version of your sensors API is not supported by this program."); #endif /* SENSORS_API_VERSION >= 0x400 && SENSORS_API_VERSION <= 0x499 */ } void get_voltage(char *str1) { match_feature(str1, 1); } void get_mobo_temp(char *str1) { match_feature(str1, 2); } void get_fans(char *str1) { match_feature(str1, 3); } void get_cpu_temp(char *str1) { match_feature(str1, 4); } #else /* fall back */ void get_voltage(char *str1) { float voltage[4]; FILE *fp = NULL; uint8_t x = 0; memset(voltage, 0, sizeof(voltage)); const char *voltage_files[] = { VOLTAGE_FILE("0"), VOLTAGE_FILE("1"), VOLTAGE_FILE("2"), VOLTAGE_FILE("3") }; for (x = 0; x < 4; x++) { if (NULL == (fp = fopen(voltage_files[x], "r"))) { exit_with_err(CANNOT_OPEN, voltage_files[x]); } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" CHECK_FSCANF(fp, "%f", &voltage[x]); #pragma GCC diagnostic pop CLOSE_X(fp); voltage[x] /= 1000.0f; } FILL_ARR(str1, "%.2f %.2f %.2f %.2f", voltage[0], voltage[1], voltage[2], voltage[3]); } void get_mobo_temp(char *str1) { get_temp(MOBO_TEMP_FILE, str1); } void get_cpu_temp(char *str1) { get_temp(CPU_TEMP_FILE, str1); } #endif /* HAVE_SENSORS_SENSORS_H */ void get_mobo(char *str1) { FILE *fp = NULL; char vendor[100], name[100]; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" OPEN_X(fp, MOBO_VENDOR, "%s", vendor); #pragma GCC diagnostic pop #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" OPEN_X(fp, MOBO_NAME, "%s", name); #pragma GCC diagnostic pop FILL_STR_ARR(2, str1, vendor, name); } void get_statio(char *str1, char *str2) { uintmax_t statio[7]; char stat_file[VLA]; FILL_ARR(stat_file, "%s%s%s", "/sys/block/", str2, "/stat"); memset(statio, 0, sizeof(statio)); FILE *fp = fopen(stat_file, "r"); CHECK_FP(fp); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" if (EOF == (fscanf(fp, FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT FMT_UINT, &statio[0], &statio[1], &statio[2], &statio[3], &statio[4], &statio[5], &statio[6]))) { CLOSE_X(fp); exit_with_err(ERR, "reading the stat file failed"); } #pragma GCC diagnostic pop CLOSE_X(fp); FILL_ARR(str1, "Read " FMT_UINT " MB, Written " FMT_UINT " MB", BYTES_TO_MB(statio[2]), BYTES_TO_MB(statio[6])); } /* Thanks to https://bugzilla.kernel.org/show_bug.cgi?id=83411 */ void get_battery(char *str1) { uintmax_t used = 0, total = 0; uint8_t num = 0; char temp[VLA]; BATTERY_TOTAL(temp, num); FILE *fp = fopen(temp, "r"); if (NULL == fp) { num = 1; BATTERY_TOTAL(temp, num); if (NULL == (fp = fopen(temp, "r"))) { exit_with_err(CANNOT_OPEN, "BAT0 and BAT1"); } } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" CHECK_FSCANF(fp, FMT_UINT, &total); #pragma GCC diagnostic pop CLOSE_X(fp); BATTERY_USED(temp, num); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" OPEN_X(fp, temp, FMT_UINT, &used); #pragma GCC diagnostic pop FILL_UINT_ARR(str1, ((0 != total) ? ((used * 100) / total) : 0)); }
void0/pinky
src/linux_functions.c
C++
unknown
9,187
/* 11/18/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" /* Auto-generated */ #if WITH_LUA == 1 #include <lua.h> #include <lauxlib.h> #include <lualib.h> #include "include/headers.h" #endif /* WITH_LUA */ #include "prototypes/lua.h" #if WITH_LUA == 1 /* Docs: http://www.lua.org/manual/ http://www.dcc.ufrj.br/~fabiom/lua/ Books: http://www.lua.org/pil/index.html The first edition is free to be read: http://www.lua.org/pil/contents.html "isfunction": http://www.lua.org/pil/25.3.html */ void get_lua(char *str1, char *str2) { const char *temp = NULL; lua_State *L = NULL; FILL_STR_ARR(1, str1, "0"); #if LUA_VERSION_NUM < 501 if (NULL == (L = lua_open())) { return; } #else if (NULL == (L = luaL_newstate())) { return; } #endif /* LUA_VERSION_NUM == 501 */ luaL_openlibs(L); if (0 != (luaL_loadfile(L, str2))) { goto error; } if (0 != (lua_pcall(L, 0, 0, 0))) { goto error; } lua_getglobal(L, "uzer_func"); if (0 != (lua_pcall(L, 0, 1, 0))) { goto error; } if (NULL != (temp = lua_tostring(L, -1))) { FILL_STR_ARR(1, str1, temp); } error: if (NULL != L) { lua_pop(L, 1); lua_close(L); } return; } #else char *lua5; #endif /* WITH_LUA */
void0/pinky
src/lua.c
C++
unknown
1,943
/* Copyright 02/22/2015, 07/18/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" /* Auto-generated */ #include "include/headers.h" #include "prototypes/options.h" int main(int argc, char *argv[]) { char combined[WHOLE_MAIN_ARR_LEN]; char *all = combined; if (-1 == (sysconf(_SC_CLK_TCK))) { FPRINTF("%s\n", "Error: sysconf() failed"); return EXIT_FAILURE; } if (1 == argc) { parse_konf(all); } else { parse_opts(argc, argv, all); } if ('\0' != combined[0]) { #if defined (HAVE_X11_XLIB_H) set_status(combined); #else fprintf(stdout, "%s\n", combined); #endif } return EXIT_SUCCESS; }
void0/pinky
src/main.c
C++
unknown
1,333
/* 08/06/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" /* Auto-generated */ #if WITH_NET == 1 #if defined(__linux__) #include <ctype.h> #include <netdb.h> /* #include <sys/types.h> */ #include <sys/socket.h> #include <sys/ioctl.h> #include <arpa/inet.h> #include <ifaddrs.h> #include <linux/if_link.h> #include <netpacket/packet.h> #include <net/if.h> #include <linux/sockios.h> #include <linux/ethtool.h> #if WITH_LIBNL == 1 #include <netlink/netlink.h> #include <netlink/genl/genl.h> #include <netlink/genl/ctrl.h> #include <linux/nl80211.h> #include <linux/if.h> #else #include <linux/wireless.h> #endif /* WITH_LIBNL */ #if WITH_PCI == 1 #include <pci/pci.h> #endif /* WITH_PCI */ #endif /* __linux__ */ #if defined(__FreeBSD__) || defined(__OpenBSD__) #include <netdb.h> /* #include <sys/types.h> */ #include <sys/socket.h> #include <sys/ioctl.h> #include <arpa/inet.h> #include <arpa/nameser.h> #include <ifaddrs.h> #include <net/if.h> #include <net/if_dl.h> #include <net/route.h> #include <netinet/in.h> #endif /* __FreeBSD__ || __OpenBSD__ */ #endif /* WITH_NET */ #include "include/headers.h" #include "prototypes/net.h" #if defined(__FreeBSD__) #include "include/freebzd.h" #endif /* __FreeBSD__ */ #if defined(__OpenBSD__) #include "include/openbzd.h" #endif /* __OpenBSD__ */ #if defined(__linux__) #if WITH_LIBNL == 1 && WITH_NET == 1 static int call_back(struct nl_msg *, void *); #endif /* WITH_LIBNL && WITH_NET */ #endif /* __linux__ */ /* Thanks to http://www.matisse.net/bitcalc/?source=print * and `man netdevice' */ void get_net(char *str1, char *str2, uint8_t num) { #if WITH_NET == 1 #if defined(__linux__) struct rtnl_link_stats *stats = NULL; struct sockaddr_ll *mac = NULL; #else struct if_data *stats = NULL; struct sockaddr_dl *mac = NULL; #endif /* __linux__ */ struct ifaddrs *ifaddr = NULL, *ifa = NULL; static uintmax_t prev_recv = 0, prev_sent = 0; uintmax_t cur_recv = 0, cur_sent = 0; unsigned char *umac = NULL; void *temp_void = NULL; char temp[VLA]; if (-1 == (getifaddrs(&ifaddr))) { FUNC_FAILED("getifaddrs()"); } FILL_STR_ARR(1, str1, "Null"); for (ifa = ifaddr; NULL != ifa; ifa = ifa->ifa_next) { if ((IFF_UP | IFF_BROADCAST) != (ifa->ifa_flags & ( IFF_UP | IFF_BROADCAST | IFF_POINTOPOINT | IFF_LOOPBACK | IFF_NOARP))) { continue; } if (NULL == ifa->ifa_addr) { continue; } if (3 == num || 5 == num || 6 == num) { /* ip | netmask | broadcast */ if (AF_INET == ifa->ifa_addr->sa_family) { if (STREQ(str2, ifa->ifa_name)) { switch(num) { case 3: temp_void = ifa->ifa_addr; break; case 5: temp_void = ifa->ifa_netmask; break; case 6: temp_void = ifa->ifa_broadaddr; break; } inet_ntop(AF_INET, &(((struct sockaddr_in *)temp_void)->sin_addr), temp, INET_ADDRSTRLEN); FILL_STR_ARR(1, str1, temp); break; } } } else if (NETFAM == ifa->ifa_addr->sa_family && NULL != ifa->ifa_data) { if (STREQ(str2, ifa->ifa_name)) { #if defined(__linux__) stats = ifa->ifa_data; #else stats = (struct if_data *)ifa->ifa_data; #endif /* __linux__ */ if (2 == num) { /* upload and download speeds */ cur_recv = (uintmax_t)stats->RECVBYTS - prev_recv; cur_sent = (uintmax_t)stats->SENTBYTS - prev_sent; FILL_ARR(str1, "Down " FMT_UINT " KB, Up " FMT_UINT " KB", (cur_recv / KB), (cur_sent / KB)); prev_recv = cur_recv; prev_sent = cur_sent; } else if (1 == num) { /* consumed internet so far */ FILL_ARR(str1, "Down " FMT_UINT " MB, Up " FMT_UINT " MB", ((uintmax_t)stats->RECVBYTS / MB), ((uintmax_t)stats->SENTBYTS / MB)); #if defined(__linux__) } else if (4 == num) { /* mac address */ temp_void = ifa->ifa_addr; mac = (struct sockaddr_ll *)temp_void; /* 6 == ether 20 == infiniband */ if (6 != mac->sll_halen) { break; } FILL_ARR(str1, "%02x:%02x:%02x:%02x:%02x:%02x", mac->sll_addr[0], mac->sll_addr[1], mac->sll_addr[2], mac->sll_addr[3], mac->sll_addr[4], mac->sll_addr[5]); } else if (11 == num) { /* wifi name */ get_wifi(str1, str2, (uint8_t)(num - 10)); } else { /* link speed | driver | version | firmware */ switch(num) { case 7: case 8: case 9: case 10: get_nic_info2(str1, str2, (uint8_t)(num - 6)); break; default: break; } } #else } else if (4 == num) { /* mac address */ temp_void = ifa->ifa_addr; mac = (struct sockaddr_dl *)temp_void; /* 6 == ether 20 == infiniband */ if (6 != mac->sdl_alen) { break; } umac = (unsigned char *)LLADDR(mac); FILL_ARR(str1, "%02x:%02x:%02x:%02x:%02x:%02x", *umac, *(umac + 1), *(umac + 2), *(umac + 3), *(umac + 4), *(umac + 5)); } else if (7 == num) { /* gateway */ get_nic_info(str1, str2); } #endif /* __linux__ */ break; } } } if (NULL != ifaddr) { freeifaddrs(ifaddr); } #else (void)str1; (void)str2; (void)num; RECOMPILE_WITH("net"); #endif /* WITH_NET */ } void get_ip_lookup(char *str1, char *str2) { #if WITH_NET == 1 struct addrinfo *rp = NULL, *result = NULL, hints; void *temp_void = NULL; char temp[VLA]; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_DGRAM; hints.ai_flags = 0; hints.ai_protocol = 0; /* udp | tcp */ if (0 != (getaddrinfo(str2, NULL, &hints, &result))) { FUNC_FAILED("getaddrinfo()"); } for (rp = result; NULL != rp; rp = rp->ai_next) { if (NULL == rp->ai_addr) { continue; } /* check ipv4 again, despite the "hints" */ if (AF_INET == rp->ai_family) { temp_void = rp->ai_addr; inet_ntop(AF_INET, &(((struct sockaddr_in *)temp_void)->sin_addr), temp, INET_ADDRSTRLEN); FILL_STR_ARR(1, str1, temp); break; } } if (NULL != result) { freeaddrinfo(result); } #else (void)str1; (void)str2; RECOMPILE_WITH("net"); #endif /* WITH_NET */ } #if defined(__linux__) void get_nic_info2(char *str1, char *str2, uint8_t num) { #if WITH_NET == 1 struct ethtool_cmd ecmd; struct ethtool_drvinfo drvinfo; struct ifreq ifr; int sock = 0; sock = socket(AF_INET, SOCK_DGRAM, 0); if (-1 == sock) { return; } memset(&ecmd, 0, sizeof(struct ethtool_cmd)); memset(&drvinfo, 0, sizeof(struct ethtool_drvinfo)); memset(&ifr, 0, sizeof(struct ifreq)); switch(num) { case 1: ecmd.cmd = ETHTOOL_GSET; ifr.ifr_data = (char *)&ecmd; break; case 2: case 3: case 4: drvinfo.cmd = ETHTOOL_GDRVINFO; ifr.ifr_data = (char *)&drvinfo; break; } snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", str2); if (0 != (ioctl(sock, SIOCETHTOOL, &ifr))) { CLOSE_FD(sock); return; } switch(num) { case 1: FILL_ARR(str1, "%d%s", ecmd.speed, "Mbps"); break; case 2: FILL_STR_ARR(1, str1, drvinfo.driver); break; case 3: FILL_STR_ARR(1, str1, drvinfo.version); break; case 4: FILL_STR_ARR(1, str1, drvinfo.fw_version); break; } CLOSE_FD(sock); #else (void)str1; (void)str2; (void)num; RECOMPILE_WITH("net"); #endif /* WITH_NET */ } /* Quick spot the bug game. code begin: struct pci_access *pacc= NULL; pacc = pci_alloc(); pci_init(pacc); pci_cleanup(pacc); code end; Spotted the bug - no ? Well, GCC -O2 hangs on pci_init, while -O0 executes flawlessly. Disclaimer: the code is perfectly valid. */ void get_nic_info(char *str1, char *str2) { #if WITH_PCI == 1 && WITH_NET == 1 uintmax_t vendor = 0, model = 0; char temp[VLA]; struct pci_access *pacc = NULL; struct pci_dev *dev = NULL; FILE *fp = NULL; FILL_STR_ARR(1, str1, "Null"); NIC_VEND(temp, str2); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" OPEN_X(fp, temp, SCAN_UINTX, &vendor); /* hex */ #pragma GCC diagnostic pop NIC_MODEL(temp, str2); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" OPEN_X(fp, temp, SCAN_UINTX, &model); /* hex */ #pragma GCC diagnostic pop pacc = pci_alloc(); if (NULL == pacc) { goto error; } pci_init(pacc); if (NULL == pacc) { goto error; } pci_scan_bus(pacc); for (dev = pacc->devices; NULL != dev; dev = dev->next) { pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_CLASS); if ((uintmax_t)vendor == (uintmax_t)dev->vendor_id && (uintmax_t)model == (uintmax_t)dev->device_id) { pci_lookup_name(pacc, temp, VLA, PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE, (uintmax_t)vendor, (uintmax_t)model); FILL_STR_ARR(1, str1, temp); break; } } error: if (NULL != pacc) { pci_cleanup(pacc); } return; #else (void)str1; (void)str2; RECOMPILE_WITH("pci"); #endif /* WITH_PCI && WITH_NET */ } #endif /* __linux__ */ #if defined(__FreeBSD__) || defined(__OpenBSD__) #define ROUNDUP(x) ((x) > 0 ? \ (1 + (((x) - 1) | (sizeof(long) - 1))) : sizeof(long)) /* Based on: http://fossies.org/linux/misc/old/mrt-2.2.2a-src.tar.gz/mrt-2.2.2a/src/lib/kernel/bsd.c https://svn.nmap.org/nmap/libdnet-stripped/src/route-bsd.c */ void get_nic_info(char *str1, char *str2) { #if WITH_NET == 1 struct rt_msghdr *rtm = NULL; struct sockaddr *sa = NULL, *addrs[RTAX_MAX]; char *buf = NULL, *next = NULL, *lim = NULL, temp[VLA]; uint8_t x = 0; size_t needed = 0; void *temp_void = NULL; /* No, it's not Men In Black acronym */ int mib[] = { CTL_NET, PF_ROUTE, 0, 0, NET_RT_DUMP, 0 }; if (0 != (sysctl(mib, 6, NULL, &needed, NULL, 0))) { return; } if (0 == needed) { return; } buf = (char *)malloc(needed); if (NULL == buf) { return; } if (0 != (sysctl(mib, 6, buf, &needed, NULL, 0))) { goto error; } lim = buf + needed; for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)(void *)next; sa = (struct sockaddr *)(rtm + 1); if (NULL == sa || NULL == rtm) { continue; } if (AF_INET == sa->sa_family) { for (x = 0; x < RTAX_MAX; x++) { if (rtm->rtm_addrs & (1 << x)) { addrs[x] = sa; sa = (struct sockaddr *)((char *)sa + ROUNDUP(sa->sa_len)); } else { addrs[x] = NULL; } } if (((rtm->rtm_addrs & (RTA_DST|RTA_GATEWAY)) == (RTA_DST|RTA_GATEWAY)) && AF_INET == addrs[RTAX_DST]->sa_family && AF_INET == addrs[RTAX_GATEWAY]->sa_family) { temp_void = addrs[RTAX_GATEWAY]; inet_ntop(AF_INET, &(((struct sockaddr_in *)temp_void)->sin_addr), temp, INET_ADDRSTRLEN); FILL_STR_ARR(1, str1, temp); break; } } } (void)str2; error: if (NULL != buf) { free(buf); } return; #else (void)str1; (void)str2; RECOMPILE_WITH("net"); #endif /* WITH_NET */ } #endif /* __FreeBSD__ || __OpenBSD__ */ #if defined(__linux__) /* Entirely based on iw.c, link.c, genl.c, scan.c (print_bss_handler) (v3.17) Docs, return vals, and tips: https://www.infradead.org/~tgr/libnl/doc/core.html https://www.infradead.org/~tgr/libnl/doc/api/group__send__recv.html http://lists.shmoo.com/pipermail/hostap/2011-October/024315.html https://bugzilla.kernel.org/show_bug.cgi?id=78481 */ #if WITH_LIBNL == 1 #if WITH_NET == 1 static int call_back(struct nl_msg *msg, void *str1) { struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg)); struct nlattr *tb[NL80211_ATTR_MAX + 1]; struct nlattr *bss[NL80211_BSS_MAX + 1]; struct nla_policy bss_policy[NL80211_BSS_MAX + 1] = { [NL80211_BSS_BSSID] = {.type = NLA_UNSPEC}, [NL80211_BSS_INFORMATION_ELEMENTS] = {.type = NLA_UNSPEC} }; uint32_t len = 0, x = 0, z = 0; char elo = '\0', *ssid = NULL, *ptr = (char *)str1; if (0 != (nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), genlmsg_attrlen(gnlh, 0), NULL))) { return NL_SKIP; } if (NULL == tb[NL80211_ATTR_BSS]) { return NL_SKIP; } if (0 != (nla_parse_nested(bss, NL80211_BSS_MAX, tb[NL80211_ATTR_BSS], bss_policy))) { return NL_SKIP; } if (NULL == bss[NL80211_BSS_STATUS]) { return NL_SKIP; } switch(nla_get_u32(bss[NL80211_BSS_STATUS])) { case NL80211_BSS_STATUS_ASSOCIATED: case NL80211_BSS_STATUS_AUTHENTICATED: case NL80211_BSS_STATUS_IBSS_JOINED: break; default: return NL_SKIP; } if (NULL == bss[NL80211_BSS_BSSID]) { return NL_SKIP; } if (bss[NL80211_BSS_INFORMATION_ELEMENTS]) { ssid = (char *)(nla_data(bss[NL80211_BSS_INFORMATION_ELEMENTS])); len = (uint32_t)nla_len(bss[NL80211_BSS_INFORMATION_ELEMENTS]); if (NULL != ssid && 0 != len) { ssid += 2; for (x = 0; x < len; x++) { elo = ssid[x]; if (0 == (isprint((unsigned char)elo))) { break; } if (VLA > x) { *ptr++ = elo; } } *ptr = '\0'; } } return NL_SKIP; } #endif /* WITH_NET */ void get_wifi(char *str1, char *str2, uint8_t num) { #if WITH_NET == 1 struct nl_sock *sock = NULL; struct nl_msg *msg = NULL; int fam = 0; uint32_t dev = 0; void *scan_ret = NULL; if (NULL == (sock = nl_socket_alloc())) { return; } if (0 != (genl_connect(sock))) { goto error; } if (0 != (nl_socket_modify_cb(sock, NL_CB_VALID, NL_CB_CUSTOM, call_back, str1))) { goto error; } if (0 > (fam = genl_ctrl_resolve(sock, "nl80211"))) { goto error; } dev = if_nametoindex(str2); msg = nlmsg_alloc(); if (0 == dev || NULL == msg) { goto error_msg; } scan_ret = genlmsg_put(msg, 0, 0, fam, 0, NLM_F_DUMP, NL80211_CMD_GET_SCAN, 0); if (NULL == scan_ret || 0 != (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev))) { goto error_msg; } if (0 != (nl_send_sync(sock, msg))) { goto error; } (void)num; error: if (NULL != sock) { nl_socket_free(sock); } return; error_msg: if (NULL != msg) { nlmsg_free(msg); } if (NULL != sock) { nl_socket_free(sock); } return; #else (void)str1; (void)str2; (void)num; RECOMPILE_WITH("net"); #endif /* WITH_NET */ } #else void get_wifi(char *str1, char *str2, uint8_t num) { #if WITH_NET == 1 struct iwreq iwr; int sock = 0; sock = socket(AF_INET, SOCK_DGRAM, 0); if (-1 == sock) { return; } memset(&iwr, 0, sizeof(struct iwreq)); iwr.u.essid.pointer = str2; iwr.u.essid.length = IW_ESSID_MAX_SIZE + 1; iwr.u.essid.flags = 0; snprintf(iwr.ifr_name, IF_NAMESIZE, "%s", str2); if (0 != (ioctl(sock, SIOCGIWESSID, &iwr))) { CLOSE_FD(sock); return; } switch(num) { case 1: FILL_STR_ARR(1, str1, str2); break; } CLOSE_FD(sock); #else (void)str1; (void)str2; (void)num; RECOMPILE_WITH("net"); #endif /* WITH_NET */ } #endif /* WITH_LIBNL */ #endif /* __linux__ */
void0/pinky
src/net.c
C++
unknown
16,297
/* 09/08/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" /* Auto-generated */ #include <sys/stat.h> #include <sys/time.h> #include <sys/param.h> #include <sys/swap.h> #include <sys/disk.h> #include <fcntl.h> #include <sys/ioctl.h> #include <sys/sensors.h> #include <machine/apmvar.h> #include "include/headers.h" #include "include/openbzd.h" /* Used resources: $OpenBSD: uvm_meter.c,v 1.36 2015/03/14 03:38:53 jsg Exp $ $OpenBSD: machine.c,v 1.63 2007/11/01 19:19:48 otto Exp $ */ void get_ram(char *str1, uint8_t num) { uintmax_t total = 0, freeram = 0, pz = 0; pz = (uintmax_t)sysconf(_SC_PAGESIZE); total = ((uintmax_t)sysconf(_SC_PHYS_PAGES) * pz) / MB; freeram = ((uintmax_t)sysconf(_SC_AVPHYS_PAGES) * pz) / MB; switch(num) { case 1: case 2: FILL_ARR(str1, FMT_UINT "%s", ((1 == num) ? total: freeram), "MB"); break; case 3: FILL_ARR(str1, FMT_UINT "%s", (total - freeram), "MB"); break; case 5: FILL_UINT_ARR(str1, ((0 != total) ? (((total - freeram) * 100) / total) : 0)); break; } } void match_feature(char *str1, int8_t sens_type, int8_t sens_num) { int mib[] = { CTL_HW, HW_SENSORS, 0, sens_type, 0 }; struct sensordev dev; struct sensor sens; uint_fast16_t z = 0, rpm[MAX_FANS+1]; int8_t x = 0, y = 0; uintmax_t temp = 0; char buffer[VLA]; char *all = buffer; bool found_fans = false; size_t len = 0; memset(rpm, 0, sizeof(rpm)); memset(&dev, 0, sizeof(struct sensordev)); memset(&sens, 0, sizeof(struct sensor)); size_t dev_len = sizeof(dev), sens_len = sizeof(sens); SYSCTLVAL(mib, 3, &dev, &dev_len); for (mib[4] = 0; mib[4] < dev.maxnumt[sens_type]; mib[4]++) { if (0 != (sysctl(mib, 5, &sens, &sens_len, NULL, 0))) { break; } if (0 != sens_len && !(sens.flags & (SENSOR_FINVALID | SENSOR_FUNKNOWN))) { switch(sens_type) { case SENSOR_VOLTS_DC: GLUE2(all, "%.2f ", ((float)sens.value / 1000000.0f)); break; case SENSOR_TEMP: { if (x == sens_num) { temp = (uintmax_t)sens.value; } x++; } break; case SENSOR_FANRPM: { if (MAX_FANS != z) { rpm[z++] = (uint_fast16_t)sens.value; } found_fans = true; } break; default: continue; } } } if (SENSOR_VOLTS_DC == sens_type && '\0' != buffer[0]) { len = strlen(buffer); buffer[len-1] = '\0'; FILL_STR_ARR(1, str1, buffer); return; } if (SENSOR_TEMP == sens_type) { if (999999999 < temp) { /* > 99C */ FILL_UINT_ARR(str1, temp / 100000000); } else { FILL_UINT_ARR(str1, ((99999999 < temp) ? temp / 10000000 : temp / 1000000)); /* > 9C || < 9C */ } return; } if (true == found_fans) { check_fan_vals(str1, rpm, z); } } void get_voltage(char *str1) { match_feature(str1, SENSOR_VOLTS_DC, 0); } void get_mobo_temp(char *str1) { match_feature(str1, SENSOR_TEMP, 1); } void get_fans(char *str1) { match_feature(str1, SENSOR_FANRPM, 0); } void get_cpu_temp(char *str1) { match_feature(str1, SENSOR_TEMP, 0); } void get_mobo(char *str1) { int mib[] = { CTL_HW, HW_VENDOR }; int mib2[] = { CTL_HW, HW_PRODUCT }; char vendor[100], model[100]; size_t len = sizeof(vendor); SYSCTLVAL(mib, 2, &vendor, &len); SYSCTLVAL(mib2, 2, &model, &len); split_n_index(vendor); split_n_index(model); FILL_STR_ARR(2, str1, vendor, model); } /* * Entirely based on: * $OpenBSD: apmd.c,v 1.49 2007/11/24 14:58:44 deraadt Exp $ * The source mentioned different values when * using Crapple machine that is charging the battery */ void get_battery(char *str1) { struct apm_power_info bstate; int fd = 0; uintmax_t dummy = 0; FILL_STR_ARR(1, str1, "Null"); memset(&bstate, 0, sizeof(struct apm_power_info)); if (0 != (fd = open("/dev/apm", O_RDONLY))) { return; } if (0 != (ioctl(fd, APM_IOC_GETPOWER, &bstate))) { CLOSE_FD(fd); return; } CLOSE_FD(fd); if (APM_BATT_UNKNOWN == bstate.battery_state || APM_BATTERY_ABSENT == bstate.battery_state) { return; } dummy = (uintmax_t)bstate.battery_life; FILL_UINT_ARR(str1, (101 < dummy ? 0 : dummy)); } /* * Based on: * $OpenBSD: swap.c,v 1.27 2015/08/20 22:32:42 deraadt Exp $ */ void get_swapp(char *str1, uint8_t num) { struct swapent *dev = NULL; int count = 0, stats = 0, x = 0; uintmax_t total = 0, used = 0; FILL_STR_ARR(1, str1, "0 MB"); if (-1 == (count = swapctl(SWAP_NSWAP, 0, 0))) { return; } dev = (struct swapent *)malloc( (unsigned long)count * sizeof(struct swapent)); if (NULL == dev) { return; } stats = swapctl(SWAP_STATS, dev, count); if (-1 == stats || stats != count) { goto error; } for (x = 0; x < count; x++) { total += (uintmax_t)dev->se_nblks; used += (uintmax_t)dev->se_inuse; } switch(num) { case 1: FILL_ARR(str1, FMT_UINT" %s", BYTES_TO_MB(total), "MB"); break; case 2: FILL_ARR(str1, FMT_UINT" %s", BYTES_TO_MB((total - used)), "MB"); break; case 3: FILL_ARR(str1, FMT_UINT" %s", BYTES_TO_MB(used), "MB"); break; case 4: FILL_ARR(str1, FMT_UINT"%%", ((0 != total) ? ((used * 100) / total) : 0)); break; } error: if (NULL != dev) { free(dev); } return; } void get_statio(char *str1, char *str2) { struct diskstats *ds = NULL; int mib[] = { CTL_HW, HW_DISKSTATS }; size_t len = 0, drivez = 0, x = 0; FILL_STR_ARR(1, str1, "Null"); SYSCTLVAL(mib, 2, NULL, &len); if (0 == (drivez = (len / sizeof(*ds)))) { return; } ds = (struct diskstats *)malloc(drivez * sizeof(char *)); if (NULL == ds) { return; } if (0 != (sysctl(mib, 2, ds, &len, NULL, 0))) { goto error; } for (x = 0; x < drivez; x++) { if (STREQ(str2, ds[x].ds_name)) { FILL_ARR(str1, "Read " FMT_UINT " MB, Written " FMT_UINT " MB", (uintmax_t)ds[x].ds_rbytes / MB, (uintmax_t)ds[x].ds_wbytes / MB); break; } } error: if (NULL != ds) { free(ds); } return; }
void0/pinky
src/openbsd_functions.c
C++
unknown
6,944
/* 08/08/2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <argp.h> #include <limits.h> #include "config.h" /* Auto-generated */ #include "include/headers.h" #include "prototypes/cpu.h" #include "prototypes/sound.h" #include "prototypes/net.h" #include "prototypes/options.h" #include "prototypes/weather.h" #include "prototypes/smart.h" #include "prototypes/perl.h" #include "prototypes/lua.h" #include "prototypes/ruby.h" #include "prototypes/python.h" /* Because we ran out of a-z A-Z options, * only long ones will be supported from now on. * The enumerated argp_option keys below will be used as * case labels by the parse_opt switch */ enum { NICDRV = CHAR_MAX + 1, KERNODE, DRIVETEMP, PERLSCRIPT, PYTHONSCRIPT, LUASCRIPT, RUBYSCRIPT, BULLSHIFT }; const char *argp_program_version = PACKAGE_STRING; const char *argp_program_bug_address = "https://notabug.org/void0/pinky-bar "; static const char doc[] = "Statusbar program for anything (Window Manager, terminal multiplexer, etc..)"; static const struct argp_option options[] = { { .doc = "Available options:" }, { .name = "mpd", .key = 'M', .doc = "The song filename." }, { .name = "mpdartist", .key = 'x', .doc = "The song artist(s) name(s)." }, { .name = "mpdtitle", .key = 'X', .doc = "The song title." }, { .name = "mpdalbum", .key = 'y', .doc = "The song album name." }, { .name = "mpddate", .key = 'Y', .doc = "The song date." }, { .name = "cpu", .key = 'c', .doc = "The current cpu load (summed up all cores/threads)." }, { .name = "coresload", .key = 'L', .doc = "Show the load regarding each individual cpu core/thread." }, { .name = "cpuspeed", .key = 'C', .doc = "The current cpu temperature." }, { .name = "cpuinfo", .key = 'I', .doc = "Show your maximum cpu clock speed in MHz." }, { .name = "cputemp", .key = 'T', .doc = "Detect your CPU vendor, stepping, family." }, { .name = "ramperc", .key = 'r', .doc = "The used ram in percentage." }, { .name = "ramtotal", .key = 'J', .doc = "The total ram." }, { .name = "ramfree", .key = 'K', .doc = "The free ram." }, { .name = "driveperc", .key = 's', .doc = "The used drive storage in percentage." }, { .name = "drivetotal", .key = 'n', .doc = "The total drive storage." }, { .name = "drivefree", .key = 'N', .doc = "The free drive storage." }, { .name = "driveavail", .key = 'O', .doc = "The available drive storage." }, { .name = "drivetemp", .key = DRIVETEMP, .doc = "Read the drive temperature from S.M.A.R.T" }, { .name = "dvdstr", .key = 'z', .doc = "The vendor and model name of your cdrom/dvdrom." }, { .name = "battery", .key = 'g', .doc = "The remaining battery charge." }, { .name = "packages", .key = 'p', .doc = "The number of installed packages." }, { .name = "kernsys", .key = 'P', .doc = "The kernel name." }, { .name = "kernode", .key = KERNODE, .doc = "The network node hostname." }, { .name = "kernrel", .key = 'Q', .doc = "The kernel release." }, { .name = "kernver", .key = 'R', .doc = "The kernel version." }, { .name = "kernarch", .key = 'u', .doc = "The machine architecture." }, { .name = "kernel", .key = 'k', .doc = "Combined kernel name and version." }, { .name = "uptime", .key = 'U', .doc = "The system uptime" }, { .name = "loadavg", .key = 'w', .doc = "The system average load for past 1, 5 and 15 minutes" }, { .name = "voltage", .key = 'v', .doc = "The system voltage" }, { .name = "fans", .key = 'f', .doc = "All system fans and their speed in RPM." }, { .name = "mobo", .key = 'm', .doc = "The motherboard vendor and model names." }, { .name = "mobotemp", .key = 'd', .doc = "The motherboard temperature." }, { .name = "volume", .key = 'V', .doc = "The volume." }, { .name = "time", .key = 't', .doc = "The current time." }, { .name = "ipaddr", .key = 'a', .arg = "eth0", .doc = "The local IP address." }, { .name = "iface", .key = 'i', .arg = "eth0", .doc = "The consumed internet bandwidth so far." }, { .name = "bandwidth", .key = 'b', .arg = "eth0", .doc = "The current download and upload speeds." }, { .name = "ipmac", .key = 'A', .arg = "eth0", .doc = "The NIC mac address." }, { .name = "ipmask", .key = 'B', .arg = "eth0", .doc = "The NIC subnet mask address." }, { .name = "ipcast", .key = 'D', .arg = "eth0", .doc = "The NIC broadcast address." }, { .name = "iplookup", .key = 'E', .arg = "site", .doc = "Mini website IP lookup." }, { .name = "statio", .key = 'S', .arg = "sda", .doc = "Read and written MBs to the drive so far." }, #if WITH_PERL == 1 { .name = "perl", .key = PERLSCRIPT, .arg = "script", .doc = "Extend the program with perl, read README." }, #endif /* WITH_PERL */ #if WITH_LUA == 1 { .name = "lua", .key = LUASCRIPT, .arg = "script", .doc = "Extend the program with lua, read README." }, #endif /* WITH_LUA */ #if WITH_RUBY == 1 { .name = "ruby", .key = RUBYSCRIPT, .arg = "script", .doc = "Extend the program with ruby, read README." }, #endif /* WITH_RUBY */ #if WITH_PYTHON == 1 { .name = "python", .key = PYTHONSCRIPT, .arg = "script", .doc = "Extend the program with python, read README." }, #endif /* WITH_PYTHON */ #if WITH_WEATHER == 1 { .name = "weather", .key = 'q', .arg = "London,uk", .doc = "The temperature outside." }, #endif /* WITH_WEATHER */ #if defined(HAVE_MPD_CLIENT_H) { .name = "mpdtrack", .key = 'W', .doc = "The song track name." }, #endif /* HAVE_MPD_CLIENT_H */ #if !defined(__OpenBSD__) { .name = "ramshared", .key = 'l', .doc = "The shared ram." }, { .name = "rambuffer", .key = 'o', .doc = "The buffered ram." }, #endif /* !__OpenBSD__ */ #if defined(__OpenBSD__) { .name = "ramused", .key = 'l', .doc = "The used ram in MB." }, #endif /* __OpenBSD__ */ #if defined(__linux__) { .name = "nicfw", .key = 'j', .arg = "eth0", .doc = "The NIC firmware." }, { .name = "drivemodel", .key = 'F', .arg = "sda", .doc = "The vendor name of your drive." }, { .name = "nicdrv", .key = NICDRV, .arg = "eth0", .doc = "The NIC driver." }, { .name = "nicver", .key = 'H', .arg = "eth0", .doc = "The NIC version." }, { .name = "iplink", .key = 'e', .arg = "eth0", .doc = "The NIC link speed (useful for wireless/wifi)." }, { .name = "nicinfo", .key = 'G', .arg = "eth0", .doc = "The NIC vendor and model." }, { .name = "wifiname", .key = 'h', .arg = "eth0", .doc = "The name of currently connected wireless/wifi network." }, #endif /* __linux__ */ #if defined(__FreeBSD__) || defined(__OpenBSD__) { .name = "swapused", .key = 'Z', .doc = "The used drive swap in MB." }, { .name = "swaperc", .key = 'F', .doc = "The used drive swap in percentage." }, { .name = "swaptotal", .key = 'h', .doc = "The total drive swap." }, { .name = "swapavail", .key = 'H', .doc = "The available drive swap." }, { .name = "nicgw", .key = 'j', .arg = "re0", .doc = "The NIC gateway address." }, #endif /* __FreeBSD__ || __OpenBSD__ */ { .doc = NULL } }; struct arguments { char *all; }; static error_t parse_opt(int key, char *arg, struct argp_state *state) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmissing-field-initializers" struct timespec tc = {0}; #pragma GCC diagnostic pop struct arguments *arguments = state->input; switch(key) { NEW_MPD_LABEL('x', char song_artist[VLA], song_artist, 2, FMT_SONG); NEW_MPD_LABEL('X', char song_title[VLA], song_title, 3, FMT_SONG); NEW_MPD_LABEL('y', char song_album[VLA], song_album, 4, FMT_SONG); NEW_MPD_LABEL('Y', char song_date[VLA], song_date, 5, FMT_SONG); NEW_MPD_LABEL('M', char song[VLA], song, 6, FMT_SONG); NEW_CPU_LABEL('c', char cpu[VLA], cpu, FMT_CPU, CPU_STR); NEW_CPU_LABEL('L', char cores_load[VLA], cores_load, FMT_CORES, CPU_STR); NEW_LABEL('T', char cpu_temp[VLA], cpu_temp, FMT_TEMP); NEW_RAM_LABEL('J', char ram_total[VLA], ram_total, 1, FMT_RAM2, RAM_STR); NEW_RAM_LABEL('K', char ram_free[VLA], ram_free, 2, FMT_RAM2, RAM_STR); NEW_RAM_LABEL('r', char ram_perc[VLA], ram_perc, 5, FMT_RAM, RAM_STR); NEW_SSD_LABEL('n', char ssd_total[VLA], ssd_total, 1, FMT_SSD2, SSD_STR); NEW_SSD_LABEL('N', char ssd_free[VLA], ssd_free, 2, FMT_SSD2, SSD_STR); NEW_SSD_LABEL('O', char ssd_avail[VLA], ssd_avail, 3, FMT_SSD2, SSD_STR); NEW_SSD_LABEL('s', char ssd_perc[VLA], ssd_perc, 4, FMT_SSD, SSD_STR); NEW_LABEL('p', char packs[VLA], packs, FMT_PKGS, PKG_STR); NEW_KERNEL_LABEL('P', char kernel_sys[VLA], kernel_sys, 1, FMT_KERN); NEW_KERNEL_LABEL(KERNODE, char kernel_node[VLA], kernel_node, 2, FMT_KERN); NEW_KERNEL_LABEL('Q', char kernel_rel[VLA], kernel_rel, 3, FMT_KERN); NEW_KERNEL_LABEL('R', char kernel_ver[VLA], kernel_ver, 4, FMT_KERN); NEW_KERNEL_LABEL('u', char kernel_arch[VLA], kernel_arch, 5, FMT_KERN); NEW_KERNEL_LABEL('k', char kernel[VLA], kernel, 6, FMT_KERN); NEW_LABEL('U', char uptime[VLA], uptime, FMT_UP, UP_STR); NEW_LABEL('w', char loadavg[VLA], loadavg, FMT_LOAD, LOAD_STR); NEW_LABEL('v', char voltage[VLA], voltage, FMT_VOLT, VOLT_STR); NEW_LABEL('m', char mobo[VLA], mobo, FMT_MOBO, MOBO_STR); NEW_LABEL('d', char mobo_temp[VLA], mobo_temp, FMT_TEMP); NEW_LABEL('f', char fans[VLA], fans, FMT_FANS, FANS_STR); NEW_LABEL('t', char taim[VLA], taim, FMT_TIME" ", TIME_STR); NEW_NET_LABEL('b', char net[VLA], net, 1, FMT_NET, NET_STR); NEW_NET_LABEL('i', char net_speed[VLA], net_speed, 2, FMT_NET, SPEED_STR); NEW_NET_LABEL('a', char net_addr[VLA], net_addr, 3, FMT_KERN); NEW_NET_LABEL('A', char mac[VLA], mac, 4, FMT_KERN); NEW_NET_LABEL('B', char mask[VLA], mask, 5, FMT_KERN); NEW_NET_LABEL('D', char net_cast[VLA], net_cast, 6, FMT_KERN); NEW_ARG_LABEL('E', char ip_lookup[VLA], ip_lookup, FMT_KERN); NEW_RAM_LABEL('l', char ram_shared[VLA], ram_shared, 3, FMT_RAM2, RAM_STR); NEW_LABEL('g', char battery[VLA], battery, FMT_BATT, BATT_STR); NEW_ARG_LABEL('S', char statio[VLA], statio, FMT_STATIO, STATIO_STR); NEW_LABEL(DRIVETEMP, char drivetemp[VLA], drivetemp, FMT_TEMP); #if WITH_PERL == 1 NEW_ARG_LABEL(PERLSCRIPT, char perl[VLA], perl, FMT_KERN); #endif /* WITH_PERL */ #if WITH_LUA == 1 NEW_ARG_LABEL(LUASCRIPT, char lua[VLA], lua, FMT_KERN); #endif /* WITH_LUA */ #if WITH_RUBY == 1 NEW_ARG_LABEL(RUBYSCRIPT, char ruby[VLA], ruby, FMT_KERN); #endif /* WITH_RUBY */ #if WITH_PYTHON == 1 NEW_ARG_LABEL(PYTHONSCRIPT, char python[VLA], python, FMT_KERN); #endif /* WITH_PYTHON */ #if WITH_WEATHER == 1 NEW_ARG_LABEL('q', char weather[VLA], weather, OUT_STR YELLOW STR_SPEC" "); #endif /* WITH_WEATHER */ #if defined(HAVE_MPD_CLIENT_H) NEW_MPD_LABEL('W', char song_track[VLA], song_track, 1, FMT_SONG); #endif /* HAVE_MPD_CLIENT_H */ #if defined(HAVE_CDIO_CDIO_H) || defined(__linux__) NEW_LABEL('z', char dvd[VLA], dvd, FMT_KERN); #endif /* HAVE_CDIO_CDIO_H || __linux__ */ #if !defined(__OpenBSD__) NEW_RAM_LABEL('o', char ram_buffer[VLA], ram_buffer, 4, FMT_RAM2, RAM_STR); #endif /* !__OpenBSD__ */ #if defined(__FreeBSD__) || defined(__OpenBSD__) NEW_SWAPP_LABEL('h', char swapp_total[VLA], swapp_total, 1, FMT_SSD2, SSD_STR); NEW_SWAPP_LABEL('H', char swapp_avail[VLA], swapp_avail, 2, FMT_SSD2, SSD_STR); NEW_SWAPP_LABEL('Z', char swapp_used[VLA], swapp_used, 3, FMT_SSD2, SSD_STR); NEW_SWAPP_LABEL('F', char swapp_perc[VLA], swapp_perc, 4, FMT_SSD2, SSD_STR); NEW_NET_LABEL('j', char nic_info[VLA], nic_info, 7, FMT_KERN); #endif /* __FreeBSD__ || __OpenBSD__ */ #if defined(__linux__) NEW_NET_LABEL('j', char nic_info[VLA], nic_info, 10, FMT_KERN); NEW_NET_LABEL('h', char wifiname[VLA], wifiname, 11, FMT_KERN); NEW_ARG_LABEL('F', char ssd_model[VLA], ssd_model, FMT_KERN); NEW_NET_LABEL(NICDRV, char nic_drv[VLA], nic_drv, 8, FMT_KERN); NEW_NET_LABEL('H', char nic_ver[VLA], nic_ver, 9, FMT_KERN); NEW_ARG_LABEL('G', char nic_info[VLA], nic_info, FMT_KERN); NEW_NET_LABEL('e', char link_speed[VLA], link_speed, 7, FMT_KERN); #endif /* __linux__ */ case 'V': #if defined(HAVE_ALSA_ASOUNDLIB_H) || defined(HAVE_SYS_SOUNDCARD_H) || \ defined(HAVE_SOUNDCARD_H) { char volume[VLA]; GET_N_FMT(volume, arguments->all, FMT_VOL, VOL_STR, volume); } break; #else FPRINTF("%s\n", "recompile the program --with-alsa or --with-oss"); return ARGP_KEY_ERROR; #endif /* HAVE_ALSA_ASOUNDLIB_H || HAVE_SYS_SOUNDCARD_H || HAVE_SOUNDCARD_H */ case 'C': #if defined(__i386__) || defined(__i686__) || defined(__x86_64__) { char cpu_clock_speed[VLA]; GET_N_FMT(cpu_clock_speed, arguments->all, FMT_CPUSPEED, cpu_clock_speed); } break; #else FPRINTF("%s\n", "This option is not supported " "by your CPU architecture"); return ARGP_KEY_ERROR; #endif /* __i386__ || __i686__ || __x86_64__ */ case 'I': #if defined(__i386__) || defined(__i686__) || defined(__x86_64__) { char cpu_info[VLA]; GET_N_FMT(cpu_info, arguments->all, FMT_CPUSPEED, cpu_info); } break; #else FPRINTF("%s\n", "This option is not supported " "by your CPU architecture"); return ARGP_KEY_ERROR; #endif /* __i386__ || __i686__ || __x86_64__ */ default: return ARGP_ERR_UNKNOWN; } return EXIT_SUCCESS; } static const struct argp arg_parser = { .parser = parse_opt, .options = options, .doc = doc }; void parse_opts(int argc, char *argv[], char *combined) { struct arguments arguments = { .all = combined }; argp_parse(&arg_parser, argc, argv, ARGP_IN_ORDER, NULL, &arguments); } void parse_konf(char *combined) { FILE *fp = NULL; char *ptr = NULL; char *ello[] = { (char *)"pinkybar", NULL }; char buf[100], conf[50], temp[100]; struct arguments arguments = { .all = combined }; snprintf(conf, 49, "%s%s", getenv("HOME"), "/.pinky"); if (NULL == (fp = fopen(conf, "r"))) { exit_with_err(ERR, "~/.pinky doesn't exist."); } while (NULL != (fgets(buf, 99, fp))) { if (EOF == (sscanf(buf, "%s", temp))) { CLOSE_X(fp); exit_with_err(ERR, "empty line(s) detected."); } ptr = temp; while (0 != (isspace((unsigned char) *ptr))) { ptr++; } ello[1] = ptr; argp_parse(&arg_parser, 2, ello, ARGP_IN_ORDER, NULL, &arguments); } CLOSE_X(fp); }
void0/pinky
src/options.c
C++
unknown
17,739